Log In | Not a Member? | Support | |
SYNTAX Shift [number] DESCRIPTION The Shift command renames the command script positional parameters {number+1}, {number+2}… to {1}, {2}, and so on. If you do not specify number, Shift uses 1 as the default. This makes parameter {2} become {1}, parameter {3} become {2}, and so on. This is especially useful for stepping down parameters in scripts using a loop. Note that although this command does not affect parameter {0} (the command name), it does modify the {Parameters}, {"Parameters"}, and {#} variables to reflect the new parameters. INPUT None OUTPUT None STATUS
Shift can return the following status codes:
PARAMETERS number Specifies the number in the parameters {number+1}, {number+2}, and so on. If you omit this parameter, Shift assumes that number is 1. OPTIONS None EXAMPLES The following script uses Shift to repeat a command once for each parameter. Break stops the loop when all the parameters have been used.
# Execute command once for each parameter in the You might, for example, use the following Repeat script to compile several C programs with progress information: Repeat 'SC -p' Sample.c Count.c Memory.c
|