| 1 | #!/bin/bash |
| 2 | |
| 3 | exec echo "Exiting \"$0\" at line $LINENO." # Exit from script here. |
| 4 | # $LINENO is an internal Bash variable set to the line number it's on. |
| 5 | |
| 6 | # ---------------------------------- |
| 7 | # The following lines never execute. |
| 8 | |
| 9 | echo "This echo fails to echo." |
| 10 | |
| 11 | exit 99 # This script will not exit here. |
| 12 | # Check exit value after script terminates |
| 13 | #+ with an 'echo $?'. |
| 14 | # It will *not* be 99. |