DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ i

⟦00b8d4631⟧

    Length: 7540 (0x1d74)
    Names: »io«

Derivation

└─⟦87ddcff64⟧ Bits:30001253 CPHDIST85 Tape, 1985 Autumn Conference Copenhagen
    └─ ⟦this⟧ »cph85dist/stat/doc/cat/io« 

Hex Dump

0x0000…0020 0a 49 4f 28 31 29 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 4e 49 58 20 55 73 65   ┆ IO(1)                  UNIX Use┆
0x0020…0040 72 27 73 20 4d 61 6e 75 61 6c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 4f 28   ┆r's Manual                   IO(┆
0x0040…0060 31 29 0a 0a 4e 41 4d 45 0a 20 20 20 20 20 69 6f 20 2d 20 63 6f 6e 74 72 6f 6c 20 61 6e 64 20 6d   ┆1)  NAME      io - control and m┆
0x0060…0080 6f 6e 69 74 6f 72 20 69 6e 70 75 74 2f 6f 75 74 70 75 74 20 28 69 6f 29 20 66 6c 6f 77 20 69 6e   ┆onitor input/output (io) flow in┆
0x0080…00a0 74 65 6c 6c 69 2d 0a 20 20 20 20 20 67 65 6e 74 6c 79 0a 0a 53 59 4e 4f 50 53 49 53 0a 20 20 20   ┆telli-      gently  SYNOPSIS    ┆
0x00a0…00c0 20 20 69 6f 20 5b 2d 6d 66 61 5d 20 5b 66 69 6c 65 20 2e 2e 2e 5d 0a 0a 4f 50 54 49 4f 4e 53 0a   ┆  io [-mfa] [file ...]  OPTIONS ┆
0x00c0…00e0 20 20 20 20 20 2d 6d 20 20 20 72 65 71 75 65 73 74 20 6d 6f 6e 69 74 6f 72 69 6e 67 20 6f 66 20   ┆     -m   request monitoring of ┆
0x00e0…0100 66 6c 6f 77 0a 0a 20 20 20 20 20 2d 66 20 20 20 66 6f 72 63 65 20 6f 76 65 72 77 72 69 74 65 73   ┆flow       -f   force overwrites┆
0x0100…0120 20 6f 66 20 66 69 6c 65 73 20 77 69 74 68 6f 75 74 20 75 73 65 72 20 69 6e 74 65 72 61 63 74 69   ┆ of files without user interacti┆
0x0120…0140 6f 6e 0a 20 20 20 20 20 20 20 20 20 20 28 75 73 65 66 75 6c 20 69 6e 20 73 68 65 6c 6c 20 73 63   ┆on           (useful in shell sc┆
0x0140…0160 72 69 70 74 73 29 0a 0a 20 20 20 20 20 2d 61 20 20 20 61 70 70 65 6e 64 73 20 74 65 78 74 20 74   ┆ripts)       -a   appends text t┆
0x0160…0180 68 65 20 6e 61 6d 65 64 20 66 69 6c 65 20 72 61 74 68 65 72 20 74 68 61 6e 20 6f 76 65 72 77 72   ┆he named file rather than overwr┆
0x0180…01a0 69 74 69 6e 67 20 69 74 0a 20 20 20 20 20 20 20 20 20 20 28 6f 6e 6c 79 20 75 73 65 66 75 6c 20   ┆iting it           (only useful ┆
0x01a0…01c0 77 68 65 6e 20 6f 75 74 70 75 74 20 69 73 20 62 65 69 6e 67 20 64 69 72 65 63 74 65 64 20 74 6f   ┆when output is being directed to┆
0x01c0…01e0 20 61 20 66 69 6c 65 29 0a 0a 44 45 53 43 52 49 50 54 49 4f 4e 0a 20 20 20 20 20 5f 08 49 5f 08   ┆ a file)  DESCRIPTION      _ I_ ┆
0x01e0…0200 6f 20 69 73 20 61 20 70 72 6f 67 72 61 6d 20 74 68 61 74 20 69 6e 69 74 69 61 74 65 73 2c 20 63   ┆o is a program that initiates, c┆
0x0200…0220 6f 6e 74 69 6e 75 65 73 2c 20 61 6e 64 20 74 65 72 6d 69 6e 61 74 65 73 0a 20 20 20 20 20 69 6e   ┆ontinues, and terminates      in┆
0x0220…0240 70 75 74 20 61 6e 64 20 6f 75 74 70 75 74 2e 20 20 49 74 20 6d 61 6b 65 73 20 69 6e 74 65 6c 6c   ┆put and output.  It makes intell┆
0x0240…0260 69 67 65 6e 74 20 64 65 63 69 73 69 6f 6e 73 20 61 62 6f 75 74 20 77 68 61 74 0a 20 20 20 20 20   ┆igent decisions about what      ┆
0x0260…0280 69 74 20 73 68 6f 75 6c 64 20 64 6f 20 62 61 73 65 64 20 6f 6e 20 77 68 65 72 65 20 69 74 20 69   ┆it should do based on where it i┆
0x0280…02a0 73 20 63 61 6c 6c 65 64 20 69 6e 20 61 20 70 69 70 65 6c 69 6e 65 0a 20 20 20 20 20 28 62 65 67   ┆s called in a pipeline      (beg┆
0x02a0…02c0 69 6e 6e 69 6e 67 2c 20 6d 69 64 64 6c 65 2c 20 6f 72 20 65 6e 64 29 2c 20 77 68 65 74 68 65 72   ┆inning, middle, or end), whether┆
0x02c0…02e0 20 69 74 20 69 73 20 67 69 76 65 6e 20 66 69 6c 65 20 61 72 67 75 2d 0a 20 20 20 20 20 6d 65 6e   ┆ it is given file argu-      men┆
0x02e0…0300 74 73 2c 20 61 6e 64 20 77 68 65 74 68 65 72 20 66 6c 6f 77 20 6d 6f 6e 69 74 6f 72 69 6e 67 20   ┆ts, and whether flow monitoring ┆
0x0300…0320 69 73 20 72 65 71 75 65 73 74 65 64 2e 0a 0a 20 20 20 20 20 5f 08 49 5f 08 6f 20 63 61 6e 20 72   ┆is requested.       _ I_ o can r┆
0x0320…0340 65 70 6c 61 63 65 20 73 68 65 6c 6c 20 66 69 6c 65 20 72 65 64 69 72 65 63 74 69 6f 6e 20 75 73   ┆eplace shell file redirection us┆
0x0340…0360 65 64 20 69 6e 20 73 68 65 6c 6c 73 20 28 77 69 74 68 0a 20 20 20 20 20 3c 2c 20 3e 20 61 6e 64   ┆ed in shells (with      <, > and┆
0x0360…0380 20 3e 3e 29 2c 20 74 68 65 20 73 69 6d 70 6c 65 73 74 20 75 73 65 73 20 6f 66 20 5f 08 63 5f 08   ┆ >>), the simplest uses of _ c_ ┆
0x0380…03a0 61 5f 08 74 2c 20 74 68 65 20 70 69 70 65 66 69 74 74 69 6e 67 20 70 72 6f 2d 0a 20 20 20 20 20   ┆a_ t, the pipefitting pro-      ┆
0x03a0…03c0 67 72 61 6d 20 5f 08 74 5f 08 65 5f 08 65 2c 20 61 6c 6c 20 77 69 74 68 20 74 68 65 20 61 62 69   ┆gram _ t_ e_ e, all with the abi┆
0x03c0…03e0 6c 69 74 79 20 74 6f 20 6d 6f 6e 69 74 6f 72 20 74 68 65 20 70 72 6f 67 72 65 73 73 20 6f 66 0a   ┆lity to monitor the progress of ┆
0x03e0…0400 20 20 20 20 20 74 68 65 20 70 72 6f 63 65 73 73 65 73 20 69 6e 20 61 20 70 69 70 65 6c 69 6e 65   ┆     the processes in a pipeline┆
0x0400…0420 2e 0a 0a 45 58 41 4d 50 4c 45 53 0a 20 20 20 20 20 53 6f 6d 65 20 75 73 65 73 20 6f 66 20 5f 08   ┆.  EXAMPLES      Some uses of _ ┆
0x0420…0440 69 5f 08 6f 20 61 72 65 20 62 65 73 74 20 73 68 6f 77 6e 20 62 79 20 65 78 61 6d 70 6c 65 3a 0a   ┆i_ o are best shown by example: ┆
0x0440…0460 0a 20 20 20 20 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 66 6f 72 6d 20 73 69 6d 70 6c 79 20   ┆      The following form simply ┆
0x0460…0480 70 72 69 6e 74 73 20 74 68 65 20 6e 61 6d 65 64 20 66 69 6c 65 73 20 74 6f 20 74 68 65 0a 20 20   ┆prints the named files to the   ┆
0x0480…04a0 20 20 20 73 74 61 6e 64 61 72 64 20 6f 75 74 70 75 74 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20   ┆   standard output:             ┆
0x04a0…04c0 20 20 20 20 20 20 20 20 20 20 20 69 6f 20 66 69 6c 65 31 20 66 69 6c 65 32 20 66 69 6c 65 33 20   ┆           io file1 file2 file3 ┆
0x04c0…04e0 2e 2e 2e 0a 0a 20 20 20 20 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 66 6f 72 6d 20 72 65 64   ┆...       The following form red┆
0x04e0…0500 69 72 65 63 74 73 20 74 68 65 20 6f 75 74 70 75 74 20 66 72 6f 6d 20 74 68 65 20 70 69 70 65 20   ┆irects the output from the pipe ┆
0x0500…0520 74 6f 20 74 68 65 0a 20 20 20 20 20 6e 61 6d 65 64 20 66 69 6c 65 2e 0a 20 20 20 20 20 20 20 20   ┆to the      named file.         ┆
0x0520…0540 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 67 72 61 6d 31 20 7c 20 70 72 6f 67 72 61 6d 32 20   ┆            program1 | program2 ┆
0x0540…0560 7c 20 69 6f 20 66 69 6c 65 0a 20 20 20 20 20 49 66 20 74 68 65 20 6f 75 74 70 75 74 20 66 69 6c   ┆| io file      If the output fil┆
0x0560…0580 65 20 66 72 6f 6d 20 5f 08 69 5f 08 6f 20 65 78 69 73 74 73 2c 20 5f 08 69 5f 08 6f 20 6d 61 6b   ┆e from _ i_ o exists, _ i_ o mak┆
0x0580…05a0 65 73 20 61 20 74 65 6d 70 6f 72 61 72 79 20 66 69 6c 65 0a 20 20 20 20 20 62 65 66 6f 72 65 20   ┆es a temporary file      before ┆
0x05a0…05c0 63 68 61 6e 67 69 6e 67 20 69 74 20 74 6f 20 61 76 6f 69 64 20 74 68 65 20 70 6f 73 73 69 62 69   ┆changing it to avoid the possibi┆
0x05c0…05e0 6c 69 74 79 20 6f 66 20 70 65 72 73 6f 6e 73 0a 20 20 20 20 20 6f 76 65 72 2d 77 72 69 74 69 6e   ┆lity of persons      over-writin┆
0x05e0…0600 67 20 74 68 65 69 72 20 69 6e 70 75 74 20 66 69 6c 65 73 2e 20 20 54 68 75 73 2c 20 69 74 20 69   ┆g their input files.  Thus, it i┆
0x0600…0620 73 20 70 6f 73 73 69 62 6c 65 20 74 6f 0a 20 20 20 20 20 73 6f 72 74 20 61 20 66 69 6c 65 20 6f   ┆s possible to      sort a file o┆
0x0620…0640 6e 74 6f 20 69 74 73 65 6c 66 20 77 69 74 68 20 5f 08 69 5f 08 6f 3a 0a 20 20 20 20 20 20 20 20   ┆nto itself with _ i_ o:         ┆
0x0640…0660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 6f 72 74 20 66 6f 6f 20 7c 20 69 6f 20   ┆                  sort foo | io ┆
0x0660…0680 66 6f 6f 0a 20 20 20 20 20 69 73 20 62 6f 74 68 20 6c 65 67 61 6c 20 61 6e 64 20 73 61 66 65 2e   ┆foo      is both legal and safe.┆
0x0680…06a0 20 20 5f 08 49 5f 08 6f 20 77 69 6c 6c 20 61 73 6b 20 79 6f 75 20 69 66 20 79 6f 75 20 77 61 6e   ┆  _ I_ o will ask you if you wan┆
0x06a0…06c0 74 20 74 6f 0a 20 20 20 20 20 73 61 66 65 6c 79 20 6f 76 65 72 77 72 69 74 65 20 61 6e 79 20 66   ┆t to      safely overwrite any f┆
0x06c0…06e0 69 6c 65 73 20 74 68 61 74 20 61 6c 72 65 61 64 79 20 65 78 69 73 74 2c 20 66 6f 72 20 77 68 69   ┆iles that already exist, for whi┆
0x06e0…0700 63 68 20 79 6f 75 0a 20 20 20 20 20 73 68 6f 75 6c 64 20 72 65 73 70 6f 6e 64 20 77 69 74 68 20   ┆ch you      should respond with ┆
0x0700…0720 61 20 27 79 27 20 6f 72 20 61 20 27 6e 27 2e 20 20 54 6f 20 61 76 6f 69 64 20 68 61 76 69 6e 67   ┆a 'y' or a 'n'.  To avoid having┆
0x0720…0740 20 74 6f 0a 20 20 20 20 20 69 6e 74 65 72 61 63 74 20 77 69 74 68 20 5f 08 69 5f 08 6f 2c 20 73   ┆ to      interact with _ i_ o, s┆
0x0740…0760 65 65 20 74 68 65 20 2d 66 20 66 6c 61 67 20 77 68 69 63 68 20 66 6f 72 63 65 73 20 74 68 65 20   ┆ee the -f flag which forces the ┆
0x0760…0780 73 61 66 65 0a 20 20 20 20 20 6f 76 65 72 77 72 69 74 65 2e 0a 0a 20 20 20 20 20 54 68 65 20 66   ┆safe      overwrite.       The f┆
0x0780…07a0 6f 6c 6c 6f 77 69 6e 67 20 66 6f 72 6d 20 73 69 6d 70 6c 79 20 63 6f 6e 74 69 6e 75 65 73 20 74   ┆ollowing form simply continues t┆
0x07a0…07c0 68 65 20 66 6c 6f 77 20 66 72 6f 6d 20 73 74 61 6e 64 61 72 64 0a 20 20 20 20 20 69 6e 70 75 74   ┆he flow from standard      input┆
0x07c0…07e0 20 74 6f 20 73 74 61 6e 64 61 72 64 20 6f 75 74 70 75 74 3a 0a 20 20 20 20 20 20 20 20 20 20 20   ┆ to standard output:            ┆
0x07e0…0800 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 67 72 61 6d 31 20 7c 20 69 6f 20 7c 20 70 72 6f 67   ┆            program1 | io | prog┆
0x0800…0820 72 61 6d 32 0a 0a 50 72 69 6e 74 65 64 20 35 2f 33 30 2f 38 35 20 20 20 20 20 20 20 20 20 20 20   ┆ram2  Printed 5/30/85           ┆
0x0820…0840 4d 61 72 63 68 20 35 2c 20 31 39 38 35 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20   ┆March 5, 1985                   ┆
0x0840…0860 20 20 20 20 20 20 31 0a 0a 49 4f 28 31 29 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20   ┆      1  IO(1)                  ┆
0x0860…0880 55 4e 49 58 20 55 73 65 72 27 73 20 4d 61 6e 75 61 6c 20 20 20 20 20 20 20 20 20 20 20 20 20 20   ┆UNIX User's Manual              ┆
0x0880…08a0 20 20 20 20 20 49 4f 28 31 29 0a 0a 20 20 20 20 20 57 68 65 6e 20 5f 08 69 5f 08 6f 20 69 73 20   ┆     IO(1)       When _ i_ o is ┆
0x08a0…08c0 75 73 65 64 20 69 6e 20 74 68 65 20 6d 69 64 64 6c 65 20 6f 66 20 61 20 70 69 70 65 6c 69 6e 65   ┆used in the middle of a pipeline┆
0x08c0…08e0 2c 20 69 74 20 61 75 74 6f 6d 61 74 69 2d 0a 20 20 20 20 20 63 61 6c 6c 79 20 6d 6f 6e 69 74 6f   ┆, it automati-      cally monito┆
0x08e0…0900 72 73 20 74 68 65 20 66 6c 6f 77 20 6f 66 20 63 68 61 72 61 63 74 65 72 73 20 74 68 72 6f 75 67   ┆rs the flow of characters throug┆
0x0900…0920 68 20 69 74 20 62 79 20 70 72 69 6e 74 69 6e 67 0a 20 20 20 20 20 61 20 63 68 61 72 61 63 74 65   ┆h it by printing      a characte┆
0x0920…0940 72 20 61 62 6f 75 74 20 65 76 65 72 79 20 31 30 30 30 20 62 79 74 65 73 2e 20 20 54 68 69 73 20   ┆r about every 1000 bytes.  This ┆
0x0940…0960 63 68 61 72 61 63 74 65 72 20 63 68 61 6e 67 65 73 0a 20 20 20 20 20 66 72 6f 6d 20 69 6e 73 74   ┆character changes      from inst┆
0x0960…0980 61 6e 63 65 20 74 6f 20 69 6e 73 74 61 6e 63 65 20 6f 66 20 5f 08 69 5f 08 6f 20 73 6f 20 74 68   ┆ance to instance of _ i_ o so th┆
0x0980…09a0 61 74 20 73 65 76 65 72 61 6c 20 66 6c 6f 77 20 6d 65 74 65 72 73 0a 20 20 20 20 20 63 61 6e 20   ┆at several flow meters      can ┆
0x09a0…09c0 73 75 70 70 6c 79 20 64 69 73 63 72 69 6d 69 6e 61 62 6c 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e   ┆supply discriminable information┆
0x09c0…09e0 2e 20 20 54 68 65 20 63 68 61 72 61 63 74 65 72 20 73 65 6c 65 63 2d 0a 20 20 20 20 20 74 69 6f   ┆.  The character selec-      tio┆
0x09e0…0a00 6e 20 69 73 20 62 79 20 70 72 6f 63 65 73 73 20 69 64 65 6e 74 69 66 69 63 61 74 69 6f 6e 20 6e   ┆n is by process identification n┆
0x0a00…0a20 75 6d 62 65 72 2c 20 73 6f 20 74 68 61 74 20 73 75 63 63 65 73 73 69 76 65 0a 20 20 20 20 20 70   ┆umber, so that successive      p┆
0x0a20…0a40 72 6f 67 72 61 6d 73 20 77 6f 75 6c 64 20 68 61 76 65 20 64 69 66 66 65 72 65 6e 74 20 66 6c 6f   ┆rograms would have different flo┆
0x0a40…0a60 77 20 63 68 61 72 61 63 74 65 72 73 2e 20 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 0a 20 20 20 20   ┆w characters.  For example,     ┆
0x0a60…0a80 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 73 68 65 6c 6c 20 63 6f 6d 6d 61 6e 64 20 77 6f 75   ┆ the following shell command wou┆
0x0a80…0aa0 6c 64 20 73 65 74 20 75 70 20 74 68 72 65 65 20 6d 65 74 65 72 73 20 65 61 63 68 0a 20 20 20 20   ┆ld set up three meters each     ┆
0x0aa0…0ac0 20 77 69 74 68 20 64 69 66 66 65 72 65 6e 74 20 66 6c 6f 77 20 63 68 61 72 61 63 74 65 72 73 3a   ┆ with different flow characters:┆
0x0ac0…0ae0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6f 20 66 6f 6f 20 7c 20 69   ┆                      io foo | i┆
0x0ae0…0b00 6f 20 7c 20 69 6f 20 7c 20 69 6f 20 2d 6d 20 62 61 72 0a 0a 20 20 20 20 20 54 68 65 20 61 75 74   ┆o | io | io -m bar       The aut┆
0x0b00…0b20 6f 6d 61 74 69 63 20 6d 6f 6e 69 74 6f 72 69 6e 67 20 6f 66 20 66 6c 6f 77 20 69 73 20 6e 6f 74   ┆omatic monitoring of flow is not┆
0x0b20…0b40 20 75 73 65 64 20 69 66 20 5f 08 69 5f 08 6f 20 69 73 20 75 73 65 64 0a 20 20 20 20 20 69 6e 20   ┆ used if _ i_ o is used      in ┆
0x0b40…0b60 74 68 65 20 6d 69 64 64 6c 65 20 6f 66 20 61 20 70 69 70 65 6c 69 6e 65 20 61 6e 64 20 69 73 20   ┆the middle of a pipeline and is ┆
0x0b60…0b80 63 61 6c 6c 65 64 20 77 69 74 68 20 61 6e 20 61 72 67 75 6d 65 6e 74 0a 20 20 20 20 20 66 69 6c   ┆called with an argument      fil┆
0x0b80…0ba0 65 20 6e 61 6d 65 2e 20 20 46 6f 72 20 65 78 61 6d 70 6c 65 3a 0a 20 20 20 20 20 20 20 20 20 20   ┆e name.  For example:           ┆
0x0ba0…0bc0 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 67 72 61 6d 20 7c 20 69 6f 20 66 75 62 61 72 20 7c 20   ┆           program | io fubar | ┆
0x0bc0…0be0 70 72 6f 67 72 61 6d 0a 20 20 20 20 20 49 6e 20 74 68 69 73 20 63 61 73 65 2c 20 74 68 65 20 69   ┆program      In this case, the i┆
0x0be0…0c00 6e 70 75 74 20 74 6f 20 5f 08 69 5f 08 6f 20 69 73 20 63 6f 70 69 65 64 20 69 6e 74 6f 20 74 68   ┆nput to _ i_ o is copied into th┆
0x0c00…0c20 65 20 66 69 6c 65 20 66 75 62 61 72 2c 0a 20 20 20 20 20 61 6e 64 20 61 6e 6f 74 68 65 72 20 63   ┆e file fubar,      and another c┆
0x0c20…0c40 6f 70 79 20 69 73 20 63 6f 6e 74 69 6e 75 65 64 20 61 6c 6f 6e 67 20 74 68 65 20 70 69 70 65 6c   ┆opy is continued along the pipel┆
0x0c40…0c60 69 6e 65 2e 20 20 54 68 69 73 20 69 73 0a 20 20 20 20 20 73 69 6d 69 6c 61 72 20 74 6f 20 74 68   ┆ine.  This is      similar to th┆
0x0c60…0c80 65 20 73 74 61 6e 64 61 72 64 20 55 4e 49 58 20 5f 08 74 5f 08 65 5f 08 65 20 70 72 6f 67 72 61   ┆e standard UNIX _ t_ e_ e progra┆
0x0c80…0ca0 6d 2e 20 20 54 68 65 20 6d 6f 6e 69 74 6f 72 69 6e 67 0a 20 20 20 20 20 63 6f 75 6c 64 20 62 65   ┆m.  The monitoring      could be┆
0x0ca0…0cc0 20 74 75 72 6e 65 64 20 6f 6e 20 69 66 20 74 68 65 20 2d 6d 20 66 6c 61 67 20 77 65 72 65 20 75   ┆ turned on if the -m flag were u┆
0x0cc0…0ce0 73 65 64 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 67 72 61 6d 20   ┆sed:                    program ┆
0x0ce0…0d00 7c 20 69 6f 20 2d 6d 20 66 75 62 61 72 20 7c 20 70 72 6f 67 72 61 6d 0a 0a 20 20 20 20 20 5f 08   ┆| io -m fubar | program       _ ┆
0x0d00…0d20 49 5f 08 6f 20 63 61 6e 20 72 65 70 6c 61 63 65 20 74 68 65 20 72 65 64 69 72 65 63 74 69 6f 6e   ┆I_ o can replace the redirection┆
0x0d20…0d40 20 73 79 6d 62 6f 6c 73 20 27 3c 27 20 28 75 73 65 64 20 74 6f 20 72 65 64 69 72 65 63 74 0a 20   ┆ symbols '<' (used to redirect  ┆
0x0d40…0d60 20 20 20 20 74 68 65 20 73 74 61 6e 64 61 72 64 20 69 6e 70 75 74 29 2c 20 61 6e 64 20 27 3e 27   ┆    the standard input), and '>'┆
0x0d60…0d80 20 28 75 73 65 64 20 74 6f 20 72 65 64 69 72 65 63 74 20 74 68 65 20 73 74 61 6e 64 61 72 64 0a   ┆ (used to redirect the standard ┆
0x0d80…0da0 20 20 20 20 20 6f 75 74 70 75 74 29 2c 20 75 73 65 64 20 69 6e 20 74 68 65 20 73 74 61 6e 64 61   ┆     output), used in the standa┆
0x0da0…0dc0 72 64 20 55 4e 49 58 20 63 6f 6d 6d 61 6e 64 20 73 68 65 6c 6c 73 2c 20 5f 08 73 5f 08 68 20 61   ┆rd UNIX command shells, _ s_ h a┆
0x0dc0…0de0 6e 64 0a 20 20 20 20 20 5f 08 63 5f 08 73 5f 08 68 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20   ┆nd      _ c_ s_ h.              ┆
0x0de0…0e00 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6f 20 66 69 6c 65 20 7c 20 70 72 6f 67 72 61 6d 0a 20   ┆             io file | program  ┆
0x0e00…0e20 20 20 20 20 68 61 73 20 74 68 65 20 73 61 6d 65 20 65 66 66 65 63 74 20 61 73 3a 0a 20 20 20 20   ┆    has the same effect as:     ┆
0x0e20…0e40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 67 72 61 6d 20   ┆                        program ┆
0x0e40…0e60 3c 20 66 69 6c 65 0a 20 20 20 20 20 62 75 74 20 69 73 20 61 20 62 69 74 20 73 6c 6f 77 65 72 2e   ┆< file      but is a bit slower.┆
0x0e60…0e80 20 20 41 6e 64 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20   ┆  And,                          ┆
0x0e80…0ea0 20 70 72 6f 67 72 61 6d 20 7c 20 69 6f 20 66 69 6c 65 0a 20 20 20 20 20 69 73 20 74 68 65 20 73   ┆ program | io file      is the s┆
0x0ea0…0ec0 61 6d 65 20 61 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20   ┆ame as                          ┆
0x0ec0…0ee0 20 20 20 70 72 6f 67 72 61 6d 20 3e 20 66 69 6c 65 0a 20 20 20 20 20 65 78 63 65 70 74 20 74 68   ┆   program > file      except th┆
0x0ee0…0f00 61 74 20 69 74 20 69 73 20 73 61 66 65 72 2e 20 20 5f 08 49 5f 08 6f 20 63 61 6e 20 62 65 20 75   ┆at it is safer.  _ I_ o can be u┆
0x0f00…0f20 73 65 64 20 74 6f 20 61 70 70 65 6e 64 20 74 65 78 74 20 74 6f 20 61 0a 20 20 20 20 20 66 69 6c   ┆sed to append text to a      fil┆
0x0f20…0f40 65 20 28 65 6d 75 6c 61 74 69 6e 67 20 74 68 65 20 73 68 65 6c 6c 20 3e 3e 20 72 65 64 69 72 65   ┆e (emulating the shell >> redire┆
0x0f40…0f60 63 74 69 6f 6e 29 20 62 79 20 75 73 69 6e 67 20 74 68 65 20 2d 61 0a 20 20 20 20 20 66 6c 61 67   ┆ction) by using the -a      flag┆
0x0f60…0f80 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 67 72   ┆:                          progr┆
0x0f80…0fa0 61 6d 20 7c 20 69 6f 20 2d 61 20 66 69 6c 65 0a 20 20 20 20 20 69 73 20 74 68 65 20 65 78 61 63   ┆am | io -a file      is the exac┆
0x0fa0…0fc0 74 20 73 61 6d 65 20 61 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20   ┆t same as                       ┆
0x0fc0…0fe0 20 20 20 20 20 70 72 6f 67 72 61 6d 20 3e 3e 20 66 69 6c 65 0a 0a 20 20 20 20 20 49 66 20 5f 08   ┆     program >> file       If _ ┆
0x0fe0…1000 69 5f 08 6f 20 69 73 20 63 61 6c 6c 65 64 20 77 69 74 68 20 74 68 65 20 2d 6d 20 6f 70 74 69 6f   ┆i_ o is called with the -m optio┆
0x1000…1020 6e 2c 20 69 74 20 77 69 6c 6c 20 6d 6f 6e 69 74 6f 72 20 74 68 65 20 66 6c 6f 77 0a 20 20 20 20   ┆n, it will monitor the flow     ┆
0x1020…1040 20 6f 66 20 62 79 74 65 73 20 74 68 72 6f 75 67 68 20 69 74 2e 20 20 46 6f 72 20 65 78 61 6d 70   ┆ of bytes through it.  For examp┆
0x1040…1060 6c 65 2c 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 6d 6d 61 6e 64 0a 20 20 20 20 20 73   ┆le, the following command      s┆
0x1060…1080 65 74 73 20 75 70 20 61 20 62 75 6e 63 68 20 6f 66 20 66 6c 6f 77 20 6d 65 74 65 72 73 2e 0a 20   ┆ets up a bunch of flow meters.  ┆
0x1080…10a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6f 20 2d 6d 20 66 69 6c 65 20 7c   ┆                    io -m file |┆
0x10a0…10c0 20 69 6f 20 7c 20 69 6f 20 2d 6d 20 66 69 6c 65 0a 20 20 20 20 20 57 68 65 6e 20 74 68 65 20 66   ┆ io | io -m file      When the f┆
0x10c0…10e0 6c 6f 77 20 6d 65 74 65 72 20 69 73 20 61 74 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 6f 66   ┆low meter is at the beginning of┆
0x10e0…1100 20 61 20 70 69 70 65 6c 69 6e 65 2c 20 69 74 73 0a 20 20 20 20 20 6d 65 74 65 72 20 70 72 69 6e   ┆ a pipeline, its      meter prin┆
0x1100…1120 74 73 20 74 68 65 20 70 65 72 63 65 6e 74 20 6f 66 20 69 74 73 20 69 6e 70 75 74 20 73 6f 20 66   ┆ts the percent of its input so f┆
0x1120…1140 61 72 20 72 65 61 64 2e 20 20 49 74 73 0a 20 20 20 20 20 73 70 65 65 64 20 64 65 70 65 6e 64 73   ┆ar read.  Its      speed depends┆
0x1140…1160 20 6f 6e 20 68 6f 77 20 66 61 73 74 20 70 72 6f 67 72 61 6d 73 20 64 6f 77 6e 20 74 68 65 20 70   ┆ on how fast programs down the p┆
0x1160…1180 69 70 65 6c 69 6e 65 20 61 72 65 0a 20 20 20 20 20 72 65 61 64 69 6e 67 20 74 68 65 20 6f 75 74   ┆ipeline are      reading the out┆
0x1180…11a0 70 75 74 20 66 72 6f 6d 20 77 68 61 74 65 76 65 72 20 76 65 72 73 69 6f 6e 20 6f 66 20 5f 08 69   ┆put from whatever version of _ i┆
0x11a0…11c0 5f 08 6f 20 69 73 20 75 73 65 64 2e 0a 20 20 20 20 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 20   ┆_ o is used.      Note that the ┆
0x11c0…11e0 2d 6d 20 66 6c 61 67 20 69 73 20 6e 6f 74 20 6e 65 65 64 65 64 20 69 6e 20 74 68 65 20 6d 69 64   ┆-m flag is not needed in the mid┆
0x11e0…1200 64 6c 65 20 6f 66 20 74 68 65 0a 20 20 20 20 20 70 69 70 65 6c 69 6e 65 20 61 73 20 69 74 73 20   ┆dle of the      pipeline as its ┆
0x1200…1220 6f 6e 6c 79 20 75 73 65 20 69 6e 20 74 68 61 74 20 63 6f 6e 74 65 78 74 20 63 6f 75 6c 64 20 62   ┆only use in that context could b┆
0x1220…1240 65 20 61 73 20 61 20 66 6c 6f 77 0a 20 20 20 20 20 6d 65 74 65 72 2e 0a 0a 50 72 69 6e 74 65 64   ┆e as a flow      meter.  Printed┆
0x1240…1260 20 35 2f 33 30 2f 38 35 20 20 20 20 20 20 20 20 20 20 20 4d 61 72 63 68 20 35 2c 20 31 39 38 35   ┆ 5/30/85           March 5, 1985┆
0x1260…1280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 32 0a 0a 49 4f 28 31   ┆                         2  IO(1┆
0x1280…12a0 29 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 4e 49 58 20 55 73 65 72 27 73 20 4d   ┆)                  UNIX User's M┆
0x12a0…12c0 61 6e 75 61 6c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 4f 28 31 29 0a 0a 43   ┆anual                   IO(1)  C┆
0x12c0…12e0 4f 4d 4d 45 4e 54 53 0a 20 20 20 20 20 54 68 65 20 63 6f 6e 63 65 70 74 75 61 6c 20 6d 6f 64 65   ┆OMMENTS      The conceptual mode┆
0x12e0…1300 6c 20 6f 66 20 55 4e 49 58 20 66 6f 72 20 70 69 70 69 6e 67 20 70 72 6f 67 72 61 6d 73 20 69 6d   ┆l of UNIX for piping programs im┆
0x1300…1320 70 6c 69 65 73 0a 20 20 20 20 20 74 68 61 74 20 77 65 20 6d 6f 76 65 20 64 61 74 61 20 66 72 6f   ┆plies      that we move data fro┆
0x1320…1340 6d 20 73 6f 6d 65 20 66 69 6c 65 2c 20 74 68 72 6f 75 67 68 20 73 65 76 65 72 61 6c 20 70 72 6f   ┆m some file, through several pro┆
0x1340…1360 67 72 61 6d 73 2c 0a 20 20 20 20 20 61 6e 64 20 69 6e 74 6f 20 61 6e 6f 74 68 65 72 20 66 69 6c   ┆grams,      and into another fil┆
0x1360…1380 65 2c 20 77 68 69 63 68 20 2d 2d 20 63 6f 6e 63 65 70 74 75 61 6c 6c 79 20 61 74 20 6c 65 61 73   ┆e, which -- conceptually at leas┆
0x1380…13a0 74 2c 20 6d 61 79 0a 20 20 20 20 20 62 65 20 74 68 65 20 73 61 6d 65 20 66 69 6c 65 20 61 73 20   ┆t, may      be the same file as ┆
0x13a0…13c0 74 68 65 20 64 61 74 61 20 68 61 76 65 20 63 6f 6d 65 20 66 72 6f 6d 2e 20 20 54 68 75 73 2c 20   ┆the data have come from.  Thus, ┆
0x13c0…13e0 63 6f 6e 63 65 70 2d 0a 20 20 20 20 20 74 75 61 6c 6c 79 2c 20 74 68 65 20 66 6c 6f 77 20 74 68   ┆concep-      tually, the flow th┆
0x13e0…1400 72 6f 75 67 68 20 61 20 70 69 70 65 20 73 68 6f 75 6c 64 20 6c 6f 6f 6b 20 6c 69 6b 65 20 74 68   ┆rough a pipe should look like th┆
0x1400…1420 69 73 3a 0a 20 20 20 20 20 66 69 6c 65 20 3d 3e 20 70 72 6f 67 72 61 6d 31 20 3d 3d 3e 20 70 72   ┆is:      file => program1 ==> pr┆
0x1420…1440 6f 67 72 61 6d 32 20 3d 3d 3e 20 2e 2e 2e 20 3d 3d 3e 20 70 72 6f 67 72 61 6d 4e 20 20 3d 3d 3e   ┆ogram2 ==> ... ==> programN  ==>┆
0x1440…1460 20 66 69 6c 65 0a 20 20 20 20 20 57 69 74 68 69 6e 20 74 68 65 20 65 78 69 73 74 69 6e 67 20 55   ┆ file      Within the existing U┆
0x1460…1480 4e 49 58 20 73 68 65 6c 6c 73 2c 20 74 68 69 73 20 70 69 70 65 20 6d 75 73 74 20 62 65 20 73 70   ┆NIX shells, this pipe must be sp┆
0x1480…14a0 65 63 69 66 69 65 64 0a 20 20 20 20 20 61 73 0a 20 20 20 20 20 20 20 20 20 20 70 72 6f 67 72 61   ┆ecified      as           progra┆
0x14a0…14c0 6d 31 20 3c 20 66 69 6c 65 20 7c 20 70 72 6f 67 72 61 6d 32 20 7c 20 2e 2e 2e 20 7c 20 70 72 6f   ┆m1 < file | program2 | ... | pro┆
0x14c0…14e0 67 72 61 6d 4e 20 3e 20 74 65 6d 70 0a 20 20 20 20 20 20 20 20 20 20 6d 76 20 74 65 6d 70 20 66   ┆gramN > temp           mv temp f┆
0x14e0…1500 69 6c 65 0a 20 20 20 20 20 54 68 69 73 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 20 6f 66 20 74   ┆ile      This specification of t┆
0x1500…1520 68 65 20 70 69 70 65 20 70 72 65 73 65 6e 74 73 20 61 20 73 79 73 74 65 6d 20 69 6d 61 67 65 20   ┆he pipe presents a system image ┆
0x1520…1540 6f 66 0a 20 20 20 20 20 55 4e 49 58 20 74 68 61 74 20 63 6f 6e 66 6c 69 63 74 73 20 77 69 74 68   ┆of      UNIX that conflicts with┆
0x1540…1560 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 6d 65 6e 74 61 6c 20 6d 6f 64 65 6c 20 6f 66 20   ┆ the underlying mental model of ┆
0x1560…1580 6d 6f 73 74 0a 20 20 20 20 20 75 73 65 72 73 2e 20 20 46 69 72 73 74 2c 20 74 68 65 20 73 70 65   ┆most      users.  First, the spe┆
0x1580…15a0 63 69 66 69 63 61 74 69 6f 6e 20 6f 66 20 22 66 69 6c 65 22 20 61 6e 64 20 22 70 72 6f 67 72 61   ┆cification of "file" and "progra┆
0x15a0…15c0 6d 31 22 0a 20 20 20 20 20 61 72 65 20 6f 75 74 20 6f 66 20 6f 72 64 65 72 3b 20 73 65 63 6f 6e   ┆m1"      are out of order; secon┆
0x15c0…15e0 64 2c 20 6f 6e 65 20 6d 75 73 74 20 64 69 73 74 69 6e 67 75 69 73 68 20 61 6d 6f 6e 67 20 22 3c   ┆d, one must distinguish among "<┆
0x15e0…1600 22 20 22 3e 22 0a 20 20 20 20 20 61 6e 64 20 22 7c 22 2e 20 20 54 68 65 20 70 72 6f 67 72 61 6d   ┆" ">"      and "|".  The program┆
0x1600…1620 20 5f 08 69 5f 08 6f 20 69 73 20 64 65 73 69 67 6e 65 64 20 74 6f 20 61 6c 6c 6f 77 20 61 20 66   ┆ _ i_ o is designed to allow a f┆
0x1620…1640 6f 72 6d 61 74 20 6d 6f 72 65 0a 20 20 20 20 20 63 6f 6e 73 69 73 74 65 6e 74 20 77 69 74 68 20   ┆ormat more      consistent with ┆
0x1640…1660 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 63 6f 6e 63 65 70 74 75 61 6c 69 7a 61 74 69 6f 6e   ┆the underlying conceptualization┆
0x1660…1680 2e 20 20 41 6c 6f 6e 67 20 74 68 65 0a 20 20 20 20 20 77 61 79 2c 20 69 74 20 65 6c 69 6d 69 6e   ┆.  Along the      way, it elimin┆
0x1680…16a0 61 74 65 73 20 74 68 65 20 6e 65 65 64 20 66 6f 72 20 64 69 73 74 69 6e 67 75 69 73 68 69 6e 67   ┆ates the need for distinguishing┆
0x16a0…16c0 20 62 65 74 77 65 65 6e 20 3c 2c 20 3e 2c 0a 20 20 20 20 20 61 6e 64 20 7c 20 61 6e 64 20 6f 66   ┆ between <, >,      and | and of┆
0x16c0…16e0 66 65 72 73 20 73 6f 6d 65 20 6e 65 77 20 70 72 6f 70 65 72 74 69 65 73 2e 20 20 55 73 69 6e 67   ┆fers some new properties.  Using┆
0x16e0…1700 20 5f 08 69 5f 08 6f 2c 20 74 68 65 20 65 78 61 6d 70 6c 65 0a 20 20 20 20 20 70 69 70 65 20 63   ┆ _ i_ o, the example      pipe c┆
0x1700…1720 61 6e 20 62 65 20 77 72 69 74 74 65 6e 0a 20 20 20 20 20 20 20 69 6f 20 66 69 6c 65 20 7c 20 70   ┆an be written        io file | p┆
0x1720…1740 72 6f 67 72 61 6d 31 20 7c 20 70 72 6f 67 72 61 6d 32 20 7c 20 2e 2e 2e 20 7c 20 70 72 6f 67 72   ┆rogram1 | program2 | ... | progr┆
0x1740…1760 61 6d 4e 20 7c 20 69 6f 20 66 69 6c 65 0a 0a 44 49 41 47 4e 4f 53 54 49 43 53 0a 20 20 20 20 20   ┆amN | io file  DIAGNOSTICS      ┆
0x1760…1780 54 68 65 20 70 72 6f 67 72 61 6d 20 68 61 73 20 61 20 6c 6f 74 20 6f 66 20 6b 6e 6f 77 6c 65 64   ┆The program has a lot of knowled┆
0x1780…17a0 67 65 20 61 62 6f 75 74 20 68 6f 77 20 69 74 20 69 73 20 62 65 69 6e 67 0a 20 20 20 20 20 75 73   ┆ge about how it is being      us┆
0x17a0…17c0 65 64 2e 20 20 49 74 20 6b 6e 6f 77 73 20 77 68 65 74 68 65 72 20 69 74 20 69 73 20 72 65 61 64   ┆ed.  It knows whether it is read┆
0x17c0…17e0 69 6e 67 20 66 72 6f 6d 20 70 69 70 65 64 20 69 6e 70 75 74 20 6f 72 0a 20 20 20 20 20 66 72 6f   ┆ing from piped input or      fro┆
0x17e0…1800 6d 20 74 68 65 20 74 65 72 6d 69 6e 61 6c 20 6b 65 79 62 6f 61 72 64 20 28 74 74 79 29 2e 20 20   ┆m the terminal keyboard (tty).  ┆
0x1800…1820 49 74 20 61 6c 73 6f 20 6b 6e 6f 77 73 20 77 68 65 74 68 65 72 20 69 74 0a 20 20 20 20 20 69 73   ┆It also knows whether it      is┆
0x1820…1840 20 77 72 69 74 69 6e 67 20 74 6f 20 61 20 70 69 70 65 20 6f 72 20 74 6f 20 74 68 65 20 74 74 79   ┆ writing to a pipe or to the tty┆
0x1840…1860 2e 20 20 49 74 20 6b 6e 6f 77 73 20 74 6f 20 63 68 65 63 6b 20 61 72 67 75 2d 0a 20 20 20 20 20   ┆.  It knows to check argu-      ┆
0x1860…1880 6d 65 6e 74 20 66 69 6c 65 73 20 74 6f 20 73 65 65 20 69 66 20 6f 6e 65 73 20 74 6f 20 62 65 20   ┆ment files to see if ones to be ┆
0x1880…18a0 72 65 61 64 20 63 61 6e 20 62 65 20 72 65 61 64 2c 20 61 6e 64 20 69 66 20 61 0a 20 20 20 20 20   ┆read can be read, and if a      ┆
0x18a0…18c0 66 69 6c 65 20 74 6f 20 62 65 20 77 72 69 74 74 65 6e 20 65 78 69 73 74 73 2c 20 61 6e 64 20 69   ┆file to be written exists, and i┆
0x18c0…18e0 66 20 73 6f 2c 20 74 6f 20 6d 61 6b 65 20 61 20 74 65 6d 70 6f 72 61 72 79 0a 20 20 20 20 20 76   ┆f so, to make a temporary      v┆
0x18e0…1900 65 72 73 69 6f 6e 20 6f 66 20 69 74 20 62 65 66 6f 72 65 20 6f 76 65 72 2d 77 72 69 74 69 6e 67   ┆ersion of it before over-writing┆
0x1900…1920 20 69 74 2e 20 20 49 74 20 61 6c 73 6f 20 6b 6e 6f 77 73 20 74 68 61 74 0a 20 20 20 20 20 64 65   ┆ it.  It also knows that      de┆
[…truncated at 200 lines…]