I am just learning how to write a script and this is my 1st script to change the case of the filenames in the current directory.I am using RHEL5 server.
But each time I execute this it says
./tr1.sh: line 20: syntax error near unexpected token `fi'
./tr1.sh: line 20: ` fi'
Is there any error in this script ??I am unable to identify the error.
#Author: Priyadarshee Divyashree kumar
for i in `ls -A`
if [ $i = $myscriptname ]
echo "Sorry, can't apply script on $myscriptname!"
elif [ $i != $myscriptname ]
newname=`echo $i | tr a-z A-Z`
mv $i $newname