Accept filename and displays last modification time if file exists, otherwise display appropriate message.

echo -e “Enter the file name::\c”

read str

if [ -f $str ]

then

echo “File present”

ls -l $str

else

echo “File not present”

fi

 

OUTPUT::

 

Enter the file name::marksheet

File present

-rw-r–r– 1 abc None 84 Sep 27 17:04 marksheet

 

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.