Special Characters

Some characters have special meaning to Linux shells; these characters represent commands, denote specific use for surrounding text, or provide search parameters. Special characters provide a sort of shorthand by incorporating these rather complex meanings into a simple character. Some special characters are shown in Table 15.2.

Table 15.2. Special Shell Characters

Character

Explanation

Indicates the beginning of a shell variable name Pipes standard output to next command Starts a comment

Executes a process in the background Matches one character Matches one or more characters Output redirection operator Input redirection operator

Command substitution (the backquote or backtickthe key above the Tab key on most keyboards)

Output redirection operator (to append to a file)

Wait until following end-of-input string (here operator)

] Range of characters

All characters a through z

Characters a or z

Delimiter between two words

Special characters are very useful to you when you're creating shell scripts, but if you inadvertently use a special character as part of variable names or strings, your program will behave incorrectly. As you learn in later parts of this section, you can use one of the special characters in a string if you precede it with an escape character (/, or backslash) to indicate that it isn't being used as a special character and shouldn't be treated as such by the program.

A few special characters deserve special note. They are the double quotes ("), the single quotes ('), the backslash (\), and the backtick ()all discussed in the following sections.

Was this article helpful?

0 0

Post a comment