7.4. Shell Metacharacters (Wildcards)

 <  Day Day Up  >  

Like grep , sed , and awk , the shell has metacharacters. At first glance, they may look the same, but they don't always represent the same characters when the shell evaluates them. Metacharacters, as we discussed in "Metacharacters" on page 83 of Chapter 4, are special char acters used to represent something other than themselves . Shell metacharacters are often called wildcards . Table 7.1 lists the Bourne shell metacharacters and what they do.

Table 7.1. Bourne Shell Metacharacters

Metacharacter

Meaning

\

Literally interprets the following character

&

Processes in the background

;

Separates commands

$

Substitutes variables

?

Matches for a single character

[abc]

Matches for one character from a set of characters

[!abc]

Matches for one character not from the set of characters

*

Matches for zero or more characters

(cmds)

Executes commands in a subshell

{cmds}

Executes commands in current shell


 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

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