Check file exists code snippet
FILE_TO_CHECK="/path/to/myfile"
if [-f $FILE_TO_CHECK]; then
......
do something here
......
fi
FILE_TO_CHECK="/path/to/myfile"
if [-f $FILE_TO_CHECK]; then
......
do something here
......
fi
Check directory exists code snippet
DIR_TO_CHECK="/path/to/my/dir"
if [-d $DIR_TO_CHECK]; then
......
do something here
......
fi