GNU Info

Info Node: (bashref.info)Shell Operation

(bashref.info)Shell Operation


Next: Quoting Up: Shell Syntax
Enter node , (file) or (file)node

Shell Operation
---------------

   The following is a brief description of the shell's operation when it
reads and executes a command.  Basically, the shell does the following:

  1. Reads its input from a file (Note: Shell Scripts), from a string
     supplied as an argument to the `-c' invocation option (Note:
     Invoking Bash), or from the user's terminal.

  2. Breaks the input into words and operators, obeying the quoting
     rules described in Note: Quoting.  These tokens are separated by
     `metacharacters'.  Alias expansion is performed by this step
     (Note: Aliases).

  3. Parses the tokens into simple and compound commands (Note: Shell
     Commands).

  4. Performs the various shell expansions (Note: Shell Expansions),
     breaking the expanded tokens into lists of filenames (Note:
     Filename Expansion) and commands and arguments.

  5. Performs any necessary redirections (Note: Redirections) and
     removes the redirection operators and their operands from the
     argument list.

  6. Executes the command (Note: Executing Commands).

  7. Optionally waits for the command to complete and collects its exit
     status (Note: Exit Status).



automatically generated by info2www version 1.2.2.9