Special Characters


Table 9-6 lists most of the characters that are special to the bash shell.

Table 9-6. Shell special characters

Character

Use

NEWLINE

Initiates execution of a command (page 276)

;

Separates commands (page 276)

( )

Groups commands (page 279) for execution by a subshell or identifies a function (page 321)

&

Executes a command in the background (pages 219 and 278)

|

Sends standard output of preceding command to standard input of following command (pipe; page 278)

>

Redirects standard output (page 210)

>>

Appends standard output (page 214)

<

Redirects standard input (page 212)

<<

Here document (page 909)

*

Any string of zero or more characters in an ambiguous file reference (page 222)

?

Any single character in an ambiguous file reference (page 221)

\

Quotes the following character (page 126)

'

Quotes a string, preventing all substitution (page 126)

"

Quotes a string, allowing only variable and command substitution (pages 126 and 287)

'...'

Performs command substitution (page 334)

[ ]

Character class in an ambiguous file reference (page 223)

$

References a variable (page 285)

. (dot builtin)

Executes a command (only at the beginning of a line, page 269)

#

Begins a comment (page 275)

{ }

Used to surround the contents of a function (page 321)

: (null builtin)

Returns true (page 935)

&& (Boolean AND)

Executes command on right only if command on left succeeds (returns a zero exit status, page 946)

|| (Boolean OR)

Executes command on right only if command on left fails (returns a nonzero exit status; page 946)

! (Boolean NOT)

Reverses exit status of a command

$()

Performs command substitution (preferred form; page 334)

[]

Evaluates an arithmetic expression (page 332)





A Practical Guide to Red Hat Linux
A Practical Guide to Red HatВ® LinuxВ®: Fedoraв„ў Core and Red Hat Enterprise Linux (3rd Edition)
ISBN: 0132280272
EAN: 2147483647
Year: 2006
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net