Write a shell script to test file is an executable or not. [OR exists or not/ readable(Also display total number of lines, words, characters of file.) in unix/linux

echo “enter the file name”

read a

if [ -x $a ]

then

echo “executable”

wc $a

else

echo “not executable”

wc $a

fi


Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post