testing file permissions.....

script name: filetest.sh

if [ $# -eq 0 ] ; then
echo " You didn't enter any argument"
elif [ ! -e $1 ] ; then
echo " file not exist"
elif [ ! -r $1 ] ; then
echo " file not readable"
elif [ ! -w $1 ] ; then
echo " file not writable"
else
echo " file both readable and writable"
fi

running like...

$ ./filetest filename

but it showing.....both readable and writable

for those file which are not readable and writable

This script should work. I also did use the code & verify. Can you check file permissions & file ownership details?

Agreed the script works in a Posix shell as a non-root user.
It gives misleading answers if you are user "root.

Using the elif construct; the script would only inform you the file was not readable even if it was not readable and not writeable. These conditions would probably be better expressed as individual if statements so you get a complete report. You could also add a check for executable as well.