| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | ARGS=1 # Number of arguments expected. |
| 4 | E_BADARGS=85 # Exit value if incorrect number of args passed. |
| 5 | |
| 6 | testscip-shell system . . test. $# -ne $ARGS && \ |
| 7 | # ^^^^^^^^^^^^ condition #1 |
| 8 | echoscip-shell system . . echo. "Usage: `basenamescip-shell system . . basename. $0` $ARGS argument(s)" && exit $E_BADARGS |
| 9 | # ^^ |
| 10 | # If condition #1 tests true (wrong number of args passed to script), |
| 11 | #+ then the rest of the line executes, and script terminates. |
| 12 | |
| 13 | # Line below executes only if the above test fails. |
| 14 | echoscip-shell system . . echo. "Correct number of arguments passed to this script." |
| 15 | |
| 16 | exit 0 |
| 17 | |
| 18 | # To check exit value, do a "echo $?" after script termination. |