added table 5.3 which briefly demonstrates how variables can be set in the shell

This commit is contained in:
tomit4 2022-05-07 17:10:54 -07:00
parent 12616564c6
commit 436ec971a5

View file

@ -0,0 +1,12 @@
--------------------- Table 5.3 ---------------------
$var value of var; nothing if var is undefined
${var} same; useful if alphanumerics follows variable name
${var-thing} value of var if defined; otherwise thing.
$var unchanged.
${var=thing} value of var if defined; otherwise thing.
If undefined, $var set to thing
${var?message} if defined, $var. Otherwise print message
and exit shell. if Message empty, print:
var: parameter not set
${var+thing} thing if $var defined, otherwise nothing