Sorry I put -r I ment to out -w but its not perform none of -w, -r, -x flags
Using centos 6.4
#!/bin/bash
echo -e "enter the name of file :\c"
read file_name
if [ -f $file_name ]
then
if [ -w $file_name ]
then
echo "Type some text date. Tp quit press crtl-"
cat >> $file_name
else
echo "The file does not have permission"
fi
else
echo "$file_name not exists"
fi