11.5. Command Line Arguments

Shell scripts can take command line arguments. Arguments are used to modify the behavior of the program in some way. The TC shell assigns command line arguments to positional parameters and enforces no specific limit on the number of arguments that can be assigned. (The Bourne shell sets a limit of nine positional parameters.) Positional parameters are number variables. The script name is assigned to $0, and any words following the script name are assigned to $1, $2, $3 . . . ${10}, ${11}, and so on. $1 is the first command line argument. In addition to using positional parameters, the TC shell provides the argv built-in array.

11.5.1. Positional Parameters and argv

If you are using the argv array notation, a valid ...

Get Linux Shells by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.