Loverit.sh

Da WikiSitech.
Vai alla navigazioneVai alla ricerca

  1. !/bin/sh
  2. lowerit
  3. convert all file names in the current directory to lower case
  4. only operates on plain files--does not change the name of directories
  5. will ask for verification before overwriting an existing file

for x in `ls`

 do
 if [ ! -f $x ]; then
   continue
 fi
 lc=`echo $x  | tr '[A-Z]' '[a-z]'`
 if [ $lc != $x ]; then
   mv -i $x $lc
 fi

done

  1. !/bin/sh
  2. upperit
  3. convert all file names in the current directory to upper case
  4. only operates on plain files--does not change the name of directories
  5. will ask for verification before overwriting an existing file

for x in `ls`

 do
 if [ ! -f $x ]; then
   continue
 fi
 lc=`echo $x  | tr '[a-z]' '[A-Z]'`
 if [ $lc != $x ]; then
   mv -i $x $lc
 fi

done