Monday, March 14, 2016

script to check if the file exists

#!/usr/bin/ksh
## This is a simple script to check if the file exists in a dir or not
## Created by : Arvind Reddy
## This will prompt for

echo " file name please : "
read FILENAME;
export dataDir=/u01/app/oracle/dpump;
sourceFile=SCOTT.dmp;

cd /u01/app/oracle/dpump;
echo `pwd`

##Did we get a file?

if [ -e ${dataDir}/${sourceFile} ];then
echo "Found file !! "
else
echo " No file found !!! "
fi

No comments:

Post a Comment