[PLUG] Converting Uppercase File Names to Lowercase

Bill Barry bill at billbarry.org
Sat Jun 22 15:47:27 UTC 2013


On Sat, Jun 22, 2013 at 8:35 AM, Rich Shepard <rshepard at appl-ecosys.com>wrote:

>    My Nikon CoolPix puts all file names in uppercase and I want to convert
> them to lowercase names. I've tried a shell script Wil Cooley provided in
> 2005 but it's not working for me. I'd greatly appreciate learning where the
> syntax is incorrect.
>
>    Here is a representative file name:
>
> DSCN0064.JPG
>
>    Here's Wil's script:
>
> for FiLe in *; do
>      file=$(echo "${FiLe}"|tr '[:upper:]' '[:lower:]')
>      echo mv -i "${FiLe}" "${file}"
> done
>
>    When I copy this to the command line the output is:
>
> mv -i
>
> for each file in the subdirectory.
>
> Rich
>
>
Rich,

Remove the second echo
     echo mv -i "${FiLe}" "${file}"
->
      mv -i "${FiLe}" "${file}"


Or maybe you could turn the camera upside down?

Bill



More information about the PLUG mailing list