bash: Shell Operation

1 
1 3.1.1 Shell Operation
1 ---------------------
1 
1 The following is a brief description of the shell's operation when it
1 reads and executes a command.  Basically, the shell does the following:
1 
1   1. Reads its input from a file (⇒Shell Scripts), from a string
11      supplied as an argument to the '-c' invocation option (⇒
      Invoking Bash), or from the user's terminal.
1 
1   2. Breaks the input into words and operators, obeying the quoting
1      rules described in ⇒Quoting.  These tokens are separated by
11      'metacharacters'.  Alias expansion is performed by this step (⇒
      Aliases).
1 
11   3. Parses the tokens into simple and compound commands (⇒Shell
      Commands).
1 
1   4. Performs the various shell expansions (⇒Shell Expansions),
11      breaking the expanded tokens into lists of filenames (⇒
      Filename Expansion) and commands and arguments.
1 
1   5. Performs any necessary redirections (⇒Redirections) and
1      removes the redirection operators and their operands from the
1      argument list.
1 
1   6. Executes the command (⇒Executing Commands).
1 
1   7. Optionally waits for the command to complete and collects its exit
1      status (⇒Exit Status).
1