Aug 232011
Check if a file exist in Bash Shell
Answer:
The following script demonstrates how to check if a file exist, using shell (Bash) script
#!/bin/bash
if [ -e test.txt ]
then
echo 'The file exists.'
else
echo 'The file does not exist.'
fi