$0 | The name of the script file (like argv[0] in C) |
$1, $2, ... | The positional arguments (like argv[1], argv[2]... in C) |
$@ | Expands to a string containing all positional arguments (but not $0), separated by spaces. |
$# | The number of arguments (not counting $0). Similar to argc in C. |
$$ | The process ID of the running script (not of the calling process). |
$? | The exit status (return value) of the last foreground process. This is used to test the return value of programs run from the script. |
$(command) | Expands to the stdout output by the command in the parens. Note that the same effect can be produced by surrounding the command with backticks, but that syntax is becoming depreciated. |
|
Copyright (C) 2005 by Steve Litt, you
can freely distribute
unmodified copies if this copyright notice and disclaimer are
intact.
This material originally appeared on Troubleshooters.Com.
This presentation has no warranty, express or implied,
including,
but not limited to, the implied warranties of merchantability and
fitness
for a particular purpose. The entire risk as to the quality and
performance
of the presentation is with you. Neither the author nor those who show
the slideshow are responsible for any damage caused by errors,
omissions,
or anything else relating to this slideshow.
|