|
- Character
- Usage
- |
- Pipes the output from one command to a second command; separates
commands in a pipeline.
- ||
- Separates two commands. If the command preceding || fails,
it runs the following command (Boolean OR operator).
- &
- Runs a command in the background, if placed at the end of a
command line.
Used in redirection, &0 represents standard input,
&1 represents standard output, and &2 represents standard
error.
- &&
- Separates two commands. If the command preceding &&
succeeds, it runs the following command (Boolean AND operator).
- ;
- Separates sequential commands; allows you to enter more than
one command on the same line.
- ( )
- Around a sequence of commands, groups those commands that are
to run as a separate process in a subshell environment. The commands
run in a separate execution environment: changes to variables, the
working directory, open files, and so on, will not remain in effect
after the last command finishes.
(␠) is also used to
group mathematical operations.
- { }
- Around a sequence of commands, groups those commands that are
run in the current shell environment. Changes to variables, etc.,
will affect the current shell.
Both { and } are reserved words
to the shell. To make it possible for the shell to recognize these
symbols, you must enter a blank or <newline> after the {, and a
semicolon or <newline> before the }.
- #
- Following a command in a shell script, indicates the beginning
of a comment.
- $
- At the beginning of a string, indicates that it is a variable
name.
- \
- The backslash character turns off the special meaning of the
character that follows it. For more information, see Using a special character without its special meaning.
- ' '
- A pair of single quotation marks turns off the special meaning
of all characters within the quotes. For more information, see Using a special character without its special meaning.
- " "
- A pair of double quotation marks turns off the special meaning
of the characters within the quotes, except for $, `, ", and \. See Using a special character without its special meaning for more information.
|