Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #This is script is meant to be an add on to another one I'm using. Based on the return code output it will mail me the #message.
- read -p "What is the file name? " variable
- rc = $?
- ls -al $variable
- if [[ $rc != 0 ]]; then
- mail -s "$variable script did not complete" email address -- -f email address \
- << EOF Your script has failed with error code $rc << EOF;
- elif [[ $rc = 0 ]]; then
- mail -s "Your script completed" email address -- -f email address \
- << EOF Your script completed with error code $rc. << EOF;
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement