2nd Linux

PHOTO EMBED

Wed Nov 29 2023 07:45:23 GMT+0000 (Coordinated Universal Time)

Saved by @viinod07

Write a 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.

Script:

echo "Enter File Name: " 

read fileName

if [ ! -f $fileName ]

then

echo "Filename $fileName does not exists" 

exit 

fi

echo “The content in the File $fileName is:”

`tr '[A-Z]' '[a-z]' < $fileName`

Output:

Enter File Name:

Sample

The content in the File Sample is:

HI

THIS IS LINUX & SHELL PROGRAMMING LAB
content_copyCOPY