Write a Shell Program To Test Whether a Particular File Exists Gain Infiniti

Write a Shell Program To Test Whether a Particular File Exists


filename=$1
if [ -e $filename ]
then
    echo "$filename exist!"
else
    echo "$filename !exist"
fi


OUTPUT:-

#!/bin/bash
#root@slack-linunx:~/scripts# ./fileExist.sh testFile
#testFile exist!
#root@slack-linunx:~/scripts#

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 

Design By Manish and Ranjan