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#
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