Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Why am I getting 'command not found' errors for -e, -w, -r and -x in this program?

0 votes
asked May 22 by Sabiha M (120 points)
#!/bin/bash
echo "enter file name"
 read fn
if test
-e $fn
then
echo "file exists"
else
echo "file does not exists"
fi
if test
-w $fn ; then
echo "writable"
fi
if test
-r $fn
then
echo "readable"
fi
if test
-x $fn
then
echo "executable"
fi
if test -d $fn
then
echo "directory"
fi

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...