#!/bin/bash exec echo "Exiting \"$0\" at line $LINENO." # Exit from script here. # $LINENO is an internal Bash variable set to the line number it's on. # ---------------------------------- # The following lines never execute. echo "This echo fails to echo." exit 99 # This script will not exit here. # Check exit value after script terminates #+ with an 'echo $?'. # It will *not* be 99.