Neat utility to convert uppercase filenames

Jerry Roe jrr at nsc.nsc.com
Fri Dec 14 11:06:13 AEST 1990


In article <1990Dec11.150025.2119 at mdivax1.uucp> mdivax1!bb29c!mitchell (Bill Mitchell) writes:
>>
>> (shell script deleted)
>
>Yours is similar to the one I was using, until I saw this one posted:
>
>for file in $*
>do
>	mv -i $file `echo $file | tr A-Z a-z`
>done
>
>The mv program typically refuses to overwrite an existing file and, having
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>failed, leaves the original file in place with its original name.


Uh, it's implicit in your script because of the "-i" option to mv, but some
newer Unix users might miss that and instead focus on the "typically refuses
to overwrite" part of your comment.  mv, of course, typically *gladly* over-
writes an existing file if used without the -i option.

Yeah, I know - this is a source group, not discussion, so sorry for the
non-source posting, but I thought some poor novice might benefit.


Jerry Roe
National Semiconductor
Santa Clara, CA



More information about the Alt.sources mailing list