Write a shell script to test the file is a executable file or not. 

echo "Enter file name"
read fn

if [ ! -f $fn ]
then
	echo "File $fn is not exist"
else
	if [ ! -x $fn ]
	then
		echo "File $fn is not executable"
	else
		echo "File $fn is executable"	
	fi
fi

Comments

Leave a Reply

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