1) Tokenization

  • meta characters
    • |
    • &
    • ;
    • ()
    • <>
    • space, tab, newline
  • word
    • a token that doesn’t contain unquoted metacharacters
  • operator
    • a token that contains at least one metacharacter
wordtoken
never contains unquoted operatoralways contains unquoted metacharacters

2) Command identification

3) Expansion

4) Quote removal

Quoting is about removing of special meaning

  • Backslash (\): Remove special meaning immediately the next character
  • Single quote (’ ’): Remove all special meaning of characters inside it
  • Double quote (” ”): Same as single quote except dollar sign ($) and backtick ( ` )

5) Redirection