3
ARGS=1 # Number of arguments expected.
4
E_BADARGS=85 # Exit value if incorrect number of args passed.
7
# ^^^^^^^^^^^^ condition #1
8
echo "Usage: `basename $0` $ARGS argument(s)" && exit $E_BADARGS
10
# If condition #1 tests true (wrong number of args passed to script),
11
#+ then the rest of the line executes, and script terminates.
13
# Line below executes only if the above test fails.
14
echo "Correct number of arguments passed to this script."
18
# To check exit value, do a "echo $?" after script termination.