29.06.2013 Views

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Related Information<br />

Examples<br />

[] Match any single character or range of characters enclosed in the brackets.<br />

Escape special characters which have meaning to grep, that is, the set of<br />

{$,.,|,[,],|,?,+,*,(,)}.<br />

v split - Split files into pieces<br />

v uniq - Report or filter out repeated lines in a file<br />

1. Find all occurrences of the word patricia in a file.<br />

grep patricia myfile<br />

2. Find all occurrences of the pattern “.Pp” at the beginning of a line. The single<br />

quotes assure the entire expression is evaluated by grep instead of by the<br />

shell. The carat (|) means from the beginning of a line.<br />

grep '|.Pp' myfile<br />

3. Find either 19, 20 or 25 in the file calendar.<br />

grep '19|20|25' calendar<br />

4. Find the total number of lines that matches a character in the range of “a” to “z”.<br />

grep -c '[a-z]' reference/alphabet.text<br />

5. Display all lines that have a dollar sign ($) character in them. You must escape<br />

the dollar sign character so grep will not interpret the character. Also, display<br />

the line number as well as the line that contains the match.<br />

grep -n '\$' valid.file<br />

[ Legal | AS/400 Glossary ]<br />

split - Split files into pieces<br />

Synopsis<br />

Description<br />

Options<br />

40 <strong>Qshell</strong> <strong>Interpreter</strong> (<strong>qsh</strong>)<br />

split [-b byte_count[k|m]] [-l line_count] [file [name]]<br />

The split utility reads the given file (or standard input if no file is specified) and<br />

breaks it up into files of 1000 lines each.<br />

-b Create smaller files byte_count bytes in length. If k is appended to the<br />

number, the file is split into byte_count kilobyte pieces. If m is appended to<br />

the number, the file is split into byte_count megabyte pieces.<br />

-l Create smaller files line_count lines in length.

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

Saved successfully!

Ooh no, something went wrong!