First page Back Continue Last page Overview Graphics
Variables
Variables are essentially always strings, traditionally named in all caps, expanded with $ or ${}, and are set without $ at the start of a line:
-
- SPAM=$HOME/mail/spam
- mv $TENSPAM ${SPAM}.tmp
- sa-learn --showdots --spam --mbox $SPAM.tmp
- rm ${SPAM}.tmp
Export command makes available to sub-programs, ie, "export SPAM=..." to set and export, or "export SPAM" to just export. Needed in ~/.bashrc, e.g. with PATH
"set" and "env" commands list environment variables currently set; some already set like UID, HOME.
Variables expanded within double-quotes, but not within single quoted strings (compare echo “$HOME” with echo '$HOME')
Notes: