Write a shell script to test that the file is a readable file or not

echo "enter file name"
read fn

if [ ! -f $fn ]
then
	echo "Sorry this file is not exist"
elif [ -r $fn ] 
then
	echo "yes $fn is readable file"
else
	echo "Sorry $fn is not readable file"
fi

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *