On Thursday 04 November 2004 10:39, Rajarshi Guha wrote: > On Wed, 2004-11-03 at 21:28, dipankar das wrote: > > > When renaming MSW upper-case filenames to lowercase, > > there is 'lc' from shtools, and other ways too. Or, for > > massive multiway multioption renaming there are heavy-duty > > packages like 'krename'. > >
> > tr, find and bash is all you need :) > Dear Guha Thank you for the suggestion. Never used 'tr' before. Now made a script with 'tr'. But obviously Debashish was the last one to like you. His 126 lines code was rendered useless by this 17 lines script. It does exactly the same thing. Pasting the script here. dipankar das ----------------------------------------------------------------------------- #!/bin/bash # changename, glt, 2004 echo Changing Filename echo From upper-case to lower and eliminating whitespace echo "1 replaces whitespace with dot (.)" echo "2 annihilates whitespace" echo What is your option? read option for oldfile in * do test $option -eq 1 && newfile=`echo $oldfile| tr [:upper:] [:lower:]| tr [:blank:] '.'` test $option -eq 2 && newfile=`echo $oldfile| tr [:upper:] [:lower:]| tr -d [:blank:]` test $option -eq 1 || test $option -eq 2 || echo Are you literate? && exit if [ "$newfile" != "$oldfile" ] then mv "$oldfile" "$newfile" fi done -------------------------------------------------------------------------------- -- To unsubscribe, send mail to [EMAIL PROTECTED] with the body "unsubscribe ilug-cal" and an empty subject line. FAQ: http://www.ilug-cal.org/node.php?id=3
