Hi,
Could somebody please let me know if the following code is a valid way for checking if a file DOES NOT exist:
if test ! -f "$location/parse.txt" ; then
echo parse file doesn't exist
load_data
fi
I am using the bourne shell. I have been taking pieces of scripts from different sources on the web and not sure that the above test is actually going to work correctly all of the time.
At the moment I can't seem to get it working. If I remove the exclamation mark it does test if the file exists correctly. However, I would like to test that the file does not exist.
Many Thanks