postheadericon Write a shell script to accept filename and displays last modification time if file exists, otherwise display appropriate message.


clear
echo "Enter filename"
read fileName

if [ -f $fileName ]
then
echo "Modification time of [ $fileName ] is \c "
ls -l $fileName | cut -c 37-41
else
echo "file [ $fileName ] not exist in \c "
pwd
fi

0 comments:

Follow by Email

Total Pageviews

© BipinRupadiya.com. Powered by Blogger.