Converting Uppercase to Lowercase
Hey all :-)
I've got a whole bunch of files that i want to convert to lower case, when I started scripting in Linux I read the Linux Shell Scripting Tutorial and use the script that I made from there to rename uppercase filenames to lowercase. The question I have is how would you go about changing the filenames if they have spaces or are directories? The script that is in the tutorial works but not for these files.... |
So you have a set of files and directories that may or may not be in capital letters, and may or may not contain spaces. You want the capital letters converted to lowercase letters, and the spaces removed entirely?
Just making sure I am understanding you correctly. |
Almost, basically I want an unconditional change from uppercase to lowercase, no matter about spacing or if it's a folder.....
:) |
Oh. So, folders receive the case conversion as well as the files. I figured that. Not sure what you mean by spacing though.
|
Basically if there's a file called "I'm back" I need "i'm back"
|
Here's an example of it working...
Code:
[frozen@Fr0ZeN scripts]$ ls test Code:
#!/bin/sh |
Sorry to bump such an old thread. Just goes to show what kind info you can locate on LQ with the search function!
I'm hunting a solution for converting files to lowercase and a friend pointed me to this URL. Source: ftp://garbo.uwasa.fi/unix/ts/namedown Code:
With this script it doesn't seem to convert filenames with spaces in them. Kyle's script doesn't protect against overwriting lowercase versions of the file if one exists already. But both are pretty cool scripts especially when not having a mastery of shell scripting to create one! |
All times are GMT -5. The time now is 07:19 PM. |