| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # func-cmdlinearg.sh |
| 3 | # Call this script with a command-line argument, |
| 4 | #+ something like $0 arg1. |
| 5 | |
| 6 | |
| 7 | funcscip-shell shell abs-guide 10-4 func(). () |
| 8 | |
| 9 | { |
| 10 | echoscip-shell system . . echo. "$1" # Echoes first arg passed to the function. |
| 11 | } # Does a command-line arg qualify? |
| 12 | |
| 13 | echoscip-shell system . . echo. "First call to function: no arg passed." |
| 14 | echoscip-shell system . . echo. "See if command-line arg is seen." |
| 15 | funcscip-shell shell abs-guide 10-4 func(). |
| 16 | # No! Command-line arg not seen. |
| 17 | |
| 18 | echoscip-shell system . . echo. "============================================================" |
| 19 | echoscip-shell system . . echo. |
| 20 | echoscip-shell system . . echo. "Second call to function: command-line arg passed explicitly." |
| 21 | funcscip-shell shell abs-guide 10-4 func(). $1 |
| 22 | # Now it's seen! |
| 23 | |
| 24 | exit 0 |