Write a shell script to test if the file is an executable or not [OR exists or not/readable(Also display total number of lines, words, characters of file.)]
unix shell script to check file executable or not unix have operator -x -x operator check if file executable or not
code
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!