shell script for converting filenames to proper case?
Hi,
Does anyone have a shell script to recommend to convert all files in a directory to proper case? (if the character previous to this is space, then capitalize, if not, set lower-case). I assume there's a clever way to do this with bash+sed+awk, but with limited knowledge I do not even know where to start googling... Thanks for any pointers or ideas... The ideal thing would be a bash function such as "convert_to_upper()" that took care of it ;) -Y1 |
Quote:
Code:
#!/bin/bash |
Hi and thanks for answering.
Good start, but this only converts lower to upper, not miXeD cAsE to Proper Case (first after space=CAPS - rest small) Anyone? -Y1 |
Code:
#!/usr/bin/perl |
Works like a charm - thanks much puffinman!
|
great solution
Thanks HKO.. that worked just great.
I used it to rename some music files nad it did the job perfectly |
bash script
Here is a pretty simple bash script
Code:
#!/bin/bash Code:
> ./propercase abcdef ABCDEF aBcDeF AbCdEf abcDEF ABCdef |
Quote:
|
Quote:
What I do wish is there was a way to combine the two string functions into one, like Code:
echo -n ${{i,,}^} |
Quote:
Quote:
|
All times are GMT -5. The time now is 08:31 PM. |