home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: tpipe
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 77 75 | 61 72 63 68 69 76 65 21 |Path: wu|archive!|
|00000010| 75 73 63 21 62 62 6e 2e | 63 6f 6d 21 70 61 70 61 |usc!bbn.|com!papa|
|00000020| 79 61 2e 62 62 6e 2e 63 | 6f 6d 21 72 73 61 6c 7a |ya.bbn.c|om!rsalz|
|00000030| 0a 46 72 6f 6d 3a 20 72 | 73 61 6c 7a 40 75 75 6e |.From: r|salz@uun|
|00000040| 65 74 2e 75 75 2e 6e 65 | 74 20 28 52 69 63 68 20 |et.uu.ne|t (Rich |
|00000050| 53 61 6c 7a 29 0a 4e 65 | 77 73 67 72 6f 75 70 73 |Salz).Ne|wsgroups|
|00000060| 3a 20 63 6f 6d 70 2e 73 | 6f 75 72 63 65 73 2e 75 |: comp.s|ources.u|
|00000070| 6e 69 78 0a 53 75 62 6a | 65 63 74 3a 20 76 32 32 |nix.Subj|ect: v22|
|00000080| 69 30 31 31 3a 20 20 41 | 20 22 74 65 65 22 20 74 |i011: A| "tee" t|
|00000090| 68 61 74 20 66 65 65 64 | 73 20 69 6e 74 6f 20 70 |hat feed|s into p|
|000000a0| 69 70 65 73 2e 0a 4d 65 | 73 73 61 67 65 2d 49 44 |ipes..Me|ssage-ID|
|000000b0| 3a 20 3c 32 34 38 34 40 | 70 61 70 61 79 61 2e 62 |: <2484@|papaya.b|
|000000c0| 62 6e 2e 63 6f 6d 3e 0a | 44 61 74 65 3a 20 33 20 |bn.com>.|Date: 3 |
|000000d0| 4d 61 79 20 39 30 20 32 | 30 3a 34 33 3a 34 36 20 |May 90 2|0:43:46 |
|000000e0| 47 4d 54 0a 4c 69 6e 65 | 73 3a 20 32 36 33 0a 41 |GMT.Line|s: 263.A|
|000000f0| 70 70 72 6f 76 65 64 3a | 20 72 73 61 6c 7a 40 75 |pproved:| rsalz@u|
|00000100| 75 6e 65 74 2e 55 55 2e | 4e 45 54 0a 58 2d 43 68 |unet.UU.|NET.X-Ch|
|00000110| 65 63 6b 73 75 6d 2d 53 | 6e 65 66 72 75 3a 20 65 |ecksum-S|nefru: e|
|00000120| 62 36 35 37 66 35 30 20 | 38 62 33 65 39 39 39 33 |b657f50 |8b3e9993|
|00000130| 20 35 33 37 63 31 65 38 | 37 20 32 66 35 39 37 39 | 537c1e8|7 2f5979|
|00000140| 61 30 0a 0a 53 75 62 6d | 69 74 74 65 64 2d 62 79 |a0..Subm|itted-by|
|00000150| 3a 20 44 61 76 69 64 20 | 42 20 52 6f 73 65 6e 20 |: David |B Rosen |
|00000160| 3c 72 6f 73 65 6e 40 62 | 75 63 61 73 62 2e 62 75 |<rosen@b|ucasb.bu|
|00000170| 2e 65 64 75 3e 0a 50 6f | 73 74 69 6e 67 2d 6e 75 |.edu>.Po|sting-nu|
|00000180| 6d 62 65 72 3a 20 56 6f | 6c 75 6d 65 20 32 32 2c |mber: Vo|lume 22,|
|00000190| 20 49 73 73 75 65 20 31 | 31 0a 41 72 63 68 69 76 | Issue 1|1.Archiv|
|000001a0| 65 2d 6e 61 6d 65 3a 20 | 74 70 69 70 65 0a 0a 74 |e-name: |tpipe..t|
|000001b0| 70 69 70 65 20 69 73 20 | 61 20 73 69 6d 70 6c 65 |pipe is |a simple|
|000001c0| 20 75 74 69 6c 69 74 79 | 20 70 72 6f 67 72 61 6d | utility| program|
|000001d0| 20 74 68 61 74 20 63 61 | 6e 20 62 65 20 75 73 65 | that ca|n be use|
|000001e0| 64 20 74 6f 20 73 70 6c | 69 74 20 61 20 75 6e 69 |d to spl|it a uni|
|000001f0| 78 0a 70 69 70 65 6c 69 | 6e 65 20 69 6e 74 6f 20 |x.pipeli|ne into |
|00000200| 74 77 6f 20 70 69 70 65 | 6c 69 6e 65 73 2e 20 54 |two pipe|lines. T|
|00000210| 68 61 74 20 69 73 2c 20 | 74 68 65 20 6f 75 74 70 |hat is, |the outp|
|00000220| 75 74 20 6f 66 20 6f 6e | 65 20 70 69 70 65 6c 69 |ut of on|e pipeli|
|00000230| 6e 65 20 63 61 6e 0a 62 | 65 20 72 65 70 6c 69 63 |ne can.b|e replic|
|00000240| 61 74 65 64 20 61 6e 64 | 20 73 75 70 70 6c 69 65 |ated and| supplie|
|00000250| 64 20 61 73 20 74 68 65 | 20 69 6e 70 75 74 20 74 |d as the| input t|
|00000260| 6f 20 74 77 6f 20 6f 74 | 68 65 72 20 70 69 70 65 |o two ot|her pipe|
|00000270| 6c 69 6e 65 73 0a 65 78 | 65 63 75 74 69 6e 67 20 |lines.ex|ecuting |
|00000280| 73 69 6d 75 6c 74 61 6e | 65 6f 75 73 6c 79 2e 0a |simultan|eously..|
|00000290| 0a 46 6f 72 20 65 78 61 | 6d 70 6c 65 0a 20 20 20 |.For exa|mple. |
|000002a0| 20 63 6d 64 31 20 3c 69 | 6e 66 69 6c 65 20 7c 20 | cmd1 <i|nfile | |
|000002b0| 74 70 69 70 65 20 22 63 | 6d 64 32 20 7c 20 63 6d |tpipe "c|md2 | cm|
|000002c0| 64 33 20 3e 6f 75 74 66 | 69 6c 65 22 20 7c 20 63 |d3 >outf|ile" | c|
|000002d0| 6d 64 34 20 0a 77 69 6c | 6c 20 6c 6f 6f 6b 20 6c |md4 .wil|l look l|
|000002e0| 69 6b 65 20 74 68 69 73 | 20 64 69 61 67 72 61 6d |ike this| diagram|
|000002f0| 61 74 69 63 61 6c 6c 79 | 3a 0a 09 09 09 20 2d 2d |atically|:.... --|
|00000300| 3e 20 63 6d 64 32 20 2d | 2d 3e 20 63 6d 64 33 20 |> cmd2 -|-> cmd3 |
|00000310| 2d 2d 3e 20 6f 75 74 66 | 69 6c 65 0a 09 09 20 20 |--> outf|ile... |
|00000320| 20 20 20 20 20 2f 0a 20 | 20 20 20 69 6e 66 69 6c | /. | infil|
|00000330| 65 20 20 2d 2d 3e 20 63 | 6d 64 31 20 2d 3c 0a 09 |e --> c|md1 -<..|
|00000340| 09 20 20 20 20 20 20 20 | 5c 5c 0a 09 09 09 20 2d |. |\\.... -|
|00000350| 2d 3e 20 63 6d 64 34 20 | 2d 2d 3e 20 20 28 73 74 |-> cmd4 |--> (st|
|00000360| 61 6e 64 61 72 64 20 6f | 75 74 70 75 74 29 0a 0a |andard o|utput)..|
|00000370| 23 21 20 2f 62 69 6e 2f | 73 68 0a 23 20 54 68 69 |#! /bin/|sh.# Thi|
|00000380| 73 20 69 73 20 61 20 73 | 68 65 6c 6c 20 61 72 63 |s is a s|hell arc|
|00000390| 68 69 76 65 2e 20 20 52 | 65 6d 6f 76 65 20 61 6e |hive. R|emove an|
|000003a0| 79 74 68 69 6e 67 20 62 | 65 66 6f 72 65 20 74 68 |ything b|efore th|
|000003b0| 69 73 20 6c 69 6e 65 2c | 20 74 68 65 6e 20 75 6e |is line,| then un|
|000003c0| 70 61 63 6b 0a 23 20 69 | 74 20 62 79 20 73 61 76 |pack.# i|t by sav|
|000003d0| 69 6e 67 20 69 74 20 69 | 6e 74 6f 20 61 20 66 69 |ing it i|nto a fi|
|000003e0| 6c 65 20 61 6e 64 20 74 | 79 70 69 6e 67 20 22 73 |le and t|yping "s|
|000003f0| 68 20 66 69 6c 65 22 2e | 20 20 54 6f 20 6f 76 65 |h file".| To ove|
|00000400| 72 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 0a |rwrite e|xisting.|
|00000410| 23 20 66 69 6c 65 73 2c | 20 74 79 70 65 20 22 73 |# files,| type "s|
|00000420| 68 20 66 69 6c 65 20 2d | 63 22 2e 20 20 59 6f 75 |h file -|c". You|
|00000430| 20 63 61 6e 20 61 6c 73 | 6f 20 66 65 65 64 20 74 | can als|o feed t|
|00000440| 68 69 73 20 61 73 20 73 | 74 61 6e 64 61 72 64 20 |his as s|tandard |
|00000450| 69 6e 70 75 74 20 76 69 | 61 0a 23 20 75 6e 73 68 |input vi|a.# unsh|
|00000460| 61 72 2c 20 6f 72 20 62 | 79 20 74 79 70 69 6e 67 |ar, or b|y typing|
|00000470| 20 22 73 68 20 3c 66 69 | 6c 65 22 2c 20 65 2e 67 | "sh <fi|le", e.g|
|00000480| 2e 2e 20 20 49 66 20 74 | 68 69 73 20 61 72 63 68 |.. If t|his arch|
|00000490| 69 76 65 20 69 73 20 63 | 6f 6d 70 6c 65 74 65 2c |ive is c|omplete,|
|000004a0| 20 79 6f 75 0a 23 20 77 | 69 6c 6c 20 73 65 65 20 | you.# w|ill see |
|000004b0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 6d 65 |the foll|owing me|
|000004c0| 73 73 61 67 65 20 61 74 | 20 74 68 65 20 65 6e 64 |ssage at| the end|
|000004d0| 3a 0a 23 09 09 22 45 6e | 64 20 6f 66 20 73 68 65 |:.#.."En|d of she|
|000004e0| 6c 6c 20 61 72 63 68 69 | 76 65 2e 22 0a 23 20 43 |ll archi|ve.".# C|
|000004f0| 6f 6e 74 65 6e 74 73 3a | 20 20 4d 61 6b 65 66 69 |ontents:| Makefi|
|00000500| 6c 65 20 52 45 41 44 4d | 45 20 74 70 69 70 65 2e |le READM|E tpipe.|
|00000510| 31 20 74 70 69 70 65 2e | 63 0a 23 20 57 72 61 70 |1 tpipe.|c.# Wrap|
|00000520| 70 65 64 20 62 79 20 72 | 73 61 6c 7a 40 70 61 70 |ped by r|salz@pap|
|00000530| 61 79 61 2e 62 62 6e 2e | 63 6f 6d 20 6f 6e 20 54 |aya.bbn.|com on T|
|00000540| 68 75 20 4d 61 79 20 20 | 33 20 31 36 3a 34 30 3a |hu May |3 16:40:|
|00000550| 31 30 20 31 39 39 30 0a | 50 41 54 48 3d 2f 62 69 |10 1990.|PATH=/bi|
|00000560| 6e 3a 2f 75 73 72 2f 62 | 69 6e 3a 2f 75 73 72 2f |n:/usr/b|in:/usr/|
|00000570| 75 63 62 20 3b 20 65 78 | 70 6f 72 74 20 50 41 54 |ucb ; ex|port PAT|
|00000580| 48 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 4d 61 |H.if tes|t -f 'Ma|
|00000590| 6b 65 66 69 6c 65 27 20 | 2d 61 20 22 24 7b 31 7d |kefile' |-a "${1}|
|000005a0| 22 20 21 3d 20 22 2d 63 | 22 20 3b 20 74 68 65 6e |" != "-c|" ; then|
|000005b0| 20 0a 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 57 | . echo| shar: W|
|000005c0| 69 6c 6c 20 6e 6f 74 20 | 63 6c 6f 62 62 65 72 20 |ill not |clobber |
|000005d0| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 5c 22 |existing| file \"|
|000005e0| 27 4d 61 6b 65 66 69 6c | 65 27 5c 22 0a 65 6c 73 |'Makefil|e'\".els|
|000005f0| 65 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 78 74 |e.echo s|har: Ext|
|00000600| 72 61 63 74 69 6e 67 20 | 5c 22 27 4d 61 6b 65 66 |racting |\"'Makef|
|00000610| 69 6c 65 27 5c 22 20 5c | 28 31 30 37 20 63 68 61 |ile'\" \|(107 cha|
|00000620| 72 61 63 74 65 72 73 5c | 29 0a 73 65 64 20 22 73 |racters\|).sed "s|
|00000630| 2f 5e 58 2f 2f 22 20 3e | 27 4d 61 6b 65 66 69 6c |/^X//" >|'Makefil|
|00000640| 65 27 20 3c 3c 27 45 4e | 44 5f 4f 46 5f 46 49 4c |e' <<'EN|D_OF_FIL|
|00000650| 45 27 0a 58 43 43 20 3d | 09 09 63 63 0a 58 43 46 |E'.XCC =|..cc.XCF|
|00000660| 4c 41 47 53 20 3d 09 2d | 4f 0a 58 54 50 49 50 45 |LAGS =.-|O.XTPIPE|
|00000670| 20 3d 09 09 74 70 69 70 | 65 0a 58 43 46 49 4c 45 | =..tpip|e.XCFILE|
|00000680| 53 20 3d 09 74 70 69 70 | 65 2e 63 0a 58 0a 58 24 |S =.tpip|e.c.X.X$|
|00000690| 28 54 50 49 50 45 29 3a | 20 24 28 43 46 49 4c 45 |(TPIPE):| $(CFILE|
|000006a0| 53 29 0a 58 09 24 28 43 | 43 29 20 24 28 43 46 4c |S).X.$(C|C) $(CFL|
|000006b0| 41 47 53 29 20 24 28 43 | 46 49 4c 45 53 29 20 2d |AGS) $(C|FILES) -|
|000006c0| 6f 20 24 40 0a 45 4e 44 | 5f 4f 46 5f 46 49 4c 45 |o $@.END|_OF_FILE|
|000006d0| 0a 69 66 20 74 65 73 74 | 20 31 30 37 20 2d 6e 65 |.if test| 107 -ne|
|000006e0| 20 60 77 63 20 2d 63 20 | 3c 27 4d 61 6b 65 66 69 | `wc -c |<'Makefi|
|000006f0| 6c 65 27 60 3b 20 74 68 | 65 6e 0a 20 20 20 20 65 |le'`; th|en. e|
|00000700| 63 68 6f 20 73 68 61 72 | 3a 20 5c 22 27 4d 61 6b |cho shar|: \"'Mak|
|00000710| 65 66 69 6c 65 27 5c 22 | 20 75 6e 70 61 63 6b 65 |efile'\"| unpacke|
|00000720| 64 20 77 69 74 68 20 77 | 72 6f 6e 67 20 73 69 7a |d with w|rong siz|
|00000730| 65 21 0a 66 69 0a 23 20 | 65 6e 64 20 6f 66 20 27 |e!.fi.# |end of '|
|00000740| 4d 61 6b 65 66 69 6c 65 | 27 0a 66 69 0a 69 66 20 |Makefile|'.fi.if |
|00000750| 74 65 73 74 20 2d 66 20 | 27 52 45 41 44 4d 45 27 |test -f |'README'|
|00000760| 20 2d 61 20 22 24 7b 31 | 7d 22 20 21 3d 20 22 2d | -a "${1|}" != "-|
|00000770| 63 22 20 3b 20 74 68 65 | 6e 20 0a 20 20 65 63 68 |c" ; the|n . ech|
|00000780| 6f 20 73 68 61 72 3a 20 | 57 69 6c 6c 20 6e 6f 74 |o shar: |Will not|
|00000790| 20 63 6c 6f 62 62 65 72 | 20 65 78 69 73 74 69 6e | clobber| existin|
|000007a0| 67 20 66 69 6c 65 20 5c | 22 27 52 45 41 44 4d 45 |g file \|"'README|
|000007b0| 27 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |'\".else|.echo sh|
|000007c0| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|000007d0| 22 27 52 45 41 44 4d 45 | 27 5c 22 20 5c 28 32 31 |"'README|'\" \(21|
|000007e0| 31 38 20 63 68 61 72 61 | 63 74 65 72 73 5c 29 0a |18 chara|cters\).|
|000007f0| 73 65 64 20 22 73 2f 5e | 58 2f 2f 22 20 3e 27 52 |sed "s/^|X//" >'R|
|00000800| 45 41 44 4d 45 27 20 3c | 3c 27 45 4e 44 5f 4f 46 |EADME' <|<'END_OF|
|00000810| 5f 46 49 4c 45 27 0a 58 | 2d 2d 2d 2d 2d 2d 2d 2d |_FILE'.X|--------|
|00000820| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000830| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000840| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000850| 2d 2d 2d 2d 2d 0a 58 74 | 70 69 70 65 20 2d 2d 20 |-----.Xt|pipe -- |
|00000860| 20 72 65 70 6c 69 63 61 | 74 65 20 73 74 61 6e 64 | replica|te stand|
|00000870| 61 72 64 20 6f 75 74 70 | 75 74 20 74 6f 20 61 6e |ard outp|ut to an|
|00000880| 20 61 64 64 69 74 69 6f | 6e 61 6c 20 70 69 70 65 | additio|nal pipe|
|00000890| 6c 69 6e 65 0a 58 20 20 | 20 20 20 20 20 20 20 20 |line.X | |
|000008a0| 20 20 20 20 76 65 72 73 | 69 6f 6e 20 31 2e 30 32 | vers|ion 1.02|
|000008b0| 20 20 20 20 36 20 4d 61 | 72 2e 20 31 39 39 30 0a | 6 Ma|r. 1990.|
|000008c0| 58 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |X-------|--------|
|000008d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0a 58 |--------|------.X|
|00000900| 0a 58 74 70 69 70 65 20 | 69 73 20 61 20 73 69 6d |.Xtpipe |is a sim|
|00000910| 70 6c 65 20 75 74 69 6c | 69 74 79 20 70 72 6f 67 |ple util|ity prog|
|00000920| 72 61 6d 20 74 68 61 74 | 20 63 61 6e 20 62 65 20 |ram that| can be |
|00000930| 75 73 65 64 20 74 6f 20 | 73 70 6c 69 74 20 61 20 |used to |split a |
|00000940| 75 6e 69 78 0a 58 70 69 | 70 65 6c 69 6e 65 20 69 |unix.Xpi|peline i|
|00000950| 6e 74 6f 20 74 77 6f 20 | 70 69 70 65 6c 69 6e 65 |nto two |pipeline|
|00000960| 73 2e 20 54 68 61 74 20 | 69 73 2c 20 74 68 65 20 |s. That |is, the |
|00000970| 6f 75 74 70 75 74 20 6f | 66 20 6f 6e 65 20 70 69 |output o|f one pi|
|00000980| 70 65 6c 69 6e 65 20 63 | 61 6e 0a 58 62 65 20 72 |peline c|an.Xbe r|
|00000990| 65 70 6c 69 63 61 74 65 | 64 20 61 6e 64 20 73 75 |eplicate|d and su|
|000009a0| 70 70 6c 69 65 64 20 61 | 73 20 74 68 65 20 69 6e |pplied a|s the in|
|000009b0| 70 75 74 20 74 6f 20 74 | 77 6f 20 6f 74 68 65 72 |put to t|wo other|
|000009c0| 20 70 69 70 65 6c 69 6e | 65 73 0a 58 65 78 65 63 | pipelin|es.Xexec|
|000009d0| 75 74 69 6e 67 20 73 69 | 6d 75 6c 74 61 6e 65 6f |uting si|multaneo|
|000009e0| 75 73 6c 79 2e 0a 58 0a | 58 4c 69 6b 65 20 74 65 |usly..X.|XLike te|
|000009f0| 65 28 31 29 2c 20 74 70 | 69 70 65 20 74 72 61 6e |e(1), tp|ipe tran|
|00000a00| 73 63 72 69 62 65 73 20 | 69 74 73 20 73 74 61 6e |scribes |its stan|
|00000a10| 64 61 72 64 20 69 6e 70 | 75 74 20 74 6f 20 69 74 |dard inp|ut to it|
|00000a20| 73 20 73 74 61 6e 64 61 | 72 64 0a 58 6f 75 74 70 |s standa|rd.Xoutp|
|00000a30| 75 74 2e 20 42 75 74 20 | 77 68 65 72 65 20 74 65 |ut. But |where te|
|00000a40| 65 28 31 29 20 77 72 69 | 74 65 73 20 61 6e 20 61 |e(1) wri|tes an a|
|00000a50| 64 64 69 74 69 6f 6e 61 | 6c 20 63 6f 70 79 20 6f |dditiona|l copy o|
|00000a60| 66 20 69 74 73 20 69 6e | 70 75 74 20 74 6f 20 61 |f its in|put to a|
|00000a70| 0a 58 66 69 6c 65 2c 20 | 74 70 69 70 65 20 77 72 |.Xfile, |tpipe wr|
|00000a80| 69 74 65 73 20 74 68 65 | 20 61 64 64 69 74 69 6f |ites the| additio|
|00000a90| 6e 61 6c 20 63 6f 70 79 | 20 74 6f 20 74 68 65 20 |nal copy| to the |
|00000aa0| 69 6e 70 75 74 20 6f 66 | 20 61 6e 6f 74 68 65 72 |input of| another|
|00000ab0| 0a 58 70 69 70 65 6c 69 | 6e 65 2c 20 77 68 69 63 |.Xpipeli|ne, whic|
|00000ac0| 68 20 69 73 20 73 70 65 | 63 69 66 69 65 64 20 61 |h is spe|cified a|
|00000ad0| 73 20 74 68 65 20 61 72 | 67 75 6d 65 6e 74 20 74 |s the ar|gument t|
|00000ae0| 6f 20 74 70 69 70 65 2e | 20 49 6e 20 61 20 74 79 |o tpipe.| In a ty|
|00000af0| 70 69 63 61 6c 0a 58 75 | 73 65 2c 20 74 68 69 73 |pical.Xu|se, this|
|00000b00| 20 70 69 70 65 6c 69 6e | 65 20 77 69 6c 6c 20 65 | pipelin|e will e|
|00000b10| 76 65 6e 74 75 61 6c 6c | 79 20 77 72 69 74 65 20 |ventuall|y write |
|00000b20| 74 6f 20 61 20 66 69 6c | 65 2e 20 54 68 65 20 73 |to a fil|e. The s|
|00000b30| 74 61 6e 64 61 72 64 0a | 58 6f 75 74 70 75 74 20 |tandard.|Xoutput |
|00000b40| 6f 66 20 74 70 69 70 65 | 20 69 73 20 74 79 70 69 |of tpipe| is typi|
|00000b50| 63 61 6c 6c 79 20 70 69 | 70 65 64 20 69 6e 74 6f |cally pi|ped into|
|00000b60| 20 61 6e 6f 74 68 65 72 | 20 70 69 70 65 6c 69 6e | another| pipelin|
|00000b70| 65 2c 20 77 68 6f 73 65 | 20 6f 75 74 70 75 74 0a |e, whose| output.|
|00000b80| 58 28 69 66 20 61 6e 79 | 29 20 6d 61 79 20 67 6f |X(if any|) may go|
|00000b90| 20 74 6f 20 74 68 65 20 | 75 73 65 72 27 73 20 74 | to the |user's t|
|00000ba0| 65 72 6d 69 6e 61 6c 20 | 6f 72 20 61 6e 79 77 68 |erminal |or anywh|
|00000bb0| 65 72 65 20 61 74 20 61 | 6c 6c 2e 0a 58 0a 58 49 |ere at a|ll..X.XI|
|00000bc0| 20 77 72 6f 74 65 20 74 | 70 69 70 65 20 62 65 63 | wrote t|pipe bec|
|00000bd0| 61 75 73 65 20 49 20 77 | 61 73 20 70 72 6f 63 65 |ause I w|as proce|
|00000be0| 73 73 69 6e 67 20 69 6d | 61 67 65 20 66 69 6c 65 |ssing im|age file|
|00000bf0| 73 20 28 75 73 69 6e 67 | 20 70 62 6d 70 6c 75 73 |s (using| pbmplus|
|00000c00| 29 2c 0a 58 61 6e 64 20 | 49 20 77 61 6e 74 65 64 |),.Xand |I wanted|
|00000c10| 20 74 6f 20 61 70 70 6c | 79 20 6d 6f 72 65 20 74 | to appl|y more t|
|00000c20| 68 61 6e 20 6f 6e 65 20 | 70 69 70 65 6c 69 6e 65 |han one |pipeline|
|00000c30| 20 74 6f 20 74 68 65 20 | 73 61 6d 65 20 69 6e 70 | to the |same inp|
|00000c40| 75 74 20 66 69 6c 65 2c | 0a 58 62 75 74 20 74 68 |ut file,|.Xbut th|
|00000c50| 65 20 65 61 72 6c 79 20 | 70 61 72 74 73 20 6f 66 |e early |parts of|
|00000c60| 20 74 68 65 20 70 69 70 | 65 6c 69 6e 65 20 77 65 | the pip|eline we|
|00000c70| 72 65 20 74 68 65 20 73 | 61 6d 65 2e 20 49 20 64 |re the s|ame. I d|
|00000c80| 69 64 20 6e 6f 74 20 77 | 61 6e 74 20 74 6f 0a 58 |id not w|ant to.X|
|00000c90| 68 61 76 65 20 74 6f 20 | 65 78 65 63 75 74 65 20 |have to |execute |
|00000ca0| 74 68 65 20 65 61 72 6c | 79 20 70 61 72 74 73 20 |the earl|y parts |
|00000cb0| 6d 75 6c 74 69 70 6c 65 | 20 74 69 6d 65 73 2e 20 |multiple| times. |
|00000cc0| 49 20 64 69 64 20 6e 6f | 74 20 68 61 76 65 20 65 |I did no|t have e|
|00000cd0| 6e 6f 75 67 68 0a 58 64 | 69 73 6b 20 73 70 61 63 |nough.Xd|isk spac|
|00000ce0| 65 20 74 6f 20 77 72 69 | 74 65 20 77 68 61 74 20 |e to wri|te what |
|00000cf0| 77 6f 75 6c 64 20 68 61 | 76 65 20 62 65 65 6e 20 |would ha|ve been |
|00000d00| 61 20 68 75 67 65 20 69 | 6e 74 65 72 6d 65 64 69 |a huge i|ntermedi|
|00000d10| 61 74 65 20 66 69 6c 65 | 2e 0a 58 46 72 61 6e 6b |ate file|..XFrank|
|00000d20| 6c 79 2c 20 49 20 64 69 | 64 20 6e 6f 74 20 6b 6e |ly, I di|d not kn|
|00000d30| 6f 77 20 61 62 6f 75 74 | 20 74 65 65 69 6e 67 20 |ow about| teeing |
|00000d40| 74 6f 20 6e 61 6d 65 64 | 20 70 69 70 65 73 2c 20 |to named| pipes, |
|00000d50| 62 75 74 20 61 6e 79 77 | 61 79 20 69 74 27 73 0a |but anyw|ay it's.|
|00000d60| 58 6e 69 63 65 20 6e 6f | 74 20 74 6f 20 68 61 76 |Xnice no|t to hav|
|00000d70| 65 20 74 6f 20 62 6f 74 | 68 65 72 20 77 69 74 68 |e to bot|her with|
|00000d80| 20 74 68 65 6d 20 6f 72 | 20 77 6f 72 72 79 20 61 | them or| worry a|
|00000d90| 62 6f 75 74 20 6e 61 6d | 65 20 63 6f 6e 66 6c 69 |bout nam|e confli|
|00000da0| 63 74 73 2c 0a 58 65 73 | 70 65 63 69 61 6c 6c 79 |cts,.Xes|pecially|
|00000db0| 20 69 66 20 79 6f 75 20 | 68 61 76 65 20 6d 6f 72 | if you |have mor|
|00000dc0| 65 20 74 68 61 6e 20 6f | 6e 65 20 6a 6f 62 20 77 |e than o|ne job w|
|00000dd0| 61 6e 74 69 6e 67 20 74 | 6f 20 64 6f 20 74 68 69 |anting t|o do thi|
|00000de0| 73 20 61 74 20 74 68 65 | 0a 58 73 61 6d 65 20 74 |s at the|.Xsame t|
|00000df0| 69 6d 65 2e 2e 2e 0a 58 | 0a 58 53 65 65 20 74 68 |ime....X|.XSee th|
|00000e00| 65 20 6d 61 6e 75 61 6c | 20 70 61 67 65 20 66 6f |e manual| page fo|
|00000e10| 72 20 74 70 69 70 65 28 | 31 29 20 66 6f 72 20 69 |r tpipe(|1) for i|
|00000e20| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 62 6f 75 74 |nformati|on about|
|00000e30| 20 69 74 73 20 75 73 65 | 2c 0a 58 69 6e 63 6c 75 | its use|,.Xinclu|
|00000e40| 64 69 6e 67 20 61 6e 20 | 61 72 74 69 66 69 63 69 |ding an |artifici|
|00000e50| 61 6c 20 65 78 61 6d 70 | 6c 65 2e 20 0a 58 0a 58 |al examp|le. .X.X|
|00000e60| 54 68 69 73 20 64 69 73 | 74 72 69 62 75 74 69 6f |This dis|tributio|
|00000e70| 6e 20 63 6f 6e 74 61 69 | 6e 73 20 66 6f 75 72 20 |n contai|ns four |
|00000e80| 66 69 6c 65 73 3a 0a 58 | 20 20 52 65 61 64 6d 65 |files:.X| Readme|
|00000e90| 20 28 74 68 69 73 20 69 | 73 20 69 74 29 0a 58 20 | (this i|s it).X |
|00000ea0| 20 4d 61 6b 65 66 69 6c | 65 20 28 69 74 20 69 73 | Makefil|e (it is|
|00000eb0| 20 74 72 69 76 69 61 6c | 29 0a 58 20 20 74 70 69 | trivial|).X tpi|
|00000ec0| 70 65 2e 31 20 20 28 74 | 68 65 20 6d 61 6e 75 61 |pe.1 (t|he manua|
|00000ed0| 6c 20 70 61 67 65 29 0a | 58 20 20 74 70 69 70 65 |l page).|X tpipe|
|00000ee0| 2e 63 20 20 28 74 68 65 | 20 63 6f 64 65 21 29 0a |.c (the| code!).|
|00000ef0| 58 0a 58 54 6f 20 72 65 | 61 64 20 74 68 65 20 6d |X.XTo re|ad the m|
|00000f00| 61 6e 75 61 6c 20 70 61 | 67 65 2c 20 6a 75 73 74 |anual pa|ge, just|
|00000f10| 20 60 6e 72 6f 66 66 20 | 2d 6d 61 6e 20 74 70 69 | `nroff |-man tpi|
|00000f20| 70 65 2e 31 27 2e 0a 58 | 0a 58 54 6f 20 63 6f 6d |pe.1'..X|.XTo com|
|00000f30| 70 69 6c 65 20 74 70 69 | 70 65 2c 20 6a 75 73 74 |pile tpi|pe, just|
|00000f40| 20 60 6d 61 6b 65 27 2e | 20 50 75 74 20 74 70 69 | `make'.| Put tpi|
|00000f50| 70 65 2e 31 20 69 6e 20 | 74 68 65 20 6d 61 6e 31 |pe.1 in |the man1|
|00000f60| 2f 20 64 69 72 65 63 74 | 6f 72 79 20 69 6e 0a 58 |/ direct|ory in.X|
|00000f70| 79 6f 75 72 20 4d 41 4e | 50 41 54 48 20 6f 72 20 |your MAN|PATH or |
|00000f80| 74 68 65 20 73 79 73 74 | 65 6d 20 6d 61 6e 20 70 |the syst|em man p|
|00000f90| 61 74 68 2e 0a 58 0a 58 | 2d 2d 0a 58 44 61 76 69 |ath..X.X|--.XDavi|
|00000fa0| 64 20 42 20 52 6f 73 65 | 6e 2c 20 43 6f 67 6e 69 |d B Rose|n, Cogni|
|00000fb0| 74 69 76 65 20 26 20 4e | 65 75 72 61 6c 20 53 79 |tive & N|eural Sy|
|00000fc0| 73 74 65 6d 73 20 20 20 | 20 20 20 20 20 20 20 20 |stems | |
|00000fd0| 20 20 20 20 20 20 20 72 | 6f 73 65 6e 40 62 75 63 | r|osen@buc|
|00000fe0| 61 73 62 2e 62 75 2e 65 | 64 75 0a 58 43 65 6e 74 |asb.bu.e|du.XCent|
|00000ff0| 65 72 20 66 6f 72 20 41 | 64 61 70 74 69 76 65 20 |er for A|daptive |
|00001000| 53 79 73 74 65 6d 73 20 | 20 20 20 20 20 20 20 20 |Systems | |
|00001010| 20 20 20 20 20 20 20 20 | 72 6f 73 65 6e 25 62 75 | |rosen%bu|
|00001020| 63 61 73 62 40 7b 62 75 | 61 63 63 61 2c 62 75 2d |casb@{bu|acca,bu-|
|00001030| 69 74 7d 2e 62 75 2e 65 | 64 75 0a 58 42 6f 73 74 |it}.bu.e|du.XBost|
|00001040| 6f 6e 20 55 6e 69 76 65 | 72 73 69 74 79 20 20 20 |on Unive|rsity |
|00001050| 20 20 20 20 20 20 20 20 | 20 20 20 7b 6d 69 74 2d | | {mit-|
|00001060| 65 64 64 69 65 2c 68 61 | 72 76 61 72 64 2c 75 75 |eddie,ha|rvard,uu|
|00001070| 6e 65 74 7d 21 62 75 2e | 65 64 75 21 74 68 61 6c |net}!bu.|edu!thal|
|00001080| 61 6d 75 73 21 72 6f 73 | 65 6e 0a 45 4e 44 5f 4f |amus!ros|en.END_O|
|00001090| 46 5f 46 49 4c 45 0a 69 | 66 20 74 65 73 74 20 32 |F_FILE.i|f test 2|
|000010a0| 31 31 38 20 2d 6e 65 20 | 60 77 63 20 2d 63 20 3c |118 -ne |`wc -c <|
|000010b0| 27 52 45 41 44 4d 45 27 | 60 3b 20 74 68 65 6e 0a |'README'|`; then.|
|000010c0| 20 20 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 5c | echo| shar: \|
|000010d0| 22 27 52 45 41 44 4d 45 | 27 5c 22 20 75 6e 70 61 |"'README|'\" unpa|
|000010e0| 63 6b 65 64 20 77 69 74 | 68 20 77 72 6f 6e 67 20 |cked wit|h wrong |
|000010f0| 73 69 7a 65 21 0a 66 69 | 0a 23 20 65 6e 64 20 6f |size!.fi|.# end o|
|00001100| 66 20 27 52 45 41 44 4d | 45 27 0a 66 69 0a 69 66 |f 'READM|E'.fi.if|
|00001110| 20 74 65 73 74 20 2d 66 | 20 27 74 70 69 70 65 2e | test -f| 'tpipe.|
|00001120| 31 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |1' -a "$|{1}" != |
|00001130| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00001140| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|00001150| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|00001160| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 74 70 69 70 |ing file| \"'tpip|
|00001170| 65 2e 31 27 5c 22 0a 65 | 6c 73 65 0a 65 63 68 6f |e.1'\".e|lse.echo|
|00001180| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|00001190| 67 20 5c 22 27 74 70 69 | 70 65 2e 31 27 5c 22 20 |g \"'tpi|pe.1'\" |
|000011a0| 5c 28 32 34 36 35 20 63 | 68 61 72 61 63 74 65 72 |\(2465 c|haracter|
|000011b0| 73 5c 29 0a 73 65 64 20 | 22 73 2f 5e 58 2f 2f 22 |s\).sed |"s/^X//"|
|000011c0| 20 3e 27 74 70 69 70 65 | 2e 31 27 20 3c 3c 27 45 | >'tpipe|.1' <<'E|
|000011d0| 4e 44 5f 4f 46 5f 46 49 | 4c 45 27 0a 58 2e 54 48 |ND_OF_FI|LE'.X.TH|
|000011e0| 20 54 50 49 50 45 20 31 | 20 20 22 32 39 20 4a 61 | TPIPE 1| "29 Ja|
|000011f0| 6e 75 61 72 79 20 31 39 | 39 30 22 0a 58 2e 5c 22 |nuary 19|90".X.\"|
|00001200| 20 40 28 23 29 74 70 69 | 70 65 2e 31 20 31 2e 30 | @(#)tpi|pe.1 1.0|
|00001210| 20 39 30 2f 30 31 2f 32 | 39 3b 20 44 61 76 69 64 | 90/01/2|9; David|
|00001220| 20 42 20 52 6f 73 65 6e | 20 28 72 6f 73 65 6e 40 | B Rosen| (rosen@|
|00001230| 62 75 63 61 73 62 2e 62 | 75 2e 65 64 75 29 0a 58 |bucasb.b|u.edu).X|
|00001240| 2e 53 48 20 4e 41 4d 45 | 0a 58 74 70 69 70 65 20 |.SH NAME|.Xtpipe |
|00001250| 5c 2d 20 72 65 70 6c 69 | 63 61 74 65 20 74 68 65 |\- repli|cate the|
|00001260| 20 73 74 61 6e 64 61 72 | 64 20 6f 75 74 70 75 74 | standar|d output|
|00001270| 20 69 6e 74 6f 20 61 6e | 20 61 64 64 69 74 69 6f | into an| additio|
|00001280| 6e 61 6c 20 70 69 70 65 | 6c 69 6e 65 0a 58 74 68 |nal pipe|line.Xth|
|00001290| 61 74 20 69 73 20 72 75 | 6e 20 69 6e 20 61 20 73 |at is ru|n in a s|
|000012a0| 75 62 73 68 65 6c 6c 0a | 58 2e 53 48 20 53 59 4e |ubshell.|X.SH SYN|
|000012b0| 4f 50 53 49 53 0a 58 2e | 42 20 74 70 69 70 65 0a |OPSIS.X.|B tpipe.|
|000012c0| 58 5b 0a 58 2e 49 20 70 | 69 70 65 6c 69 6e 65 0a |X[.X.I p|ipeline.|
|000012d0| 58 5d 0a 58 2e 49 58 20 | 20 22 74 70 69 70 65 20 |X].X.IX | "tpipe |
|000012e0| 63 6f 6d 6d 61 6e 64 22 | 20 20 22 22 20 20 22 5c |command"| "" "\|
|000012f0| 66 4c 74 70 69 70 65 5c | 66 50 20 5c 28 65 6d 20 |fLtpipe\|fP \(em |
|00001300| 63 6f 70 79 20 73 74 61 | 6e 64 61 72 64 20 6f 75 |copy sta|ndard ou|
|00001310| 74 70 75 74 20 74 6f 20 | 6d 61 6e 79 20 70 69 70 |tput to |many pip|
|00001320| 65 6c 69 6e 65 73 22 0a | 58 2e 49 58 20 20 22 63 |elines".|X.IX "c|
|00001330| 6f 70 79 22 20 22 73 74 | 61 6e 64 61 72 64 20 6f |opy" "st|andard o|
|00001340| 75 74 70 75 74 20 74 6f | 20 6d 61 6e 79 20 70 69 |utput to| many pi|
|00001350| 70 65 6c 69 6e 65 73 20 | 5c 28 65 6d 20 5c 66 4c |pelines |\(em \fL|
|00001360| 74 70 69 70 65 5c 66 50 | 22 0a 58 2e 49 58 20 20 |tpipe\fP|".X.IX |
|00001370| 22 73 74 61 6e 64 61 72 | 64 20 6f 75 74 70 75 74 |"standar|d output|
|00001380| 22 20 20 22 63 6f 70 79 | 20 74 6f 20 6d 61 6e 79 |" "copy| to many|
|00001390| 20 70 69 70 65 6c 69 6e | 65 73 22 20 20 22 22 20 | pipelin|es" "" |
|000013a0| 20 22 63 6f 70 79 20 74 | 6f 20 6d 61 6e 79 20 70 | "copy t|o many p|
|000013b0| 69 70 65 6c 69 6e 65 73 | 20 5c 28 65 6d 20 5c 66 |ipelines| \(em \f|
|000013c0| 4c 74 70 69 70 65 5c 66 | 50 22 0a 58 2e 49 58 20 |Ltpipe\f|P".X.IX |
|000013d0| 20 70 69 70 65 6c 69 6e | 65 73 20 20 22 63 6f 70 | pipelin|es "cop|
|000013e0| 79 20 73 74 61 6e 64 61 | 72 64 20 6f 75 74 70 75 |y standa|rd outpu|
|000013f0| 74 20 74 6f 20 6d 61 6e | 79 22 20 20 22 22 20 20 |t to man|y" "" |
|00001400| 22 63 6f 70 79 20 73 74 | 61 6e 64 61 72 64 20 6f |"copy st|andard o|
|00001410| 75 74 70 75 74 20 74 6f | 20 6d 61 6e 79 20 5c 28 |utput to| many \(|
|00001420| 65 6d 20 5c 66 4c 74 70 | 69 70 65 5c 66 50 22 0a |em \fLtp|ipe\fP".|
|00001430| 58 2e 53 48 20 44 45 53 | 43 52 49 50 54 49 4f 4e |X.SH DES|CRIPTION|
|00001440| 0a 58 2e 42 20 74 70 69 | 70 65 0a 58 74 72 61 6e |.X.B tpi|pe.Xtran|
|00001450| 73 63 72 69 62 65 73 20 | 74 68 65 20 73 74 61 6e |scribes |the stan|
|00001460| 64 61 72 64 20 69 6e 70 | 75 74 20 74 6f 20 74 68 |dard inp|ut to th|
|00001470| 65 0a 58 73 74 61 6e 64 | 61 72 64 20 6f 75 74 70 |e.Xstand|ard outp|
|00001480| 75 74 20 61 6e 64 20 73 | 69 6d 75 6c 74 61 6e 65 |ut and s|imultane|
|00001490| 6f 75 73 6c 79 20 77 72 | 69 74 65 73 20 61 6e 20 |ously wr|ites an |
|000014a0| 61 64 64 69 74 69 6f 6e | 61 6c 20 63 6f 70 79 20 |addition|al copy |
|000014b0| 74 6f 0a 58 61 20 73 70 | 65 63 69 66 69 65 64 0a |to.Xa sp|ecified.|
|000014c0| 58 2e 49 52 20 70 69 70 | 65 6c 69 6e 65 20 2e 0a |X.IR pip|eline ..|
|000014d0| 58 2e 50 50 0a 58 74 70 | 69 70 65 20 69 73 20 73 |X.PP.Xtp|ipe is s|
|000014e0| 69 6d 69 6c 61 72 20 74 | 6f 20 74 65 65 28 31 29 |imilar t|o tee(1)|
|000014f0| 20 65 78 63 65 70 74 20 | 74 68 61 74 20 74 70 69 | except |that tpi|
|00001500| 70 65 20 77 72 69 74 65 | 73 20 74 68 65 20 64 75 |pe write|s the du|
|00001510| 70 6c 69 63 61 74 65 20 | 63 6f 70 79 0a 58 6f 66 |plicate |copy.Xof|
|00001520| 20 69 74 73 20 73 74 61 | 6e 64 61 72 64 20 69 6e | its sta|ndard in|
|00001530| 70 75 74 20 74 6f 20 61 | 20 63 6f 6d 6d 61 6e 64 |put to a| command|
|00001540| 20 6f 72 20 70 69 70 65 | 6c 69 6e 65 20 69 6e 73 | or pipe|line ins|
|00001550| 74 65 61 64 20 6f 66 20 | 61 20 66 69 6c 65 2e 20 |tead of |a file. |
|00001560| 54 68 69 73 0a 58 63 61 | 6e 20 68 65 6c 70 20 79 |This.Xca|n help y|
|00001570| 6f 75 20 61 76 6f 69 64 | 20 72 65 2d 65 78 65 63 |ou avoid| re-exec|
|00001580| 75 74 69 6e 67 20 65 61 | 72 6c 69 65 72 20 63 6f |uting ea|rlier co|
|00001590| 6d 6d 61 6e 64 73 20 69 | 6e 20 74 68 65 20 70 69 |mmands i|n the pi|
|000015a0| 70 65 6c 69 6e 65 2c 0a | 58 77 72 69 74 69 6e 67 |peline,.|Xwriting|
|000015b0| 20 74 65 6d 70 6f 72 61 | 72 79 20 66 69 6c 65 73 | tempora|ry files|
|000015c0| 2c 20 6f 72 20 72 65 73 | 6f 72 74 69 6e 67 20 74 |, or res|orting t|
|000015d0| 6f 20 74 68 65 20 75 73 | 65 20 6f 66 20 6e 61 6d |o the us|e of nam|
|000015e0| 65 64 20 70 69 70 65 73 | 2e 0a 58 2e 50 50 0a 58 |ed pipes|..X.PP.X|
|000015f0| 54 68 65 20 73 70 65 63 | 69 66 69 65 64 0a 58 2e |The spec|ified.X.|
|00001600| 49 52 20 70 69 70 65 6c | 69 6e 65 0a 58 69 73 20 |IR pipel|ine.Xis |
|00001610| 61 6c 77 61 79 73 20 65 | 78 65 63 75 74 65 64 20 |always e|xecuted |
|00001620| 69 6e 20 61 20 73 75 62 | 73 68 65 6c 6c 20 62 79 |in a sub|shell by|
|00001630| 20 73 68 28 31 29 2c 20 | 72 65 67 61 72 64 6c 65 | sh(1), |regardle|
|00001640| 73 73 20 6f 66 20 79 6f | 75 72 20 63 75 72 72 65 |ss of yo|ur curre|
|00001650| 6e 74 0a 58 73 68 65 6c | 6c 2e 20 20 49 66 20 61 |nt.Xshel|l. If a|
|00001660| 20 6e 6f 6e 2d 65 6d 70 | 74 79 20 73 74 72 69 6e | non-emp|ty strin|
|00001670| 67 20 69 73 20 73 75 70 | 70 6c 69 65 64 20 61 73 |g is sup|plied as|
|00001680| 20 74 68 65 20 61 72 67 | 75 6d 65 6e 74 2c 20 69 | the arg|ument, i|
|00001690| 74 20 6d 75 73 74 20 62 | 65 20 0a 58 61 20 76 61 |t must b|e .Xa va|
|000016a0| 6c 69 64 20 70 69 70 65 | 6c 69 6e 65 20 6f 72 20 |lid pipe|line or |
|000016b0| 63 6f 6d 6d 61 6e 64 20 | 66 6f 72 20 73 68 28 31 |command |for sh(1|
|000016c0| 29 2e 20 4e 6f 72 6d 61 | 6c 6c 79 2c 20 79 6f 75 |). Norma|lly, you|
|000016d0| 20 77 69 6c 6c 20 77 61 | 6e 74 20 74 6f 20 65 6e | will wa|nt to en|
|000016e0| 63 6c 6f 73 65 0a 58 74 | 68 65 0a 58 2e 49 52 20 |close.Xt|he.X.IR |
|000016f0| 70 69 70 65 6c 69 6e 65 | 0a 58 61 72 67 75 6d 65 |pipeline|.Xargume|
|00001700| 6e 74 20 69 6e 20 71 75 | 6f 74 65 73 20 28 27 27 |nt in qu|otes (''|
|00001710| 20 6f 72 20 22 22 29 2e | 20 20 54 68 65 20 74 79 | or "").| The ty|
|00001720| 70 65 20 6f 66 20 71 75 | 6f 74 65 73 20 79 6f 75 |pe of qu|otes you|
|00001730| 20 63 68 6f 6f 73 65 0a | 58 77 69 6c 6c 20 61 66 | choose.|Xwill af|
|00001740| 66 65 63 74 20 76 61 72 | 69 61 62 6c 65 20 73 75 |fect var|iable su|
|00001750| 62 73 74 69 74 75 74 69 | 6f 6e 20 62 79 20 79 6f |bstituti|on by yo|
|00001760| 75 72 20 73 68 65 6c 6c | 20 28 73 65 65 20 74 68 |ur shell| (see th|
|00001770| 65 20 6d 61 6e 20 70 61 | 67 65 20 0a 58 66 6f 72 |e man pa|ge .Xfor|
|00001780| 20 79 6f 75 72 20 73 68 | 65 6c 6c 2c 20 73 75 63 | your sh|ell, suc|
|00001790| 68 20 61 73 20 63 73 68 | 28 31 29 2c 20 66 6f 72 |h as csh|(1), for|
|000017a0| 20 64 65 74 61 69 6c 73 | 29 2e 0a 58 2e 50 50 0a | details|)..X.PP.|
|000017b0| 58 49 66 20 74 68 65 20 | 73 75 62 73 68 65 6c 6c |XIf the |subshell|
|000017c0| 20 70 69 70 65 6c 69 6e | 65 20 77 72 69 74 65 73 | pipelin|e writes|
|000017d0| 20 74 6f 20 69 74 73 20 | 73 74 61 6e 64 61 72 64 | to its |standard|
|000017e0| 20 6f 75 74 70 75 74 2c | 20 74 68 69 73 20 6f 75 | output,| this ou|
|000017f0| 74 70 75 74 0a 58 77 69 | 6c 6c 20 67 6f 20 74 6f |tput.Xwi|ll go to|
|00001800| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 6f 75 | the sta|ndard ou|
|00001810| 74 70 75 74 20 6f 66 20 | 74 70 69 70 65 2c 20 77 |tput of |tpipe, w|
|00001820| 68 65 72 65 20 69 74 20 | 77 69 6c 6c 20 62 65 20 |here it |will be |
|00001830| 69 6e 74 65 72 73 70 65 | 72 73 65 64 0a 58 69 6e |interspe|rsed.Xin|
|00001840| 20 61 6e 20 75 6e 70 72 | 65 64 69 63 74 61 62 6c | an unpr|edictabl|
|00001850| 65 20 77 61 79 20 77 69 | 74 68 20 74 68 65 20 6f |e way wi|th the o|
|00001860| 74 68 65 72 20 63 6f 70 | 79 20 6f 66 20 73 74 61 |ther cop|y of sta|
|00001870| 6e 64 61 72 64 20 69 6e | 70 75 74 2e 0a 58 4e 6f |ndard in|put..XNo|
|00001880| 72 6d 61 6c 6c 79 2c 20 | 74 68 69 73 20 69 73 20 |rmally, |this is |
|00001890| 6e 6f 74 20 77 68 61 74 | 20 79 6f 75 20 77 61 6e |not what| you wan|
|000018a0| 74 2e 20 49 6e 73 74 65 | 61 64 2c 20 79 6f 75 20 |t. Inste|ad, you |
|000018b0| 77 6f 75 6c 64 20 74 79 | 70 69 63 61 6c 6c 79 0a |would ty|pically.|
|000018c0| 58 73 70 65 63 69 66 79 | 20 61 20 73 75 62 73 68 |Xspecify| a subsh|
|000018d0| 65 6c 6c 0a 58 2e 49 52 | 20 70 69 70 65 6c 69 6e |ell.X.IR| pipelin|
|000018e0| 65 20 0a 58 77 68 6f 73 | 65 20 6f 75 74 70 75 74 |e .Xwhos|e output|
|000018f0| 20 69 73 20 72 65 64 69 | 72 65 63 74 65 64 20 74 | is redi|rected t|
|00001900| 6f 20 61 20 66 69 6c 65 | 20 28 61 73 20 69 6e 20 |o a file| (as in |
|00001910| 74 68 65 20 65 78 61 6d | 70 6c 65 0a 58 62 65 6c |the exam|ple.Xbel|
|00001920| 6f 77 29 20 6f 72 20 68 | 61 73 20 73 6f 6d 65 20 |ow) or h|as some |
|00001930| 6f 74 68 65 72 20 65 66 | 66 65 63 74 2e 0a 58 2e |other ef|fect..X.|
|00001940| 53 48 20 45 58 41 4d 50 | 4c 45 0a 58 2e 49 50 0a |SH EXAMP|LE.X.IP.|
|00001950| 58 25 20 63 6d 64 31 20 | 3c 69 6e 66 69 6c 65 20 |X% cmd1 |<infile |
|00001960| 7c 20 74 70 69 70 65 20 | 22 63 6d 64 32 20 7c 20 || tpipe |"cmd2 | |
|00001970| 63 6d 64 33 20 3e 6f 75 | 74 66 69 6c 65 22 20 7c |cmd3 >ou|tfile" ||
|00001980| 20 63 6d 64 34 20 0a 58 | 2e 50 50 0a 58 77 68 69 | cmd4 .X|.PP.Xwhi|
|00001990| 63 68 20 68 61 73 20 74 | 68 65 20 65 66 66 65 63 |ch has t|he effec|
|000019a0| 74 20 6f 66 20 72 75 6e | 6e 69 6e 67 20 74 68 65 |t of run|ning the|
|000019b0| 20 6f 75 74 70 75 74 20 | 6f 66 20 63 6f 6d 6d 61 | output |of comma|
|000019c0| 6e 64 20 63 6d 64 31 0a | 58 73 69 6d 75 6c 74 61 |nd cmd1.|Xsimulta|
|000019d0| 6e 65 6f 75 73 6c 79 20 | 74 68 72 6f 75 67 68 20 |neously |through |
|000019e0| 74 77 6f 20 70 69 70 65 | 6c 69 6e 65 73 2c 20 22 |two pipe|lines, "|
|000019f0| 63 6d 64 32 20 7c 20 63 | 6d 64 33 20 3e 6f 75 74 |cmd2 | c|md3 >out|
|00001a00| 66 69 6c 65 22 20 61 6e | 64 20 63 6d 64 34 2e 0a |file" an|d cmd4..|
|00001a10| 58 44 69 61 67 72 61 6d | 61 74 69 63 61 6c 6c 79 |XDiagram|atically|
|00001a20| 2c 20 69 6e 20 74 68 69 | 73 20 65 78 61 6d 70 6c |, in thi|s exampl|
|00001a30| 65 20 28 74 68 69 73 20 | 77 69 6c 6c 20 6c 6f 6f |e (this |will loo|
|00001a40| 6b 20 77 72 6f 6e 67 20 | 77 69 74 68 0a 58 61 20 |k wrong |with.Xa |
|00001a50| 76 61 72 69 61 62 6c 65 | 2d 73 70 61 63 65 64 20 |variable|-spaced |
|00001a60| 66 6f 6e 74 29 3a 0a 58 | 0a 58 2e 6e 66 0a 58 20 |font):.X|.X.nf.X |
|00001a70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a80| 20 20 20 20 2d 2d 3e 20 | 63 6d 64 32 20 2d 2d 3e | --> |cmd2 -->|
|00001a90| 20 63 6d 64 33 20 2d 2d | 3e 20 6f 75 74 66 69 6c | cmd3 --|> outfil|
|00001aa0| 65 0a 58 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e.X | |
|00001ab0| 20 20 20 20 20 20 2f 0a | 58 69 6e 66 69 6c 65 20 | /.|Xinfile |
|00001ac0| 20 2d 2d 3e 20 63 6d 64 | 31 20 2d 3c 0a 58 20 20 | --> cmd|1 -<.X |
|00001ad0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001ae0| 20 5c 5c 0a 58 20 20 20 | 20 20 20 20 20 20 20 20 | \\.X | |
|00001af0| 20 20 20 20 20 20 20 20 | 20 20 2d 2d 3e 20 63 6d | | --> cm|
|00001b00| 64 34 20 2d 2d 3e 20 20 | 28 73 74 61 6e 64 61 72 |d4 --> |(standar|
|00001b10| 64 20 6f 75 74 70 75 74 | 29 0a 58 2e 66 69 0a 58 |d output|).X.fi.X|
|00001b20| 2e 53 48 20 53 45 45 20 | 41 4c 53 4f 0a 58 2e 42 |.SH SEE |ALSO.X.B|
|00001b30| 52 20 74 65 65 20 28 31 | 29 2c 0a 58 2e 42 52 20 |R tee (1|),.X.BR |
|00001b40| 73 68 20 28 31 29 2c 0a | 58 2e 42 52 20 63 61 74 |sh (1),.|X.BR cat|
|00001b50| 20 28 31 29 0a 58 0a 58 | 2e 53 48 20 41 55 54 48 | (1).X.X|.SH AUTH|
|00001b60| 4f 52 0a 58 44 61 76 69 | 64 20 42 20 52 6f 73 65 |OR.XDavi|d B Rose|
|00001b70| 6e 0a 58 2e 50 50 0a 58 | 54 48 49 53 20 53 4f 46 |n.X.PP.X|THIS SOF|
|00001b80| 54 57 41 52 45 20 49 53 | 20 50 52 4f 56 49 44 45 |TWARE IS| PROVIDE|
|00001b90| 44 20 22 41 53 20 49 53 | 22 20 41 4e 44 20 57 49 |D "AS IS|" AND WI|
|00001ba0| 54 48 4f 55 54 20 45 58 | 50 52 45 53 53 20 4f 52 |THOUT EX|PRESS OR|
|00001bb0| 20 49 4d 50 4c 49 45 44 | 20 57 41 52 52 41 4e 54 | IMPLIED| WARRANT|
|00001bc0| 59 2e 0a 45 4e 44 5f 4f | 46 5f 46 49 4c 45 0a 69 |Y..END_O|F_FILE.i|
|00001bd0| 66 20 74 65 73 74 20 32 | 34 36 35 20 2d 6e 65 20 |f test 2|465 -ne |
|00001be0| 60 77 63 20 2d 63 20 3c | 27 74 70 69 70 65 2e 31 |`wc -c <|'tpipe.1|
|00001bf0| 27 60 3b 20 74 68 65 6e | 0a 20 20 20 20 65 63 68 |'`; then|. ech|
|00001c00| 6f 20 73 68 61 72 3a 20 | 5c 22 27 74 70 69 70 65 |o shar: |\"'tpipe|
|00001c10| 2e 31 27 5c 22 20 75 6e | 70 61 63 6b 65 64 20 77 |.1'\" un|packed w|
|00001c20| 69 74 68 20 77 72 6f 6e | 67 20 73 69 7a 65 21 0a |ith wron|g size!.|
|00001c30| 66 69 0a 23 20 65 6e 64 | 20 6f 66 20 27 74 70 69 |fi.# end| of 'tpi|
|00001c40| 70 65 2e 31 27 0a 66 69 | 0a 69 66 20 74 65 73 74 |pe.1'.fi|.if test|
|00001c50| 20 2d 66 20 27 74 70 69 | 70 65 2e 63 27 20 2d 61 | -f 'tpi|pe.c' -a|
|00001c60| 20 22 24 7b 31 7d 22 20 | 21 3d 20 22 2d 63 22 20 | "${1}" |!= "-c" |
|00001c70| 3b 20 74 68 65 6e 20 0a | 20 20 65 63 68 6f 20 73 |; then .| echo s|
|00001c80| 68 61 72 3a 20 57 69 6c | 6c 20 6e 6f 74 20 63 6c |har: Wil|l not cl|
|00001c90| 6f 62 62 65 72 20 65 78 | 69 73 74 69 6e 67 20 66 |obber ex|isting f|
|00001ca0| 69 6c 65 20 5c 22 27 74 | 70 69 70 65 2e 63 27 5c |ile \"'t|pipe.c'\|
|00001cb0| 22 0a 65 6c 73 65 0a 65 | 63 68 6f 20 73 68 61 72 |".else.e|cho shar|
|00001cc0| 3a 20 45 78 74 72 61 63 | 74 69 6e 67 20 5c 22 27 |: Extrac|ting \"'|
|00001cd0| 74 70 69 70 65 2e 63 27 | 5c 22 20 5c 28 31 36 30 |tpipe.c'|\" \(160|
|00001ce0| 33 20 63 68 61 72 61 63 | 74 65 72 73 5c 29 0a 73 |3 charac|ters\).s|
|00001cf0| 65 64 20 22 73 2f 5e 58 | 2f 2f 22 20 3e 27 74 70 |ed "s/^X|//" >'tp|
|00001d00| 69 70 65 2e 63 27 20 3c | 3c 27 45 4e 44 5f 4f 46 |ipe.c' <|<'END_OF|
|00001d10| 5f 46 49 4c 45 27 0a 58 | 2f 2a 20 74 70 69 70 65 |_FILE'.X|/* tpipe|
|00001d20| 2e 63 20 2d 2d 20 74 65 | 65 20 61 20 70 69 70 65 |.c -- te|e a pipe|
|00001d30| 6c 69 6e 65 20 69 6e 74 | 6f 20 74 77 6f 20 70 69 |line int|o two pi|
|00001d40| 70 65 6c 69 6e 65 73 2e | 20 4c 69 6b 65 20 74 65 |pelines.| Like te|
|00001d50| 65 28 31 29 20 62 75 74 | 20 0a 58 20 20 20 61 72 |e(1) but| .X ar|
|00001d60| 67 75 6d 65 6e 74 20 69 | 73 20 61 20 63 6f 6d 6d |gument i|s a comm|
|00001d70| 61 6e 64 20 6f 72 20 70 | 69 70 65 6c 69 6e 65 20 |and or p|ipeline |
|00001d80| 72 61 74 68 65 72 20 74 | 68 61 6e 20 61 20 66 69 |rather t|han a fi|
|00001d90| 6c 65 2e 0a 58 0a 58 20 | 20 20 53 65 65 20 74 68 |le..X.X | See th|
|00001da0| 65 20 6d 61 6e 20 70 61 | 67 65 20 74 70 69 70 65 |e man pa|ge tpipe|
|00001db0| 28 31 29 20 73 75 70 70 | 6c 69 65 64 20 77 69 74 |(1) supp|lied wit|
|00001dc0| 68 20 74 68 69 73 20 73 | 6f 66 74 77 61 72 65 2e |h this s|oftware.|
|00001dd0| 0a 58 0a 58 20 20 20 54 | 68 69 73 20 76 65 72 73 |.X.X T|his vers|
|00001de0| 69 6f 6e 20 75 73 65 73 | 20 74 68 65 20 75 6e 69 |ion uses| the uni|
|00001df0| 78 20 73 79 73 74 65 6d | 20 63 61 6c 6c 73 20 70 |x system| calls p|
|00001e00| 6f 70 65 6e 28 33 29 2c | 20 72 65 61 64 28 32 29 |open(3),| read(2)|
|00001e10| 2c 20 61 6e 64 0a 58 20 | 20 20 77 72 69 74 65 28 |, and.X | write(|
|00001e20| 32 29 2e 20 20 49 74 20 | 75 73 65 73 20 77 72 69 |2). It |uses wri|
|00001e30| 74 65 28 32 29 20 74 6f | 20 77 72 69 74 65 20 64 |te(2) to| write d|
|00001e40| 69 72 65 63 74 6c 79 20 | 74 6f 20 74 68 65 20 66 |irectly |to the f|
|00001e50| 69 6c 65 6e 6f 28 29 20 | 6f 66 0a 58 20 20 20 6f |ileno() |of.X o|
|00001e60| 66 20 74 68 65 20 66 69 | 6c 65 20 70 6f 69 6e 74 |f the fi|le point|
|00001e70| 65 72 20 73 74 72 65 61 | 6d 20 72 65 74 75 72 6e |er strea|m return|
|00001e80| 65 64 20 62 79 20 70 6f | 70 65 6e 2e 0a 58 0a 58 |ed by po|pen..X.X|
|00001e90| 20 20 20 49 27 76 65 20 | 74 72 69 65 64 20 69 74 | I've |tried it|
|00001ea0| 20 6f 75 74 20 75 6e 64 | 65 72 20 42 53 44 2c 20 | out und|er BSD, |
|00001eb0| 53 79 73 74 65 6d 20 56 | 2c 20 61 6e 64 20 61 6e |System V|, and an|
|00001ec0| 20 6f 6c 64 65 72 20 76 | 65 72 73 69 6f 6e 20 6f | older v|ersion o|
|00001ed0| 66 20 75 6e 69 78 2c 0a | 58 20 20 20 62 75 74 3a |f unix,.|X but:|
|00001ee0| 0a 58 0a 58 20 20 20 54 | 48 49 53 20 53 4f 46 54 |.X.X T|HIS SOFT|
|00001ef0| 57 41 52 45 20 49 53 20 | 50 52 4f 56 49 44 45 44 |WARE IS |PROVIDED|
|00001f00| 20 22 41 53 20 49 53 22 | 20 41 4e 44 20 57 49 54 | "AS IS"| AND WIT|
|00001f10| 48 4f 55 54 20 45 58 50 | 52 45 53 53 20 4f 52 20 |HOUT EXP|RESS OR |
|00001f20| 49 4d 50 4c 49 45 44 20 | 0a 58 20 20 20 57 41 52 |IMPLIED |.X WAR|
|00001f30| 52 41 4e 54 59 2e 0a 58 | 0a 58 20 20 20 56 65 72 |RANTY..X|.X Ver|
|00001f40| 73 69 6f 6e 20 31 2e 30 | 32 20 28 34 20 4d 61 72 |sion 1.0|2 (4 Mar|
|00001f50| 20 31 39 38 39 29 20 28 | 55 73 65 20 66 69 6c 65 | 1989) (|Use file|
|00001f60| 6e 6f 28 29 29 0a 58 0a | 58 2d 2d 0a 58 44 61 76 |no()).X.|X--.XDav|
|00001f70| 69 64 20 42 20 52 6f 73 | 65 6e 2c 20 43 6f 67 6e |id B Ros|en, Cogn|
|00001f80| 69 74 69 76 65 20 26 20 | 4e 65 75 72 61 6c 20 53 |itive & |Neural S|
|00001f90| 79 73 74 65 6d 73 20 20 | 20 20 20 20 20 20 20 20 |ystems | |
|00001fa0| 20 20 20 20 20 20 20 20 | 72 6f 73 65 6e 40 62 75 | |rosen@bu|
|00001fb0| 63 61 73 62 2e 62 75 2e | 65 64 75 0a 58 43 65 6e |casb.bu.|edu.XCen|
|00001fc0| 74 65 72 20 66 6f 72 20 | 41 64 61 70 74 69 76 65 |ter for |Adaptive|
|00001fd0| 20 53 79 73 74 65 6d 73 | 20 20 20 20 20 20 20 20 | Systems| |
|00001fe0| 20 20 20 20 20 20 20 20 | 20 72 6f 73 65 6e 25 62 | | rosen%b|
|00001ff0| 75 63 61 73 62 40 7b 62 | 75 61 63 63 61 2c 62 75 |ucasb@{b|uacca,bu|
|00002000| 2d 69 74 7d 2e 62 75 2e | 65 64 75 0a 58 42 6f 73 |-it}.bu.|edu.XBos|
|00002010| 74 6f 6e 20 55 6e 69 76 | 65 72 73 69 74 79 20 20 |ton Univ|ersity |
|00002020| 20 20 20 20 20 20 20 20 | 20 20 20 20 7b 6d 69 74 | | {mit|
|00002030| 2d 65 64 64 69 65 2c 68 | 61 72 76 61 72 64 2c 75 |-eddie,h|arvard,u|
|00002040| 75 6e 65 74 7d 21 62 75 | 2e 65 64 75 21 74 68 61 |unet}!bu|.edu!tha|
|00002050| 6c 61 6d 75 73 21 72 6f | 73 65 6e 0a 58 0a 58 2a |lamus!ro|sen.X.X*|
|00002060| 2f 0a 58 0a 58 23 69 6e | 63 6c 75 64 65 20 3c 73 |/.X.X#in|clude <s|
|00002070| 74 64 69 6f 2e 68 3e 0a | 58 0a 58 2f 2a 23 64 65 |tdio.h>.|X.X/*#de|
|00002080| 66 69 6e 65 20 4e 4f 48 | 41 43 4b 2a 2f 0a 58 0a |fine NOH|ACK*/.X.|
|00002090| 58 23 69 66 6e 64 65 66 | 20 42 55 46 53 49 5a 0a |X#ifndef| BUFSIZ.|
|000020a0| 58 23 64 65 66 69 6e 65 | 20 42 55 46 53 49 5a 20 |X#define| BUFSIZ |
|000020b0| 32 30 34 38 0a 58 23 65 | 6e 64 69 66 20 2f 2a 42 |2048.X#e|ndif /*B|
|000020c0| 55 46 53 49 5a 2a 2f 0a | 58 0a 58 69 6e 74 20 6d |UFSIZ*/.|X.Xint m|
|000020d0| 61 69 6e 28 61 72 67 63 | 2c 20 61 72 67 76 29 0a |ain(argc|, argv).|
|000020e0| 58 20 20 20 20 20 69 6e | 74 20 61 72 67 63 3b 0a |X in|t argc;.|
|000020f0| 58 20 20 20 20 20 63 68 | 61 72 20 2a 61 72 67 76 |X ch|ar *argv|
|00002100| 5b 5d 3b 0a 58 7b 0a 58 | 20 20 63 68 61 72 20 62 |[];.X{.X| char b|
|00002110| 75 66 5b 42 55 46 53 49 | 5a 5d 3b 0a 58 20 20 72 |uf[BUFSI|Z];.X r|
|00002120| 65 67 69 73 74 65 72 20 | 46 49 4c 45 20 2a 73 75 |egister |FILE *su|
|00002130| 62 70 69 70 65 6c 69 6e | 65 20 3d 20 4e 55 4c 4c |bpipelin|e = NULL|
|00002140| 3b 0a 58 20 20 72 65 67 | 69 73 74 65 72 20 75 6e |;.X reg|ister un|
|00002150| 73 69 67 6e 65 64 20 6e | 3b 0a 58 0a 58 20 20 69 |signed n|;.X.X i|
|00002160| 66 20 28 61 72 67 63 20 | 3d 3d 20 32 29 7b 0a 58 |f (argc |== 2){.X|
|00002170| 20 20 20 20 69 66 20 28 | 2a 61 72 67 76 5b 31 5d | if (|*argv[1]|
|00002180| 29 20 7b 0a 58 20 20 20 | 20 20 20 69 66 20 28 28 |) {.X | if ((|
|00002190| 73 75 62 70 69 70 65 6c | 69 6e 65 20 3d 20 70 6f |subpipel|ine = po|
|000021a0| 70 65 6e 28 61 72 67 76 | 5b 31 5d 2c 22 77 22 29 |pen(argv|[1],"w")|
|000021b0| 29 20 3d 3d 20 4e 55 4c | 4c 29 20 7b 0a 58 09 66 |) == NUL|L) {.X.f|
|000021c0| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 20 22 |printf(s|tderr, "|
|000021d0| 25 73 3a 20 63 61 6e 27 | 74 20 63 72 65 61 74 65 |%s: can'|t create|
|000021e0| 20 73 75 62 70 69 70 65 | 6c 69 6e 65 20 25 73 5c | subpipe|line %s\|
|000021f0| 6e 22 2c 20 61 72 67 76 | 5b 30 5d 2c 20 61 72 67 |n", argv|[0], arg|
|00002200| 76 5b 31 5d 29 3b 0a 58 | 09 65 78 69 74 28 31 29 |v[1]);.X|.exit(1)|
|00002210| 3b 0a 58 20 20 20 20 20 | 20 7d 0a 58 20 20 20 20 |;.X | }.X |
|00002220| 7d 0a 58 20 20 7d 20 65 | 6c 73 65 20 69 66 20 28 |}.X } e|lse if (|
|00002230| 61 72 67 63 20 3e 20 32 | 29 20 7b 0a 58 20 20 20 |argc > 2|) {.X |
|00002240| 20 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c | fprintf|(stderr,|
|00002250| 20 22 75 73 61 67 65 3a | 20 25 73 20 5b 70 69 70 | "usage:| %s [pip|
|00002260| 65 6c 69 6e 65 5d 5c 6e | 22 2c 20 61 72 67 76 5b |eline]\n|", argv[|
|00002270| 30 5d 29 3b 0a 58 20 20 | 20 20 65 78 69 74 28 32 |0]);.X | exit(2|
|00002280| 29 3b 0a 58 20 20 7d 0a | 58 0a 58 20 20 77 68 69 |);.X }.|X.X whi|
|00002290| 6c 65 20 28 28 6e 20 3d | 20 72 65 61 64 28 30 2c |le ((n =| read(0,|
|000022a0| 20 62 75 66 2c 20 42 55 | 46 53 49 5a 29 29 20 3e | buf, BU|FSIZ)) >|
|000022b0| 20 30 29 20 7b 0a 58 20 | 20 20 20 77 72 69 74 65 | 0) {.X | write|
|000022c0| 28 31 2c 20 62 75 66 2c | 20 6e 29 3b 20 2f 2a 20 |(1, buf,| n); /* |
|000022d0| 77 72 69 74 65 20 74 6f | 20 73 74 61 6e 64 61 72 |write to| standar|
|000022e0| 64 20 6f 75 74 70 75 74 | 20 2a 2f 0a 58 20 20 20 |d output| */.X |
|000022f0| 20 69 66 20 28 73 75 62 | 70 69 70 65 6c 69 6e 65 | if (sub|pipeline|
|00002300| 29 20 7b 20 20 2f 2a 20 | 77 72 69 74 65 20 74 6f |) { /* |write to|
|00002310| 20 73 75 62 70 69 70 65 | 6c 69 6e 65 3a 20 2a 2f | subpipe|line: */|
|00002320| 0a 58 20 20 20 20 20 20 | 77 72 69 74 65 28 28 69 |.X |write((i|
|00002330| 6e 74 29 66 69 6c 65 6e | 6f 28 73 75 62 70 69 70 |nt)filen|o(subpip|
|00002340| 65 6c 69 6e 65 29 2c 20 | 62 75 66 2c 20 6e 29 3b |eline), |buf, n);|
|00002350| 0a 58 20 20 20 20 7d 0a | 58 20 20 7d 0a 58 0a 58 |.X }.|X }.X.X|
|00002360| 20 20 69 66 20 28 73 75 | 62 70 69 70 65 6c 69 6e | if (su|bpipelin|
|00002370| 65 29 20 70 63 6c 6f 73 | 65 28 73 75 62 70 69 70 |e) pclos|e(subpip|
|00002380| 65 6c 69 6e 65 29 3b 0a | 58 20 20 72 65 74 75 72 |eline);.|X retur|
|00002390| 6e 20 30 3b 0a 58 7d 0a | 45 4e 44 5f 4f 46 5f 46 |n 0;.X}.|END_OF_F|
|000023a0| 49 4c 45 0a 69 66 20 74 | 65 73 74 20 31 36 30 33 |ILE.if t|est 1603|
|000023b0| 20 2d 6e 65 20 60 77 63 | 20 2d 63 20 3c 27 74 70 | -ne `wc| -c <'tp|
|000023c0| 69 70 65 2e 63 27 60 3b | 20 74 68 65 6e 0a 20 20 |ipe.c'`;| then. |
|000023d0| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 5c 22 27 | echo s|har: \"'|
|000023e0| 74 70 69 70 65 2e 63 27 | 5c 22 20 75 6e 70 61 63 |tpipe.c'|\" unpac|
|000023f0| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|00002400| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|00002410| 20 27 74 70 69 70 65 2e | 63 27 0a 66 69 0a 65 63 | 'tpipe.|c'.fi.ec|
|00002420| 68 6f 20 73 68 61 72 3a | 20 45 6e 64 20 6f 66 20 |ho shar:| End of |
|00002430| 73 68 65 6c 6c 20 61 72 | 63 68 69 76 65 2e 0a 65 |shell ar|chive..e|
|00002440| 78 69 74 20 30 0a 65 78 | 69 74 20 30 20 23 20 4a |xit 0.ex|it 0 # J|
|00002450| 75 73 74 20 69 6e 20 63 | 61 73 65 2e 2e 2e 0a 2d |ust in c|ase....-|
|00002460| 2d 20 0a 50 6c 65 61 73 | 65 20 73 65 6e 64 20 63 |- .Pleas|e send c|
|00002470| 6f 6d 70 2e 73 6f 75 72 | 63 65 73 2e 75 6e 69 78 |omp.sour|ces.unix|
|00002480| 2d 72 65 6c 61 74 65 64 | 20 6d 61 69 6c 20 74 6f |-related| mail to|
|00002490| 20 72 73 61 6c 7a 40 75 | 75 6e 65 74 2e 75 75 2e | rsalz@u|unet.uu.|
|000024a0| 6e 65 74 2e 0a 55 73 65 | 20 61 20 64 6f 6d 61 69 |net..Use| a domai|
|000024b0| 6e 2d 62 61 73 65 64 20 | 61 64 64 72 65 73 73 20 |n-based |address |
|000024c0| 6f 72 20 67 69 76 65 20 | 61 6c 74 65 72 6e 61 74 |or give |alternat|
|000024d0| 65 20 70 61 74 68 73 2c | 20 6f 72 20 79 6f 75 20 |e paths,| or you |
|000024e0| 6d 61 79 20 6c 6f 73 65 | 20 6f 75 74 2e 0a |may lose| out.. |
+--------+-------------------------+-------------------------+--------+--------+