Differenze tra le versioni di "Loverit.sh"
Da WikiSitech.
Vai alla navigazioneVai alla ricerca (Nuova pagina: <code> #!/bin/sh # lowerit # convert all file names in the current directory to lower case # only operates on plain files--does not change the name of directories # will ask for verifi...) |
|||
Riga 11: | Riga 11: | ||
fi | fi | ||
lc=`echo $x | tr '[A-Z]' '[a-z]'` | lc=`echo $x | tr '[A-Z]' '[a-z]'` | ||
+ | if [ $lc != $x ]; then | ||
+ | mv -i $x $lc | ||
+ | fi | ||
+ | done | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | #!/bin/sh | ||
+ | # upperit | ||
+ | # convert all file names in the current directory to upper case | ||
+ | # only operates on plain files--does not change the name of directories | ||
+ | # 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 | if [ $lc != $x ]; then | ||
mv -i $x $lc | mv -i $x $lc |
Versione delle 17:13, 30 gen 2009
- !/bin/sh
- lowerit
- convert all file names in the current directory to lower case
- only operates on plain files--does not change the name of directories
- 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
- !/bin/sh
- upperit
- convert all file names in the current directory to upper case
- only operates on plain files--does not change the name of directories
- 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