Friday, 12 December 2014

Shell Script to check whether a file is Writable

Write a Shell Script to check whether a file is Writable

Solution:

echo "Enter a file name"
read a
if [ ! -w $a ]
then
echo "File is not writable so you cannot edit the file"
else
echo "You can edit the file"
fi

Execution:


No comments:

Post a Comment