Wednesday, December 4, 2013

Expansion

http://linuxcommand.org/lc3_lts0080.php

command substitution:
$(command)
`command`

Arithmetic expansion:
c-style integer expansion: ((expression))
Integer expansion: $[ ] 
bash builtin let command:  let counter="counter + 1"

subprocess expr:  counter=`expr counter + 1'  (must have space around operator)

Quoting:
double quote: all the special characters used by the shell lose their special meaning and are treated as ordinary characters. The exceptions are “$”, “\” (backslash), and “`” (back- quote). This means that word-splitting, pathname expansion, tilde expansion, and brace expansion are suppressed, but parameter expansion, arithmetic expansion, and command substitution are still carried out.

Single quote: suppress all expansions

No comments:

Post a Comment