Saturday, May 23, 2015

Simple shell script to find out the file exists or not

Script
#!/bin/bash
#name: filecheck.sh
#simple script to find out the file exists or not
if [ -f $1 ]
then
echo " $1 exists "
else
echo " $1 does not exist"
fi
Script usage: ./filecheck filename

0 Comments: