Skip to content

How Commands Are Interpreted (Part Two)

ksherlock edited this page Jul 29, 2016 · 5 revisions

This is how commands are interpreted in mpw-shell.

  1. Join lines and remove # comments
  2. parse control structures - begin/end, ( ... ), for/end, loop/end, ;, |, ||, &&;
  3. replace variables (and someday subshells)
  4. split into tokens, remove quotes and escape characters
  5. process i/o redirection
  6. execute the command (builtin or external)
Clone this wiki locally