I am writing a backup script and I would like to find a way (for error checking) to terminate the script early. I am using an if statement to check to see if /backup if a file instead of a directory. If it is, then I just want to terminate the script. That would keep me from wrapping the script in an if statement. Here is the if statement I am using:
Code:
if [ -a /backup ];
then
echo "Warning: /backup is a file, not a directory"
# here is where I want to terminate the script
fi
So can anyone help me out?
Thanks
OTF