DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Customizing your environment

How the shell works

Your login shell reads its standard input from your terminal, and sends its standard output and standard error back to your terminal unless you tell it to send them elsewhere. The shell is line oriented; it does not process your commands until you press <Enter> to indicate the end of a line. You can correct your typing as you go. Different shells provide different facilities for editing your commands, but they generally recognize <Bksp> or <Del> as the keystroke to delete the previous character.

When you press <Enter>, the shell interprets the line you have entered before it executes the commands on that line. The steps it runs through are as follows:

  1. The shell splits the line into tokens. A token is a command, variable, or other symbol recognized by the shell. It continues to build up a sequence of tokens until it comes to a reserved word (a shell internal command that governs the flow of control of a shell script), function name, or operator (a symbol denoting a pipe, a logical condition, a command separator, or some other operation that cannot be carried out until the preceding command is evaluated).

  2. The shell organizes the tokens into three categories:

  3. The commands may then be executed, either as internal shell commands (that cause the shell itself to take some action) or, if they are not internal commands, as external programs (if the shell can locate an executable file of that name).

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004