16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

Localization<br />

Exit Values<br />

Messages<br />

Limits<br />

To display every line mentioning an astrological element:<br />

egrep "earth|air|fire|water" astro.log<br />

grep uses the following localization environment variables:<br />

v LANG<br />

v LC_ALL<br />

v LC_COLLATE<br />

v LC_CTYPE<br />

v LC_MESSAGES<br />

v LC_SYNTAX<br />

v NLSPATH<br />

See Appendix F for more information.<br />

0 At least one match for pattern was found.<br />

1 No matches for pattern were found.<br />

2 Failure due to any of the following:<br />

v The –e option was missing pattern.<br />

v The –f option was missing patternfile.<br />

v Out of memory for input or to hold a pattern.<br />

v patternfile could not be opened.<br />

v Incorrect regular expression.<br />

v Incorrect command-line option.<br />

v The command line had too few arguments.<br />

v The input file could not be opened.<br />

If the program fails to open one input file, it tries to go on to look at any<br />

remaining input files, but it returns 2 even if it succeeds in finding matches<br />

in other input files.<br />

Possible error messages include:<br />

input lines truncated—result questionable<br />

One or more input lines were longer than grep could handle; the line has<br />

been truncated or split into two lines. Shorten the line or lines, if possible.<br />

This message does not affect the exit status.<br />

out of space for pattern string<br />

grep did not have enough memory available to store the code needed to<br />

work with the given pattern (regular expression). The usual cause is that the<br />

pattern is very complex. Make the pattern simpler, or try to release memory<br />

so that grep has more space to work with.<br />

The longest input record (line) is restricted by the system variable LINE_MAX. It is<br />

always at least 2048 bytes. fgrep may be able to handle lines longer than<br />

LINE_MAX. Longer lines are treated as two or more records.<br />

grep<br />

Chapter 2. Shell command descriptions 305

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!