bash:built-in_variables
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
bash:built-in_variables [2017/04/03 15:34] – created peter | bash:built-in_variables [2021/01/26 11:42] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
When doing scripting in the shell there are a few built-in variables that we can used: | When doing scripting in the shell there are a few built-in variables that we can used: | ||
Line 5: | Line 5: | ||
< | < | ||
$$ = The PID number of the process executing the shell. | $$ = The PID number of the process executing the shell. | ||
- | $? = Exit status variable. | + | $? = Exit status variable. Nearly all Linux programs return a 0 error status for true and anything else is false. |
$0 = The name of the command you used to call a program. | $0 = The name of the command you used to call a program. | ||
$1 = The first argument on the command line. | $1 = The first argument on the command line. |
bash/built-in_variables.1491233687.txt.gz · Last modified: 2020/07/15 09:30 (external edit)