Write a shell script to check whether entered file exists or not.

echo "enter file name"
read fn

if [ ! -f $fn ]
then
	echo "Sorry this file is not exist"
else
	echo "File $fn is exist"
fi

Comments

Leave a Reply

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