Shells terminology
The terms and definitions in this table are helpful in understanding shells.
Item | Description |
---|---|
blank | A blank is one of the characters in the blank character class defined in the LC_CTYPE category. In the POSIX shell, a blank is either a tab or space. |
built-in command | A command that the shell executes without searching for it and creating a separate process. |
command | A sequence of characters in the syntax of the shell language. The shell reads each command and carries out the desired action either directly or by invoking separate utilities. |
comment | Any word that begins with pound sign (# ).
The word and all characters that follow it, until the next newline
character, are ignored. |
identifier | A sequence of letters, digits, or underscores from the portable character set, starting with a letter or underscore. The first character of an identifier must not be a digit. Identifiers are used as names for aliases, functions, and named parameters. |
list | A sequence of one or more pipelines separated by
one of the following symbols: semicolon (; ), ampersand
(& ), double ampersand (&& ),
or double bar (|| ). The list is optionally ended
by one of the following symbols: semicolon (; ), ampersand
(& ), or bar ampersand (|& ).
The semicolon (
; ),
ampersand (& ), and bar ampersand (|& )
have a lower priority than the double ampersand (&& )
and double bar (|| ). The ; , & ,
and |& symbols have equal priority among themselves.
The && and || symbols are
equal in priority. One or more newline characters can be used instead
of a semicolon to delimit two commands in a list.Note: The
|& symbol
is valid only in the Korn shell. |
metacharacter | Each metacharacter has a special meaning to the
shell and causes termination of a word unless it is quoted. Metacharacters
are: pipe (| ), ampersand (& ),
semicolon (; ), less-than sign (< ),
greater-than sign (> ), left parenthesis (( ),
right parenthesis () ), dollar sign ($ ),
backquote (` ), backslash (\ ), right
quote (' ), double quotation marks (" ),
newline character, space character, and tab character. All characters
enclosed between single quotation marks are considered quoted and
are interpreted literally by the shell. The special meaning of metacharacters
is retained if not quoted. (Metacharacters are also known as parser
metacharacters in the C shell.) |
parameter assignment list | Includes one or more words of the form Identifier=Value in
which spaces surrounding the equal sign (= ) must
be balanced. That is, leading and trailing blanks, or no blanks, must
be used.Note: In the C shell, the parameter assignment list is of
the form setIdentifier=Value. The
spaces surrounding the equal sign (
= ) are required. |
pipeline | A sequence of one or more commands separated by
pipe (| ). Each command in the pipeline, except possibly
the last command, is run as a separate process. However, the standard
output of each command that is connected by a pipe becomes the standard
input of the next command in the sequence. If a list is enclosed with
parentheses, it is carried out as a simple command that operates in
a separate subshell. If the reserved word The format for a pipeline is as follows:
Note: Early
versions of the Bourne shell used the caret (
^ ) to
indicate a pipe. |
shell variable | A name or parameter to which a value is assigned.
Assign a variable by typing the variable name, an equal sign (= ),
and then the value. The variable name can be substituted for the assigned
value by preceding the variable name with a dollar sign ($ ).
Variables are particularly useful for creating a short notation for
a long path name, such as $HOME for the home directory.
A predefined variable is one whose value is assigned by the shell.
A user-defined variable is one whose value is assigned by a user. |
simple command | A sequence of optional parameter assignment lists
and redirections, in any sequence. They are optionally followed by
commands, words, and redirections. They are terminated by ;, | , & , || , && , |& ,
or a newline character. The command name is passed as parameter 0 (as
defined by the exec subroutine). The value
of a simple command is its exit status of zero if it terminates normally
or nonzero if it terminates abnormally. The sigaction, sigvec, or signal subroutine includes
a list of signal-exit status values. |
subshell | A shell that is running as a child of the login shell or the current shell. |
wildcard character | Also known as a pattern-matching character.
The shell associates them with assigned values. The basic wildcards
are ? , * , [set] ,
and [!set] . Wildcard characters are particularly
useful when performing file name substitution. |
word | A sequence of characters that does not contain any blanks. Words are separated by one or more metacharacters. |