for var in $@ do check=`ls -al $var 2>/tmp/err | grep -w $var | cut -d " " -f 9` if [ "$check" == "$var" ];then upper_case=`echo $var | tr '[a-z]' '[A-Z]'` echo "file before uppercase" echo $var echo "***file after uppercase***" mv $var $upper_case echo $var else echo "$var file doesnt exists" fi done
Tuesday, 21 April 2015
Write a shell script that accepts one or more file names as arguments, and converts them all to upper case if they exist
Subscribe to:
Post Comments (Atom)
No comments:
Write comments