Shell Operation (Bash Reference Manual)
Last updated
Was this helpful?
Last updated
Was this helpful?
The following is a brief description of the shell’s operation when it reads and executes a command. Basically, the shell does the following:
Reads its input from a file (see ), from a string supplied as an argument to the -c invocation option (see ), or from the user’s terminal.
Breaks the input into words and operators, obeying the quoting rules described in . These tokens are separated by metacharacters
. Alias expansion is performed by this step (see ).
Parses the tokens into simple and compound commands (see ).
Performs the various shell expansions (see ), breaking the expanded tokens into lists of filenames (see ) and commands and arguments.
Performs any necessary redirections (see ) and removes the redirection operators and their operands from the argument list.
Executes the command (see ).
Optionally waits for the command to complete and collects its exit status (see ).