4-22
Compaq AlphaServer ES40 Service Guide
4.9
grep
The grep command is very similar to the UNIX grep command. It
allows you to search for “regular expressions”—specific strings of
characters—and prints any lines containing occurrences of the strings.
Using grep is similar to using wildcards.
Example 4–7 grep
P00>>> show fru | grep PCI
SMB0.CPB0.PCI1 0 DE500-BA Network Cont
SMB0.CPB0.PCI4 0 DEC PowerStorm
SMB0.CPB0.PCI5 0 NCR 53C895
P00>>>
In Example 4–7 the output of the show fru command is piped into grep (the
vertical bar is the piping symbol), which filters out only lines with “PCI.”
Grep supports the following metacharacters:
^
Matches beginning of line
$
Matches end of line
.
Matches any single character
[ ]
Set of characters; [ABC] matches either ’A’ or ’B’ or ’C’; a dash (other than first or
last of the set) denotes a range of characters: [A-Z] matches any uppercase letter;
if the first character of the set is ’^’ then the sense of match is reversed: [^0-9]
matches any non-digit; several characters need to be quoted with backslash (\) if
they occur in a set: ’\’, ’]’, ’-’, and ’^’
*
Repeated matching; when placed after a pattern, indicates that the pattern
should match any number of times. For example, ’[a-z][0-9]*’ matches a lowercase
letter followed by zero or more digits.
+
Repeated matching; when placed after a pattern, indicates that the pattern
should match one or more times ’[0-9]+’ matches any non-empty sequence of
digits.
?
Optional matching; indicates that the pattern can match zero or one times. ’[a-
z][0-9]?’ matches lowercase letter alone or followed by a single digit.
\
Quote character; prevent the character that follows from having special meaning.
Summary of Contents for AlphaServer ES40
Page 4: ......
Page 16: ......
Page 20: ......
Page 68: ......
Page 104: ......
Page 162: ......
Page 170: ...5 8 Compaq AlphaServer ES40 Service Guide Figure 5 4 FRU List Designator ...
Page 172: ...5 10 Compaq AlphaServer ES40 Service Guide Figure 5 5 Evidence Designator ...
Page 184: ...5 22 Compaq AlphaServer ES40 Service Guide Figure 5 7 Display Error Frames Screen ...
Page 193: ...Error Logs 5 31 Figure 5 14 Deleting an Old Error Frame ...
Page 194: ......
Page 280: ......
Page 310: ...8 30 Compaq AlphaServer ES40 Service Guide Figure 8 14 Aligning DIMM in MMB PK0953a ...
Page 332: ......
Page 336: ......
Page 358: ......
Page 444: ......