CHECK
IF THE FILE HAS ALL PERMISSION:
echo "checking file permission"
read fn
if [ -r $fn -a -w $fn -a -x $fn ]
then
echo "The file has all
permission"
else
echo "The file has not all
permission"
fi
OUTPUT:
[localhost ~]$ sh fileper.sh
checking file permission
pol.sh
The file has not all permission
[localhost ~]$ chmod 777 pol.sh
[localhost ~]$ sh fileper.sh
checking file permission
pol.sh
The file has all permission
[localhost
~]$
No comments:
Post a Comment
Thanks for your valuable comments