Command-line arguments: Difference between revisions
Filled out task, added example.
(initial - blank page) |
(Filled out task, added example.) |
||
Line 1:
{{Programming Task}}
Retrieve the list of command-line arguments given to the program.
Example command line:
myprogram -c "alpha beta" -h "gamma"
==[[UNIX Shell]]==
===[[sh]]===
To retrieve the entire list of arguments:
WHOLELIST="$@"
To retrieve the second and fifth arguments:
SECOND=$2
FIFTH=$5
|