[Techtalk] real life kewl text-processing

Kathryn Hogg kjh at flyballdogs.com
Sun Jan 25 14:49:48 EST 2004


Conor Daly said:
> On Sat, Jan 10, 2004 at 03:16:19PM -0600 or so it is rumoured hereabouts,
> Kathryn Hogg thought:
>>
>> A simple enhancement which I use in a similar script is to allow the
>> filenames to have path components.  In this case, you want to leave the
>> patch components alone and only lowerize the filename component:
>>
>> #!/bin/bash
>> for file in $*
>> do
>>   pathname=$(dirname $file)
>>   filename=$(basename $file)
>>   newfile=$(echo $file | tr '[:upper:]' '[:lower:]')
>                    ^^^^^
> Shouldn't that be $filename?  Otherwise you end up lowercasing the path
> also...

yes it should have been $filename


-- 
Kathryn
http://womensfootyusa.com


More information about the Techtalk mailing list