os_cp:redirects_pipes
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| os_cp:redirects_pipes [2023/03/22 10:35] – [more, less] jkonczak | os_cp:redirects_pipes [2026/03/24 13:33] (current) – [more, less] jkonczak | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| Name comes from // | Name comes from // | ||
| '' | '' | ||
| - | as '' | + | as '' |
| '' | '' | ||
| Line 14: | Line 14: | ||
| < | < | ||
| + | '' | ||
| + | parses two sorted files and prints their lines joined on specified fields. | ||
| + | |||
| '' | '' | ||
| forcing a line break whenever a line would exceed //width// (that defaults to 80). | forcing a line break whenever a line would exceed //width// (that defaults to 80). | ||
| \\ | \\ | ||
| With the '' | With the '' | ||
| + | |||
| + | '' | ||
| + | \\ | ||
| + | '' | ||
| '' | '' | ||
| </ | </ | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| ~~Exercise.# | ~~Exercise.# | ||
| Line 37: | Line 46: | ||
| ==== Printing text ==== | ==== Printing text ==== | ||
| - | '' | + | '' |
| - | The '' | + | < |
| - | becomes a tab and '' | + | '' |
| + | but there is no consensus on how to interpret switches and how to treat | ||
| + | backslashes in the text. | ||
| + | \\ | ||
| + | In Bash, the | ||
| + | escapes into corresponding characters, e.g., '' | ||
| + | a newline (cf. manual). | ||
| + | </ | ||
| '' | '' | ||
| < | < | ||
| - | '' | + | Here and there, the course materials make use of the following toy commands: |
| + | \\ | ||
| + | '' | ||
| + | \\ | ||
| '' | '' | ||
| </ | </ | ||
| - | ~~Exercise.# | + | ++++ Examples | {{page> |
| + | |||
| + | ~~Exercise.# | ||
| ~~Exercise.# | ~~Exercise.# | ||
| Line 65: | Line 85: | ||
| \\ | \\ | ||
| With the '' | With the '' | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| ~~Exercise.# | ~~Exercise.# | ||
| Line 160: | Line 182: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| === Input redirections === | === Input redirections === | ||
| Line 188: | Line 212: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| < | < | ||
| Line 210: | Line 236: | ||
| | ''>>'' | | ''>>'' | ||
| | ''<>'' | | ''<>'' | ||
| - | | ''<<'' | + | | ''<<'' |
| | ''<< | | ''<< | ||
| | ''<<<'' | | ''<<<'' | ||
| - | | ''<&'' | + | | ''<&'' |
| - | | ''>&'' | + | | ''>&'' |
| | ''&>'' | | ''&>'' | ||
| | ''&>>'' | | ''&>>'' | ||
| Line 230: | Line 256: | ||
| standard output (unless you dare to face the consequences). | standard output (unless you dare to face the consequences). | ||
| - | ~~Exercise.# | + | ~~Exercise.# |
| '' | '' | ||
| '' | '' | ||
| Line 320: | Line 346: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| in one terminal, and redirect output of '' | in one terminal, and redirect output of '' | ||
| - | \\ Then repeat the commands, running the'' | + | \\ Then repeat the commands, running the '' |
| </ | </ | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| ===== Filters ===== | ===== Filters ===== | ||
| Line 350: | Line 378: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| terminal and append (with output redirection) some data to //file//. | terminal and append (with output redirection) some data to //file//. | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| ==== grep ==== | ==== grep ==== | ||
| Line 361: | Line 391: | ||
| < | < | ||
| The '' | The '' | ||
| - | POSIX [[https:// | + | POSIX [[https:// |
| basic (default for '' | basic (default for '' | ||
| '' | '' | ||
| Line 396: | Line 426: | ||
| \\ | \\ | ||
| List all files containing '' | List all files containing '' | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| ==== cut ==== | ==== cut ==== | ||
| Line 402: | Line 434: | ||
| bytes ('' | bytes ('' | ||
| \\ | \\ | ||
| - | A filed is any number of characters separated by a single-character | + | A field is any number of characters separated by a single-character |
| delimiter ('' | delimiter ('' | ||
| Line 417: | Line 449: | ||
| '' | '' | ||
| it. | it. | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| ==== sort ==== | ==== sort ==== | ||
| Line 461: | Line 495: | ||
| ~~Exercise.# | ~~Exercise.# | ||
| </ | </ | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| ==== wc, uniq, nl ==== | ==== wc, uniq, nl ==== | ||
| Line 493: | Line 529: | ||
| \\ | \\ | ||
| Then pipe it through '' | Then pipe it through '' | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| < | < | ||
| Line 527: | Line 565: | ||
| * to squeeze all spaces | * to squeeze all spaces | ||
| * remove all the letters '' | * remove all the letters '' | ||
| + | |||
| + | ++++ Examples | {{page> | ||
| < | < | ||
| Line 569: | Line 609: | ||
| not human-readable file format. | not human-readable file format. | ||
| \\ | \\ | ||
| - | '' | + | '' |
| of this feature. | of this feature. | ||
| </ | </ | ||
os_cp/redirects_pipes.1679481350.txt.gz · Last modified: (external edit)