Shell script that accepts one or more file name as arguments and converts all of them to uppercase, provided they exist in the current directory

					# get filename
echo -n "Enter File Name : "
read fileName
# make sure file exits for reading
if [ ! -f $fileName ]
echo "Filename $fileName does not exists"
exit 1

# convert uppercase to lowercase using tr command
tr '[A-Z]' '[a-z]' < $fileName

Leave a Reply