home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume21 / filterfile < prev    next >
SHell self-extracting ARchive  |  1990-02-05  |  18.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
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 or mail, ASCII text default
100% checkBytes Printable ASCII 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/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 53 75 62 6a 65 63 74 3a | 20 20 76 32 31 69 30 30 |Subject:| v21i00|
|00000010| 32 3a 20 20 41 70 70 6c | 79 20 61 20 66 69 6c 74 |2: Appl|y a filt|
|00000020| 65 72 20 74 6f 20 61 20 | 66 69 6c 65 2c 20 73 61 |er to a |file, sa|
|00000030| 66 65 6c 79 0a 4e 65 77 | 73 67 72 6f 75 70 73 3a |fely.New|sgroups:|
|00000040| 20 63 6f 6d 70 2e 73 6f | 75 72 63 65 73 2e 75 6e | comp.so|urces.un|
|00000050| 69 78 0a 53 65 6e 64 65 | 72 3a 20 73 6f 75 72 63 |ix.Sende|r: sourc|
|00000060| 65 73 0a 41 70 70 72 6f | 76 65 64 3a 20 72 73 61 |es.Appro|ved: rsa|
|00000070| 6c 7a 40 75 75 6e 65 74 | 2e 55 55 2e 4e 45 54 0a |lz@uunet|.UU.NET.|
|00000080| 0a 53 75 62 6d 69 74 74 | 65 64 2d 62 79 3a 20 44 |.Submitt|ed-by: D|
|00000090| 61 6e 20 42 65 72 6e 73 | 74 65 69 6e 20 3c 62 72 |an Berns|tein <br|
|000000a0| 6e 73 74 6e 64 40 73 74 | 65 61 6c 74 68 2e 61 63 |nstnd@st|ealth.ac|
|000000b0| 66 2e 6e 79 75 2e 65 64 | 75 3e 0a 50 6f 73 74 69 |f.nyu.ed|u>.Posti|
|000000c0| 6e 67 2d 6e 75 6d 62 65 | 72 3a 20 56 6f 6c 75 6d |ng-numbe|r: Volum|
|000000d0| 65 20 32 31 2c 20 49 73 | 73 75 65 20 32 0a 41 72 |e 21, Is|sue 2.Ar|
|000000e0| 63 68 69 76 65 2d 6e 61 | 6d 65 3a 20 66 69 6c 74 |chive-na|me: filt|
|000000f0| 65 72 66 69 6c 65 0a 0a | 5b 20 20 45 76 65 72 79 |erfile..|[ Every|
|00000100| 6f 6e 65 20 70 72 6f 62 | 61 62 6c 79 20 68 61 73 |one prob|ably has|
|00000110| 20 6f 6e 65 20 6f 66 20 | 74 68 65 73 65 20 69 6e | one of |these in|
|00000120| 20 74 68 65 69 72 20 74 | 6f 6f 6c 6b 69 74 2c 20 | their t|oolkit, |
|00000130| 61 6c 74 68 6f 75 67 68 | 20 6e 6f 74 0a 20 20 20 |although| not. |
|00000140| 77 69 74 68 20 73 75 63 | 68 20 65 78 74 65 6e 73 |with suc|h extens|
|00000150| 69 76 65 20 63 6f 70 79 | 72 69 67 68 74 2c 20 77 |ive copy|right, w|
|00000160| 61 72 72 61 6e 74 79 20 | 61 6e 64 20 76 65 72 73 |arranty |and vers|
|00000170| 69 6f 6e 20 6e 75 6d 62 | 65 72 73 3b 20 61 74 0a |ion numb|ers; at.|
|00000180| 20 20 20 61 6e 79 20 72 | 61 74 65 2c 20 69 74 27 | any r|ate, it'|
|00000190| 73 20 77 6f 72 74 68 20 | 68 61 76 69 6e 67 20 61 |s worth |having a|
|000001a0| 6e 20 61 72 63 68 69 76 | 65 64 20 6f 6e 65 2e 20 |n archiv|ed one. |
|000001b0| 20 2f 72 24 20 20 5d 0a | 0a 66 69 6c 74 65 72 66 | /r$ ].|.filterf|
|000001c0| 69 6c 65 20 61 70 70 6c | 69 65 73 20 61 20 66 69 |ile appl|ies a fi|
|000001d0| 6c 74 65 72 20 74 6f 20 | 61 20 66 69 6c 65 2c 20 |lter to |a file, |
|000001e0| 77 72 69 74 69 6e 67 20 | 74 68 65 20 72 65 73 75 |writing |the resu|
|000001f0| 6c 74 20 74 6f 20 61 6e | 6f 74 68 65 72 0a 66 69 |lt to an|other.fi|
|00000200| 6c 65 2e 20 20 56 61 72 | 69 6f 75 73 20 6f 70 74 |le. Var|ious opt|
|00000210| 69 6f 6e 73 20 6c 65 74 | 20 66 69 6c 74 65 72 66 |ions let| filterf|
|00000220| 69 6c 65 20 64 65 6c 65 | 74 65 20 74 68 65 20 69 |ile dele|te the i|
|00000230| 6e 70 75 74 20 66 69 6c | 65 2c 20 73 65 74 20 74 |nput fil|e, set t|
|00000240| 68 65 20 74 69 6d 65 73 | 0a 6f 66 20 74 68 65 20 |he times|.of the |
|00000250| 6f 75 74 70 75 74 20 74 | 6f 20 74 68 65 20 74 69 |output t|o the ti|
|00000260| 6d 65 73 20 6f 66 20 74 | 68 65 20 69 6e 70 75 74 |mes of t|he input|
|00000270| 2c 20 6f 72 20 73 65 74 | 20 74 68 65 20 70 72 6f |, or set| the pro|
|00000280| 74 65 63 74 69 6f 6e 20 | 6d 6f 64 65 20 6f 66 20 |tection |mode of |
|00000290| 74 68 65 0a 6f 75 74 70 | 75 74 20 74 6f 20 74 68 |the.outp|ut to th|
|000002a0| 61 74 20 6f 66 20 74 68 | 65 20 69 6e 70 75 74 2e |at of th|e input.|
|000002b0| 0a 0a 0a 23 21 20 2f 62 | 69 6e 2f 73 68 0a 23 20 |...#! /b|in/sh.# |
|000002c0| 54 68 69 73 20 69 73 20 | 61 20 73 68 65 6c 6c 20 |This is |a shell |
|000002d0| 61 72 63 68 69 76 65 2e | 20 20 52 65 6d 6f 76 65 |archive.| Remove|
|000002e0| 20 61 6e 79 74 68 69 6e | 67 20 62 65 66 6f 72 65 | anythin|g before|
|000002f0| 20 74 68 69 73 20 6c 69 | 6e 65 2c 20 74 68 65 6e | this li|ne, then|
|00000300| 20 75 6e 70 61 63 6b 0a | 23 20 69 74 20 62 79 20 | unpack.|# it by |
|00000310| 73 61 76 69 6e 67 20 69 | 74 20 69 6e 74 6f 20 61 |saving i|t into a|
|00000320| 20 66 69 6c 65 20 61 6e | 64 20 74 79 70 69 6e 67 | file an|d typing|
|00000330| 20 22 73 68 20 66 69 6c | 65 22 2e 20 20 54 6f 20 | "sh fil|e". To |
|00000340| 6f 76 65 72 77 72 69 74 | 65 20 65 78 69 73 74 69 |overwrit|e existi|
|00000350| 6e 67 0a 23 20 66 69 6c | 65 73 2c 20 74 79 70 65 |ng.# fil|es, type|
|00000360| 20 22 73 68 20 66 69 6c | 65 20 2d 63 22 2e 20 20 | "sh fil|e -c". |
|00000370| 59 6f 75 20 63 61 6e 20 | 61 6c 73 6f 20 66 65 65 |You can |also fee|
|00000380| 64 20 74 68 69 73 20 61 | 73 20 73 74 61 6e 64 61 |d this a|s standa|
|00000390| 72 64 20 69 6e 70 75 74 | 20 76 69 61 0a 23 20 75 |rd input| via.# u|
|000003a0| 6e 73 68 61 72 2c 20 6f | 72 20 62 79 20 74 79 70 |nshar, o|r by typ|
|000003b0| 69 6e 67 20 22 73 68 20 | 3c 66 69 6c 65 22 2c 20 |ing "sh |<file", |
|000003c0| 65 2e 67 2e 2e 20 20 49 | 66 20 74 68 69 73 20 61 |e.g.. I|f this a|
|000003d0| 72 63 68 69 76 65 20 69 | 73 20 63 6f 6d 70 6c 65 |rchive i|s comple|
|000003e0| 74 65 2c 20 79 6f 75 0a | 23 20 77 69 6c 6c 20 73 |te, you.|# will s|
|000003f0| 65 65 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |ee the f|ollowing|
|00000400| 20 6d 65 73 73 61 67 65 | 20 61 74 20 74 68 65 20 | message| at the |
|00000410| 65 6e 64 3a 0a 23 09 09 | 22 45 6e 64 20 6f 66 20 |end:.#..|"End of |
|00000420| 73 68 65 6c 6c 20 61 72 | 63 68 69 76 65 2e 22 0a |shell ar|chive.".|
|00000430| 23 20 43 6f 6e 74 65 6e | 74 73 3a 20 20 52 45 41 |# Conten|ts: REA|
|00000440| 44 4d 45 20 43 48 41 4e | 47 45 53 20 66 69 6c 74 |DME CHAN|GES filt|
|00000450| 65 72 66 69 6c 65 2e 6d | 61 6e 20 66 69 6c 74 65 |erfile.m|an filte|
|00000460| 72 66 69 6c 65 2e 63 20 | 4d 61 6b 65 66 69 6c 65 |rfile.c |Makefile|
|00000470| 0a 50 41 54 48 3d 2f 62 | 69 6e 3a 2f 75 73 72 2f |.PATH=/b|in:/usr/|
|00000480| 62 69 6e 3a 2f 75 73 72 | 2f 75 63 62 20 3b 20 65 |bin:/usr|/ucb ; e|
|00000490| 78 70 6f 72 74 20 50 41 | 54 48 0a 69 66 20 74 65 |xport PA|TH.if te|
|000004a0| 73 74 20 2d 66 20 27 52 | 45 41 44 4d 45 27 20 2d |st -f 'R|EADME' -|
|000004b0| 61 20 22 24 7b 31 7d 22 | 20 21 3d 20 22 2d 63 22 |a "${1}"| != "-c"|
|000004c0| 20 3b 20 74 68 65 6e 20 | 0a 20 20 65 63 68 6f 20 | ; then |. echo |
|000004d0| 73 68 61 72 3a 20 57 69 | 6c 6c 20 6e 6f 74 20 63 |shar: Wi|ll not c|
|000004e0| 6c 6f 62 62 65 72 20 65 | 78 69 73 74 69 6e 67 20 |lobber e|xisting |
|000004f0| 66 69 6c 65 20 5c 22 27 | 52 45 41 44 4d 45 27 5c |file \"'|README'\|
|00000500| 22 0a 65 6c 73 65 0a 65 | 63 68 6f 20 73 68 61 72 |".else.e|cho shar|
|00000510| 3a 20 45 78 74 72 61 63 | 74 69 6e 67 20 5c 22 27 |: Extrac|ting \"'|
|00000520| 52 45 41 44 4d 45 27 5c | 22 20 5c 28 37 33 38 20 |README'\|" \(738 |
|00000530| 63 68 61 72 61 63 74 65 | 72 73 5c 29 0a 73 65 64 |characte|rs\).sed|
|00000540| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 27 52 45 41 44 | "s/^X//|" >'READ|
|00000550| 4d 45 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |ME' <<'E|ND_OF_FI|
|00000560| 4c 45 27 0a 58 66 69 6c | 74 65 72 66 69 6c 65 20 |LE'.Xfil|terfile |
|00000570| 2d 20 61 70 70 6c 79 20 | 61 20 66 69 6c 74 65 72 |- apply |a filter|
|00000580| 20 74 6f 20 61 20 66 69 | 6c 65 0a 58 0a 58 66 69 | to a fi|le.X.Xfi|
|00000590| 6c 74 65 72 66 69 6c 65 | 20 76 65 72 73 69 6f 6e |lterfile| version|
|000005a0| 20 31 2e 32 30 31 2c 20 | 4f 63 74 6f 62 65 72 20 | 1.201, |October |
|000005b0| 32 38 2c 20 31 39 38 39 | 2e 0a 58 43 6f 70 79 72 |28, 1989|..XCopyr|
|000005c0| 69 67 68 74 20 28 63 29 | 20 31 39 38 39 2c 20 44 |ight (c)| 1989, D|
|000005d0| 61 6e 69 65 6c 20 4a 2e | 20 42 65 72 6e 73 74 65 |aniel J.| Bernste|
|000005e0| 69 6e 2e 0a 58 41 6c 6c | 20 72 69 67 68 74 73 20 |in..XAll| rights |
|000005f0| 72 65 73 65 72 76 65 64 | 2e 0a 58 0a 58 54 68 69 |reserved|..X.XThi|
|00000600| 73 20 64 69 73 74 72 69 | 62 75 74 69 6f 6e 20 70 |s distri|bution p|
|00000610| 61 63 6b 61 67 65 64 20 | 4f 63 74 6f 62 65 72 20 |ackaged |October |
|00000620| 32 38 2c 20 31 39 38 39 | 2e 0a 58 0a 58 46 69 6c |28, 1989|..X.XFil|
|00000630| 65 73 3a 0a 58 43 48 41 | 4e 47 45 53 20 20 20 20 |es:.XCHA|NGES |
|00000640| 20 20 20 20 20 44 65 73 | 63 72 69 70 74 69 6f 6e | Des|cription|
|00000650| 20 6f 66 20 63 68 61 6e | 67 65 73 20 73 69 6e 63 | of chan|ges sinc|
|00000660| 65 20 66 69 72 73 74 20 | 64 69 73 74 72 69 62 75 |e first |distribu|
|00000670| 74 65 64 20 76 65 72 73 | 69 6f 6e 0a 58 52 45 41 |ted vers|ion.XREA|
|00000680| 44 4d 45 20 20 20 20 20 | 20 20 20 20 20 54 68 69 |DME | Thi|
|00000690| 73 20 64 6f 63 75 6d 65 | 6e 74 0a 58 4d 61 6b 65 |s docume|nt.XMake|
|000006a0| 66 69 6c 65 20 20 20 20 | 20 20 20 20 49 6e 73 74 |file | Inst|
|000006b0| 61 6c 6c 61 74 69 6f 6e | 20 63 6f 6d 6d 61 6e 64 |allation| command|
|000006c0| 73 0a 58 66 69 6c 74 65 | 72 66 69 6c 65 2e 63 20 |s.Xfilte|rfile.c |
|000006d0| 20 20 20 54 68 65 20 70 | 72 6f 67 72 61 6d 0a 58 | The p|rogram.X|
|000006e0| 66 69 6c 74 65 72 66 69 | 6c 65 2e 6d 61 6e 20 20 |filterfi|le.man |
|000006f0| 44 6f 63 75 6d 65 6e 74 | 61 74 69 6f 6e 0a 58 0a |Document|ation.X.|
|00000700| 58 45 64 69 74 20 74 68 | 65 20 6f 70 74 69 6f 6e |XEdit th|e option|
|00000710| 73 20 69 6e 20 4d 61 6b | 65 66 69 6c 65 20 61 6e |s in Mak|efile an|
|00000720| 64 20 74 79 70 65 20 6d | 61 6b 65 2e 20 66 69 6c |d type m|ake. fil|
|00000730| 74 65 72 66 69 6c 65 20 | 77 69 6c 6c 20 62 65 20 |terfile |will be |
|00000740| 74 68 65 0a 58 65 78 65 | 63 75 74 61 62 6c 65 20 |the.Xexe|cutable |
|00000750| 70 72 6f 67 72 61 6d 3b | 20 66 69 6c 74 65 72 66 |program;| filterf|
|00000760| 69 6c 65 2e 31 20 77 69 | 6c 6c 20 62 65 20 74 68 |ile.1 wi|ll be th|
|00000770| 65 20 6e 72 6f 66 66 27 | 65 64 20 6d 61 6e 75 61 |e nroff'|ed manua|
|00000780| 6c 2e 0a 58 0a 58 49 20 | 64 6f 6e 27 74 20 70 72 |l..X.XI |don't pr|
|00000790| 65 74 65 6e 64 20 74 6f | 20 6b 6e 6f 77 20 79 6f |etend to| know yo|
|000007a0| 75 72 20 6d 61 63 68 69 | 6e 65 27 73 20 73 65 74 |ur machi|ne's set|
|000007b0| 75 70 20 73 6f 20 74 68 | 65 72 65 27 73 20 6e 6f |up so th|ere's no|
|000007c0| 20 6d 61 6b 65 20 69 6e | 73 74 61 6c 6c 2e 0a 58 | make in|stall..X|
|000007d0| 0a 58 52 65 61 64 20 43 | 48 41 4e 47 45 53 20 66 |.XRead C|HANGES f|
|000007e0| 6f 72 20 61 20 6c 69 73 | 74 20 6f 66 20 63 68 61 |or a lis|t of cha|
|000007f0| 6e 67 65 73 2e 20 54 79 | 70 65 20 66 69 6c 74 65 |nges. Ty|pe filte|
|00000800| 72 66 69 6c 65 20 2d 43 | 20 61 6e 64 20 66 69 6c |rfile -C| and fil|
|00000810| 74 65 72 66 69 6c 65 20 | 2d 57 0a 58 66 6f 72 20 |terfile |-W.Xfor |
|00000820| 63 6f 70 79 72 69 67 68 | 74 20 61 6e 64 20 77 61 |copyrigh|t and wa|
|00000830| 72 72 61 6e 74 79 20 69 | 6e 66 6f 72 6d 61 74 69 |rranty i|nformati|
|00000840| 6f 6e 2c 20 66 69 6c 74 | 65 72 66 69 6c 65 20 2d |on, filt|erfile -|
|00000850| 48 20 66 6f 72 20 68 65 | 6c 70 2e 0a 45 4e 44 5f |H for he|lp..END_|
|00000860| 4f 46 5f 46 49 4c 45 0a | 69 66 20 74 65 73 74 20 |OF_FILE.|if test |
|00000870| 37 33 38 20 2d 6e 65 20 | 60 77 63 20 2d 63 20 3c |738 -ne |`wc -c <|
|00000880| 27 52 45 41 44 4d 45 27 | 60 3b 20 74 68 65 6e 0a |'README'|`; then.|
|00000890| 20 20 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 5c | echo| shar: \|
|000008a0| 22 27 52 45 41 44 4d 45 | 27 5c 22 20 75 6e 70 61 |"'README|'\" unpa|
|000008b0| 63 6b 65 64 20 77 69 74 | 68 20 77 72 6f 6e 67 20 |cked wit|h wrong |
|000008c0| 73 69 7a 65 21 0a 66 69 | 0a 23 20 65 6e 64 20 6f |size!.fi|.# end o|
|000008d0| 66 20 27 52 45 41 44 4d | 45 27 0a 66 69 0a 69 66 |f 'READM|E'.fi.if|
|000008e0| 20 74 65 73 74 20 2d 66 | 20 27 43 48 41 4e 47 45 | test -f| 'CHANGE|
|000008f0| 53 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |S' -a "$|{1}" != |
|00000900| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00000910| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|00000920| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|00000930| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 43 48 41 4e |ing file| \"'CHAN|
|00000940| 47 45 53 27 5c 22 0a 65 | 6c 73 65 0a 65 63 68 6f |GES'\".e|lse.echo|
|00000950| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|00000960| 67 20 5c 22 27 43 48 41 | 4e 47 45 53 27 5c 22 20 |g \"'CHA|NGES'\" |
|00000970| 5c 28 33 31 32 20 63 68 | 61 72 61 63 74 65 72 73 |\(312 ch|aracters|
|00000980| 5c 29 0a 73 65 64 20 22 | 73 2f 5e 58 2f 2f 22 20 |\).sed "|s/^X//" |
|00000990| 3e 27 43 48 41 4e 47 45 | 53 27 20 3c 3c 27 45 4e |>'CHANGE|S' <<'EN|
|000009a0| 44 5f 4f 46 5f 46 49 4c | 45 27 0a 58 56 65 72 73 |D_OF_FIL|E'.XVers|
|000009b0| 69 6f 6e 20 31 2e 32 30 | 31 2c 20 31 30 2f 32 38 |ion 1.20|1, 10/28|
|000009c0| 2f 38 39 2e 0a 58 0a 58 | 43 68 61 6e 67 65 64 20 |/89..X.X|Changed |
|000009d0| 66 69 6c 65 66 69 6c 74 | 65 72 20 74 6f 20 66 69 |filefilt|er to fi|
|000009e0| 6c 74 65 72 66 69 6c 65 | 20 61 74 20 6f 6e 65 20 |lterfile| at one |
|000009f0| 73 70 6f 74 20 69 6e 20 | 6d 61 6e 75 61 6c 20 28 |spot in |manual (|
|00000a00| 77 68 6f 6f 70 73 21 29 | 2e 0a 58 50 75 74 20 6d |whoops!)|..XPut m|
|00000a10| 69 73 73 69 6e 67 20 5c | 6e 20 69 6e 74 6f 20 61 |issing \|n into a|
|00000a20| 6e 20 65 72 72 6f 72 20 | 6d 65 73 73 61 67 65 2e |n error |message.|
|00000a30| 0a 58 50 75 74 20 69 6e | 20 6e 65 77 20 63 6f 70 |.XPut in| new cop|
|00000a40| 79 72 69 67 68 74 20 6e | 6f 74 69 63 65 20 61 6e |yright n|otice an|
|00000a50| 64 20 77 61 72 72 61 6e | 74 79 2e 0a 58 0a 58 56 |d warran|ty..X.XV|
|00000a60| 65 72 73 69 6f 6e 20 31 | 2e 32 2e 0a 58 0a 58 4d |ersion 1|.2..X.XM|
|00000a70| 69 6e 6f 72 20 63 68 61 | 6e 67 65 73 2e 0a 58 41 |inor cha|nges..XA|
|00000a80| 64 64 65 64 20 66 69 6c | 65 6e 61 6d 65 73 20 69 |dded fil|enames i|
|00000a90| 6e 74 6f 20 6d 6f 73 74 | 20 6f 66 20 74 68 65 20 |nto most| of the |
|00000aa0| 65 72 72 6f 72 73 2e 0a | 58 4d 61 64 65 20 65 78 |errors..|XMade ex|
|00000ab0| 65 63 76 65 20 69 6e 74 | 6f 20 65 78 65 63 76 70 |ecve int|o execvp|
|00000ac0| 2c 20 73 6f 20 66 69 6c | 74 65 72 66 69 6c 65 20 |, so fil|terfile |
|00000ad0| 73 65 61 72 63 68 65 73 | 20 70 61 74 68 73 2e 0a |searches| paths..|
|00000ae0| 58 0a 58 56 65 72 73 69 | 6f 6e 20 31 2e 30 2e 0a |X.XVersi|on 1.0..|
|00000af0| 45 4e 44 5f 4f 46 5f 46 | 49 4c 45 0a 69 66 20 74 |END_OF_F|ILE.if t|
|00000b00| 65 73 74 20 33 31 32 20 | 2d 6e 65 20 60 77 63 20 |est 312 |-ne `wc |
|00000b10| 2d 63 20 3c 27 43 48 41 | 4e 47 45 53 27 60 3b 20 |-c <'CHA|NGES'`; |
|00000b20| 74 68 65 6e 0a 20 20 20 | 20 65 63 68 6f 20 73 68 |then. | echo sh|
|00000b30| 61 72 3a 20 5c 22 27 43 | 48 41 4e 47 45 53 27 5c |ar: \"'C|HANGES'\|
|00000b40| 22 20 75 6e 70 61 63 6b | 65 64 20 77 69 74 68 20 |" unpack|ed with |
|00000b50| 77 72 6f 6e 67 20 73 69 | 7a 65 21 0a 66 69 0a 23 |wrong si|ze!.fi.#|
|00000b60| 20 65 6e 64 20 6f 66 20 | 27 43 48 41 4e 47 45 53 | end of |'CHANGES|
|00000b70| 27 0a 66 69 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |'.fi.if |test -f |
|00000b80| 27 66 69 6c 74 65 72 66 | 69 6c 65 2e 6d 61 6e 27 |'filterf|ile.man'|
|00000b90| 20 2d 61 20 22 24 7b 31 | 7d 22 20 21 3d 20 22 2d | -a "${1|}" != "-|
|00000ba0| 63 22 20 3b 20 74 68 65 | 6e 20 0a 20 20 65 63 68 |c" ; the|n . ech|
|00000bb0| 6f 20 73 68 61 72 3a 20 | 57 69 6c 6c 20 6e 6f 74 |o shar: |Will not|
|00000bc0| 20 63 6c 6f 62 62 65 72 | 20 65 78 69 73 74 69 6e | clobber| existin|
|00000bd0| 67 20 66 69 6c 65 20 5c | 22 27 66 69 6c 74 65 72 |g file \|"'filter|
|00000be0| 66 69 6c 65 2e 6d 61 6e | 27 5c 22 0a 65 6c 73 65 |file.man|'\".else|
|00000bf0| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 |.echo sh|ar: Extr|
|00000c00| 61 63 74 69 6e 67 20 5c | 22 27 66 69 6c 74 65 72 |acting \|"'filter|
|00000c10| 66 69 6c 65 2e 6d 61 6e | 27 5c 22 20 5c 28 34 39 |file.man|'\" \(49|
|00000c20| 36 38 20 63 68 61 72 61 | 63 74 65 72 73 5c 29 0a |68 chara|cters\).|
|00000c30| 73 65 64 20 22 73 2f 5e | 58 2f 2f 22 20 3e 27 66 |sed "s/^|X//" >'f|
|00000c40| 69 6c 74 65 72 66 69 6c | 65 2e 6d 61 6e 27 20 3c |ilterfil|e.man' <|
|00000c50| 3c 27 45 4e 44 5f 4f 46 | 5f 46 49 4c 45 27 0a 58 |<'END_OF|_FILE'.X|
|00000c60| 2e 54 48 20 66 69 6c 74 | 65 72 66 69 6c 65 20 31 |.TH filt|erfile 1|
|00000c70| 0a 58 2e 53 48 20 4e 41 | 4d 45 0a 58 66 69 6c 74 |.X.SH NA|ME.Xfilt|
|00000c80| 65 72 66 69 6c 65 20 5c | 2d 20 61 70 70 6c 79 20 |erfile \|- apply |
|00000c90| 61 20 66 69 6c 74 65 72 | 20 74 6f 20 61 20 66 69 |a filter| to a fi|
|00000ca0| 6c 65 0a 58 2e 53 48 20 | 53 59 4e 54 41 58 0a 58 |le.X.SH |SYNTAX.X|
|00000cb0| 66 69 6c 74 65 72 66 69 | 6c 65 0a 58 5b 0a 58 5c |filterfi|le.X[.X\|
|00000cc0| 66 42 5c 2d 64 44 70 50 | 74 54 5c 66 49 0a 58 5d |fB\-dDpP|tT\fI.X]|
|00000cd0| 20 5b 0a 58 5c 66 42 5c | 2d 6f 5c 66 49 6f 75 74 | [.X\fB\|-o\fIout|
|00000ce0| 0a 58 5d 20 5b 0a 58 5c | 66 42 5c 2d 65 5c 66 49 |.X] [.X\|fB\-e\fI|
|00000cf0| 65 78 74 0a 58 5d 20 5b | 0a 58 5c 66 42 5c 2d 41 |ext.X] [|.X\fB\-A|
|00000d00| 43 48 55 56 57 5c 66 49 | 0a 58 5d 0a 58 66 69 6c |CHUVW\fI|.X].Xfil|
|00000d10| 65 20 2f 70 61 74 68 2f | 66 69 6c 74 65 72 0a 58 |e /path/|filter.X|
|00000d20| 5b 0a 58 61 72 67 20 2e | 2e 2e 0a 58 5d 0a 58 2e |[.Xarg .|...X].X.|
|00000d30| 53 48 20 44 45 53 43 52 | 49 50 54 49 4f 4e 0a 58 |SH DESCR|IPTION.X|
|00000d40| 5c 66 49 66 69 6c 74 65 | 72 66 69 6c 65 5c 66 42 |\fIfilte|rfile\fB|
|00000d50| 0a 58 61 70 70 6c 69 65 | 73 20 61 20 66 69 6c 74 |.Xapplie|s a filt|
|00000d60| 65 72 20 74 6f 20 61 20 | 66 69 6c 65 2c 0a 58 77 |er to a |file,.Xw|
|00000d70| 72 69 74 69 6e 67 20 74 | 68 65 20 72 65 73 75 6c |riting t|he resul|
|00000d80| 74 20 74 6f 20 61 6e 6f | 74 68 65 72 20 66 69 6c |t to ano|ther fil|
|00000d90| 65 2e 0a 58 56 61 72 69 | 6f 75 73 20 6f 70 74 69 |e..XVari|ous opti|
|00000da0| 6f 6e 73 20 6c 65 74 0a | 58 5c 66 49 66 69 6c 74 |ons let.|X\fIfilt|
|00000db0| 65 72 66 69 6c 65 5c 66 | 42 0a 58 64 65 6c 65 74 |erfile\f|B.Xdelet|
|00000dc0| 65 20 74 68 65 20 69 6e | 70 75 74 20 66 69 6c 65 |e the in|put file|
|00000dd0| 2c 0a 58 73 65 74 20 74 | 68 65 20 74 69 6d 65 73 |,.Xset t|he times|
|00000de0| 20 6f 66 20 74 68 65 20 | 6f 75 74 70 75 74 20 74 | of the |output t|
|00000df0| 6f 20 74 68 65 20 74 69 | 6d 65 73 20 6f 66 20 74 |o the ti|mes of t|
|00000e00| 68 65 20 69 6e 70 75 74 | 2c 0a 58 6f 72 20 73 65 |he input|,.Xor se|
|00000e10| 74 20 74 68 65 20 70 72 | 6f 74 65 63 74 69 6f 6e |t the pr|otection|
|00000e20| 20 6d 6f 64 65 20 6f 66 | 20 74 68 65 20 6f 75 74 | mode of| the out|
|00000e30| 70 75 74 20 74 6f 20 74 | 68 61 74 20 6f 66 20 74 |put to t|hat of t|
|00000e40| 68 65 20 69 6e 70 75 74 | 2e 0a 58 2e 50 50 0a 58 |he input|..X.PP.X|
|00000e50| 4f 70 74 69 6f 6e 73 0a | 58 2e 42 20 41 43 48 55 |Options.|X.B ACHU|
|00000e60| 56 57 0a 58 70 72 69 6e | 74 20 74 68 65 20 61 75 |VW.Xprin|t the au|
|00000e70| 74 68 6f 72 73 68 69 70 | 20 6e 6f 74 69 63 65 2c |thorship| notice,|
|00000e80| 0a 58 63 6f 70 79 72 69 | 67 68 74 20 6e 6f 74 69 |.Xcopyri|ght noti|
|00000e90| 63 65 2c 0a 58 68 65 6c | 70 20 6e 6f 74 69 63 65 |ce,.Xhel|p notice|
|00000ea0| 2c 0a 58 73 68 6f 72 74 | 20 75 73 61 67 65 20 73 |,.Xshort| usage s|
|00000eb0| 75 6d 6d 61 72 79 2c 0a | 58 76 65 72 73 69 6f 6e |ummary,.|Xversion|
|00000ec0| 20 6e 75 6d 62 65 72 2c | 0a 58 61 6e 64 20 77 61 | number,|.Xand wa|
|00000ed0| 72 72 61 6e 74 79 20 69 | 6e 66 6f 72 6d 61 74 69 |rranty i|nformati|
|00000ee0| 6f 6e 20 72 65 73 70 65 | 63 74 69 76 65 6c 79 2e |on respe|ctively.|
|00000ef0| 0a 58 2e 50 50 0a 58 5c | 66 49 66 69 6c 74 65 72 |.X.PP.X\|fIfilter|
|00000f00| 66 69 6c 65 5c 66 42 0a | 58 68 61 73 20 73 65 76 |file\fB.|Xhas sev|
|00000f10| 65 72 61 6c 20 66 6c 61 | 67 73 3a 0a 58 2e 54 50 |eral fla|gs:.X.TP|
|00000f20| 20 31 32 0a 58 2e 42 20 | 2d 64 0a 58 44 65 6c 65 | 12.X.B |-d.XDele|
|00000f30| 74 65 20 74 68 65 20 69 | 6e 70 75 74 20 66 69 6c |te the i|nput fil|
|00000f40| 65 20 61 66 74 65 72 20 | 74 68 65 20 66 69 6c 74 |e after |the filt|
|00000f50| 65 72 20 72 75 6e 73 20 | 73 75 63 63 65 73 73 66 |er runs |successf|
|00000f60| 75 6c 6c 79 2e 0a 58 54 | 68 65 20 69 6e 70 75 74 |ully..XT|he input|
|00000f70| 20 66 69 6c 65 20 77 69 | 6c 6c 20 72 65 6d 61 69 | file wi|ll remai|
|00000f80| 6e 20 75 6e 74 6f 75 63 | 68 65 64 20 69 66 20 74 |n untouc|hed if t|
|00000f90| 68 65 20 66 69 6c 74 65 | 72 20 63 72 61 73 68 65 |he filte|r crashe|
|00000fa0| 73 0a 58 6f 72 20 65 78 | 69 74 73 20 77 69 74 68 |s.Xor ex|its with|
|00000fb0| 20 61 6e 20 65 72 72 6f | 72 20 69 6e 64 69 63 61 | an erro|r indica|
|00000fc0| 74 69 6f 6e 2e 0a 58 2e | 54 50 0a 58 2e 42 20 2d |tion..X.|TP.X.B -|
|00000fd0| 44 0a 58 44 6f 20 6e 6f | 74 20 64 65 6c 65 74 65 |D.XDo no|t delete|
|00000fe0| 20 74 68 65 20 69 6e 70 | 75 74 20 66 69 6c 65 2e | the inp|ut file.|
|00000ff0| 20 54 68 69 73 20 69 73 | 20 74 68 65 20 64 65 66 | This is| the def|
|00001000| 61 75 6c 74 2e 0a 58 2e | 54 50 0a 58 2e 42 20 2d |ault..X.|TP.X.B -|
|00001010| 70 0a 58 53 65 74 20 74 | 68 65 20 70 72 6f 74 65 |p.XSet t|he prote|
|00001020| 63 74 69 6f 6e 20 6d 6f | 64 65 73 20 6f 66 20 74 |ction mo|des of t|
|00001030| 68 65 20 6f 75 74 70 75 | 74 20 74 6f 20 74 68 65 |he outpu|t to the|
|00001040| 20 70 72 6f 74 65 63 74 | 69 6f 6e 20 6d 6f 64 65 | protect|ion mode|
|00001050| 73 0a 58 6f 66 20 74 68 | 65 20 69 6e 70 75 74 2e |s.Xof th|e input.|
|00001060| 0a 58 2e 54 50 0a 58 2e | 42 20 2d 50 0a 58 4c 65 |.X.TP.X.|B -P.XLe|
|00001070| 61 76 65 20 74 68 65 20 | 6f 75 74 70 75 74 20 70 |ave the |output p|
|00001080| 72 6f 74 65 63 74 69 6f | 6e 20 6d 6f 64 65 73 20 |rotectio|n modes |
|00001090| 61 6c 6f 6e 65 2e 20 54 | 68 69 73 20 69 73 20 74 |alone. T|his is t|
|000010a0| 68 65 20 64 65 66 61 75 | 6c 74 2e 0a 58 2e 54 50 |he defau|lt..X.TP|
|000010b0| 0a 58 2e 42 20 2d 74 0a | 58 53 65 74 20 74 68 65 |.X.B -t.|XSet the|
|000010c0| 20 61 63 63 65 73 73 20 | 61 6e 64 20 6d 6f 64 69 | access |and modi|
|000010d0| 66 69 63 61 74 69 6f 6e | 20 74 69 6d 65 73 20 6f |fication| times o|
|000010e0| 66 20 74 68 65 20 6f 75 | 74 70 75 74 20 74 6f 20 |f the ou|tput to |
|000010f0| 74 68 6f 73 65 0a 58 6f | 66 20 74 68 65 20 69 6e |those.Xo|f the in|
|00001100| 70 75 74 2e 0a 58 2e 54 | 50 0a 58 2e 42 20 2d 54 |put..X.T|P.X.B -T|
|00001110| 0a 58 4c 65 61 76 65 20 | 74 68 65 20 74 69 6d 65 |.XLeave |the time|
|00001120| 73 20 61 6c 6f 6e 65 2e | 20 54 68 69 73 20 69 73 |s alone.| This is|
|00001130| 20 74 68 65 20 64 65 66 | 61 75 6c 74 2e 0a 58 2e | the def|ault..X.|
|00001140| 54 50 0a 58 5c 66 42 2d | 6f 5c 66 49 6f 75 74 0a |TP.X\fB-|o\fIout.|
|00001150| 58 57 72 69 74 65 20 74 | 68 65 20 6f 75 74 70 75 |XWrite t|he outpu|
|00001160| 74 20 6f 6e 20 66 69 6c | 65 0a 58 5c 66 49 6f 75 |t on fil|e.X\fIou|
|00001170| 74 5c 66 42 2e 0a 58 54 | 68 69 73 20 6f 76 65 72 |t\fB..XT|his over|
|00001180| 72 69 64 65 73 0a 58 74 | 68 65 20 0a 58 2e 42 5c |rides.Xt|he .X.B\|
|00001190| 2d 65 0a 58 6f 70 74 69 | 6f 6e 2e 0a 58 2e 54 50 |-e.Xopti|on..X.TP|
|000011a0| 0a 58 5c 66 42 2d 65 5c | 66 49 65 78 74 0a 58 57 |.X\fB-e\|fIext.XW|
|000011b0| 72 69 74 65 20 74 68 65 | 20 6f 75 74 70 75 74 20 |rite the| output |
|000011c0| 6f 6e 0a 58 5c 66 49 66 | 69 6c 65 2e 65 78 74 5c |on.X\fIf|ile.ext\|
|000011d0| 66 42 2e 0a 58 2e 50 50 | 0a 58 49 66 20 79 6f 75 |fB..X.PP|.XIf you|
|000011e0| 20 73 70 65 63 69 66 79 | 20 6e 65 69 74 68 65 72 | specify| neither|
|000011f0| 0a 58 2e 42 5c 2d 6f 0a | 58 6e 6f 72 0a 58 5c 66 |.X.B\-o.|Xnor.X\f|
|00001200| 42 5c 2d 65 5c 66 49 2c | 0a 58 5c 66 49 66 69 6c |B\-e\fI,|.X\fIfil|
|00001210| 74 65 72 66 69 6c 65 5c | 66 42 0a 58 77 69 6c 6c |terfile\|fB.Xwill|
|00001220| 20 6c 6f 6f 6b 20 66 6f | 72 20 61 6e 20 65 6e 76 | look fo|r an env|
|00001230| 69 72 6f 6e 6d 65 6e 74 | 20 76 61 72 69 61 62 6c |ironment| variabl|
|00001240| 65 0a 58 2e 42 20 46 49 | 4c 45 46 49 4c 54 45 52 |e.X.B FI|LEFILTER|
|00001250| 45 58 54 0a 58 67 69 76 | 69 6e 67 20 61 6e 20 65 |EXT.Xgiv|ing an e|
|00001260| 78 74 65 6e 73 69 6f 6e | 2e 0a 58 49 66 20 74 68 |xtension|..XIf th|
|00001270| 65 72 65 20 69 73 20 6e | 6f 20 73 75 63 68 20 76 |ere is n|o such v|
|00001280| 61 72 69 61 62 6c 65 2c | 0a 58 5c 66 49 66 69 6c |ariable,|.X\fIfil|
|00001290| 74 65 72 66 69 6c 65 5c | 66 42 0a 58 77 69 6c 6c |terfile\|fB.Xwill|
|000012a0| 20 67 69 76 65 20 74 68 | 65 20 6f 75 74 70 75 74 | give th|e output|
|000012b0| 20 74 68 65 20 73 61 6d | 65 20 6e 61 6d 65 20 61 | the sam|e name a|
|000012c0| 73 20 74 68 65 20 69 6e | 70 75 74 2c 0a 58 66 6f |s the in|put,.Xfo|
|000012d0| 6c 6c 6f 77 65 64 20 62 | 79 20 61 20 70 65 72 69 |llowed b|y a peri|
|000012e0| 6f 64 2e 0a 58 2e 50 50 | 0a 58 49 66 20 74 68 65 |od..X.PP|.XIf the|
|000012f0| 20 65 78 74 65 6e 73 69 | 6f 6e 20 62 65 67 69 6e | extensi|on begin|
|00001300| 73 20 77 69 74 68 20 61 | 20 70 65 72 69 6f 64 20 |s with a| period |
|00001310| 61 6e 64 20 74 68 65 20 | 69 6e 70 75 74 20 66 69 |and the |input fi|
|00001320| 6c 65 20 6e 61 6d 65 0a | 58 65 6e 64 73 20 77 69 |le name.|Xends wi|
|00001330| 74 68 20 74 68 61 74 20 | 65 78 74 65 6e 73 69 6f |th that |extensio|
|00001340| 6e 20 61 6c 72 65 61 64 | 79 2c 20 74 68 65 20 65 |n alread|y, the e|
|00001350| 78 74 65 6e 73 69 6f 6e | 20 69 73 20 64 65 6c 65 |xtension| is dele|
|00001360| 74 65 64 20 66 72 6f 6d | 0a 58 74 68 65 20 66 69 |ted from|.Xthe fi|
|00001370| 6c 65 20 6e 61 6d 65 20 | 72 61 74 68 65 72 20 74 |le name |rather t|
|00001380| 68 61 6e 20 61 64 64 65 | 64 20 74 6f 20 69 74 2e |han adde|d to it.|
|00001390| 20 49 66 20 79 6f 75 20 | 72 65 61 6c 6c 79 20 64 | If you |really d|
|000013a0| 6f 20 77 61 6e 74 0a 58 | 70 65 72 69 6f 64 73 20 |o want.X|periods |
|000013b0| 69 6e 20 74 68 65 20 65 | 78 74 65 6e 73 69 6f 6e |in the e|xtension|
|000013c0| 2c 20 74 79 70 65 20 74 | 68 65 6d 20 61 73 20 73 |, type t|hem as s|
|000013d0| 6c 61 73 68 65 73 2e 0a | 58 2e 50 50 0a 58 54 68 |lashes..|X.PP.XTh|
|000013e0| 65 20 6f 70 74 69 6f 6e | 73 20 61 6e 64 20 69 6e |e option|s and in|
|000013f0| 70 75 74 20 66 69 6c 65 | 20 6e 61 6d 65 20 63 61 |put file| name ca|
|00001400| 6e 20 63 6f 6d 65 20 69 | 6e 20 61 6e 79 20 6f 72 |n come i|n any or|
|00001410| 64 65 72 2c 0a 58 62 75 | 74 20 74 68 65 20 73 65 |der,.Xbu|t the se|
|00001420| 63 6f 6e 64 20 61 72 67 | 75 6d 65 6e 74 20 6e 6f |cond arg|ument no|
|00001430| 74 20 73 74 61 72 74 69 | 6e 67 20 77 69 74 68 20 |t starti|ng with |
|00001440| 61 20 68 79 70 68 65 6e | 0a 58 69 73 20 74 61 6b |a hyphen|.Xis tak|
|00001450| 65 6e 20 74 6f 20 62 65 | 20 74 68 65 20 6e 61 6d |en to be| the nam|
|00001460| 65 20 6f 66 20 74 68 65 | 20 66 69 6c 74 65 72 2e |e of the| filter.|
|00001470| 0a 58 41 6e 79 20 66 75 | 72 74 68 65 72 20 61 72 |.XAny fu|rther ar|
|00001480| 67 75 6d 65 6e 74 73 20 | 61 72 65 20 70 61 73 73 |guments |are pass|
|00001490| 65 64 20 6f 6e 20 61 73 | 20 6f 70 74 69 6f 6e 73 |ed on as| options|
|000014a0| 20 74 6f 20 74 68 65 20 | 66 69 6c 74 65 72 2e 0a | to the |filter..|
|000014b0| 58 2e 50 50 0a 58 59 6f | 75 20 6e 65 65 64 20 6e |X.PP.XYo|u need n|
|000014c0| 6f 74 20 73 70 65 63 69 | 66 79 20 61 20 66 75 6c |ot speci|fy a ful|
|000014d0| 6c 20 70 61 74 68 20 6e | 61 6d 65 20 66 6f 72 20 |l path n|ame for |
|000014e0| 74 68 65 20 66 69 6c 74 | 65 72 2e 0a 58 2e 53 48 |the filt|er..X.SH|
|000014f0| 20 44 49 41 47 4e 4f 53 | 54 49 43 53 0a 58 41 6c | DIAGNOS|TICS.XAl|
|00001500| 74 6f 67 65 74 68 65 72 | 20 74 6f 6f 20 6d 61 6e |together| too man|
|00001510| 79 2c 0a 58 74 68 6f 75 | 67 68 20 6c 75 63 6b 69 |y,.Xthou|gh lucki|
|00001520| 6c 79 20 6d 6f 73 74 20 | 61 72 65 20 73 65 6c 66 |ly most |are self|
|00001530| 2d 65 78 70 6c 61 6e 61 | 74 6f 72 79 2e 0a 58 4d |-explana|tory..XM|
|00001540| 6f 73 74 20 6f 66 20 74 | 68 65 73 65 20 6d 65 73 |ost of t|hese mes|
|00001550| 73 61 67 65 73 20 61 72 | 65 20 66 6f 6c 6c 6f 77 |sages ar|e follow|
|00001560| 65 64 20 62 79 20 61 20 | 6d 6f 72 65 20 73 70 65 |ed by a |more spe|
|00001570| 63 69 66 69 63 20 65 78 | 70 6c 61 6e 61 74 69 6f |cific ex|planatio|
|00001580| 6e 0a 58 6f 66 20 74 68 | 65 20 72 65 61 73 6f 6e |n.Xof th|e reason|
|00001590| 20 66 6f 72 20 74 68 65 | 20 65 72 72 6f 72 3b 20 | for the| error; |
|000015a0| 74 68 69 73 20 6c 69 73 | 74 20 64 6f 65 73 20 6e |this lis|t does n|
|000015b0| 6f 74 20 63 6f 6e 74 61 | 69 6e 20 61 6c 6c 20 74 |ot conta|in all t|
|000015c0| 68 65 0a 58 70 6f 73 73 | 69 62 6c 65 20 76 61 72 |he.Xposs|ible var|
|000015d0| 69 61 74 69 6f 6e 73 2e | 0a 58 2e 54 50 0a 58 5c |iations.|.X.TP.X\|
|000015e0| 66 49 66 61 74 61 6c 3a | 20 63 61 6e 6e 6f 74 20 |fIfatal:| cannot |
|000015f0| 63 72 65 61 74 65 20 6f | 75 74 70 75 74 20 66 69 |create o|utput fi|
|00001600| 6c 65 20 6e 61 6d 65 3a | 20 6f 75 74 20 6f 66 20 |le name:| out of |
|00001610| 6d 65 6d 6f 72 79 5c 66 | 42 0a 58 54 68 65 72 65 |memory\f|B.XThere|
|00001620| 20 69 73 20 73 6f 20 6c | 69 74 74 6c 65 20 6d 65 | is so l|ittle me|
|00001630| 6d 6f 72 79 20 61 76 61 | 69 6c 61 62 6c 65 20 74 |mory ava|ilable t|
|00001640| 68 61 74 0a 58 5c 66 49 | 66 69 6c 74 65 72 66 69 |hat.X\fI|filterfi|
|00001650| 6c 65 5c 66 42 0a 58 63 | 61 6e 6e 6f 74 20 65 76 |le\fB.Xc|annot ev|
|00001660| 65 6e 20 70 75 74 20 74 | 6f 67 65 74 68 65 72 20 |en put t|ogether |
|00001670| 74 68 65 20 69 6e 70 75 | 74 20 66 69 6c 65 20 6e |the inpu|t file n|
|00001680| 61 6d 65 20 61 6e 64 20 | 65 78 74 65 6e 73 69 6f |ame and |extensio|
|00001690| 6e 0a 58 74 6f 20 6d 61 | 6b 65 20 74 68 65 20 6f |n.Xto ma|ke the o|
|000016a0| 75 74 70 75 74 20 66 69 | 6c 65 20 6e 61 6d 65 2e |utput fi|le name.|
|000016b0| 0a 58 2e 54 50 0a 58 5c | 66 49 66 61 74 61 6c 3a |.X.TP.X\|fIfatal:|
|000016c0| 20 77 69 6c 6c 20 6e 6f | 74 20 70 72 6f 63 65 65 | will no|t procee|
|000016d0| 64 3a 20 69 6e 70 75 74 | 20 66 69 6c 65 20 68 61 |d: input| file ha|
|000016e0| 73 20 65 78 74 72 61 20 | 6c 69 6e 6b 73 5c 66 42 |s extra |links\fB|
|000016f0| 0a 58 59 6f 75 20 68 61 | 76 65 20 61 73 6b 65 64 |.XYou ha|ve asked|
|00001700| 20 74 68 61 74 20 74 68 | 65 20 69 6e 70 75 74 20 | that th|e input |
|00001710| 66 69 6c 65 20 62 65 20 | 64 65 6c 65 74 65 64 2c |file be |deleted,|
|00001720| 20 62 75 74 20 69 74 0a | 58 68 61 73 20 6d 6f 72 | but it.|Xhas mor|
|00001730| 65 20 74 68 61 6e 20 6f | 6e 65 20 6c 69 6e 6b 2e |e than o|ne link.|
|00001740| 0a 58 2e 54 50 0a 58 5c | 66 49 77 61 72 6e 69 6e |.X.TP.X\|fIwarnin|
|00001750| 67 3a 20 63 61 6e 6e 6f | 74 20 63 68 61 6e 67 65 |g: canno|t change|
|00001760| 20 70 72 6f 74 65 63 74 | 69 6f 6e 73 20 6f 66 20 | protect|ions of |
|00001770| 6f 75 74 70 75 74 20 66 | 69 6c 65 5c 66 42 0a 58 |output f|ile\fB.X|
|00001780| 54 68 69 73 20 73 68 6f | 75 6c 64 20 6e 65 76 65 |This sho|uld neve|
|00001790| 72 20 68 61 70 70 65 6e | 2c 0a 58 75 6e 6c 65 73 |r happen|,.Xunles|
|000017a0| 73 20 74 68 65 20 66 69 | 6c 65 20 63 68 61 6e 67 |s the fi|le chang|
|000017b0| 65 73 20 74 6f 20 73 6f | 6d 65 6f 6e 65 20 65 6c |es to so|meone el|
|000017c0| 73 65 27 73 20 6f 77 6e | 65 72 73 68 69 70 2e 0a |se's own|ership..|
|000017d0| 58 2e 54 50 0a 58 5c 66 | 49 66 61 74 61 6c 3a 20 |X.TP.X\f|Ifatal: |
|000017e0| 63 61 6e 6e 6f 74 20 65 | 78 65 63 75 74 65 20 66 |cannot e|xecute f|
|000017f0| 69 6c 74 65 72 5c 66 42 | 0a 58 5c 66 49 66 69 6c |ilter\fB|.X\fIfil|
|00001800| 74 65 72 66 69 6c 65 5c | 66 42 0a 58 69 73 20 75 |terfile\|fB.Xis u|
|00001810| 6e 61 62 6c 65 20 74 6f | 20 65 78 65 63 75 74 65 |nable to| execute|
|00001820| 20 74 68 65 20 66 69 6c | 74 65 72 2e 0a 58 2e 54 | the fil|ter..X.T|
|00001830| 50 0a 58 5c 66 49 66 61 | 74 61 6c 3a 20 63 61 6e |P.X\fIfa|tal: can|
|00001840| 6e 6f 74 20 66 6f 72 6b | 5c 66 42 0a 58 59 6f 75 |not fork|\fB.XYou|
|00001850| 20 68 61 76 65 20 70 72 | 6f 62 61 62 6c 79 20 72 | have pr|obably r|
|00001860| 75 6e 20 6f 75 74 20 6f | 66 20 70 72 6f 63 65 73 |un out o|f proces|
|00001870| 73 65 73 2e 0a 58 2e 54 | 50 0a 58 5c 66 49 66 61 |ses..X.T|P.X\fIfa|
|00001880| 74 61 6c 3a 20 63 61 6e | 6e 6f 74 20 72 65 6f 70 |tal: can|not reop|
|00001890| 65 6e 20 69 6e 70 75 74 | 20 66 69 6c 65 5c 66 42 |en input| file\fB|
|000018a0| 0a 58 5c 66 49 66 69 6c | 74 65 72 66 69 6c 65 5c |.X\fIfil|terfile\|
|000018b0| 66 42 0a 58 69 73 20 75 | 6e 61 62 6c 65 20 74 6f |fB.Xis u|nable to|
|000018c0| 20 6f 70 65 6e 20 74 68 | 65 20 69 6e 70 75 74 20 | open th|e input |
|000018d0| 66 69 6c 65 20 61 74 20 | 69 74 73 20 6f 72 69 67 |file at |its orig|
|000018e0| 69 6e 61 6c 20 6c 6f 63 | 61 74 69 6f 6e 2e 0a 58 |inal loc|ation..X|
|000018f0| 2e 54 50 0a 58 5c 66 49 | 66 61 74 61 6c 3a 20 63 |.TP.X\fI|fatal: c|
|00001900| 61 6e 6e 6f 74 20 72 65 | 6f 70 65 6e 20 6f 75 74 |annot re|open out|
|00001910| 70 75 74 20 66 69 6c 65 | 5c 66 42 0a 58 5c 66 49 |put file|\fB.X\fI|
|00001920| 66 69 6c 74 65 72 66 69 | 6c 65 5c 66 42 0a 58 69 |filterfi|le\fB.Xi|
|00001930| 73 20 75 6e 61 62 6c 65 | 20 74 6f 20 6f 70 65 6e |s unable| to open|
|00001940| 20 74 68 65 20 6f 75 74 | 70 75 74 20 66 69 6c 65 | the out|put file|
|00001950| 20 61 74 20 69 74 73 20 | 6f 72 69 67 69 6e 61 6c | at its |original|
|00001960| 20 6c 6f 63 61 74 69 6f | 6e 2e 0a 58 2e 50 50 0a | locatio|n..X.PP.|
|00001970| 58 54 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 65 |XThe fol|lowing e|
|00001980| 72 72 6f 72 73 20 73 68 | 6f 75 6c 64 20 61 6c 6c |rrors sh|ould all|
|00001990| 20 62 65 20 73 65 6c 66 | 2d 65 78 70 6c 61 6e 61 | be self|-explana|
|000019a0| 74 6f 72 79 3a 0a 58 2e | 54 50 0a 58 5c 66 49 66 |tory:.X.|TP.X\fIf|
|000019b0| 61 74 61 6c 3a 20 63 61 | 6e 6e 6f 74 20 6f 70 65 |atal: ca|nnot ope|
|000019c0| 6e 20 69 6e 70 75 74 20 | 66 69 6c 65 5c 66 42 0a |n input |file\fB.|
|000019d0| 58 2e 54 50 0a 58 5c 66 | 49 66 61 74 61 6c 3a 20 |X.TP.X\f|Ifatal: |
|000019e0| 63 61 6e 6e 6f 74 20 63 | 72 65 61 74 65 20 6f 75 |cannot c|reate ou|
|000019f0| 74 70 75 74 20 66 69 6c | 65 5c 66 42 0a 58 2e 54 |tput fil|e\fB.X.T|
|00001a00| 50 0a 58 5c 66 49 66 61 | 74 61 6c 3a 20 77 69 6c |P.X\fIfa|tal: wil|
|00001a10| 6c 20 6e 6f 74 20 64 65 | 6c 65 74 65 20 69 6e 70 |l not de|lete inp|
|00001a20| 75 74 20 66 69 6c 65 3a | 20 69 74 20 68 61 73 20 |ut file:| it has |
|00001a30| 62 65 65 6e 20 6d 6f 76 | 65 64 5c 66 42 0a 58 2e |been mov|ed\fB.X.|
|00001a40| 54 50 0a 58 5c 66 49 66 | 61 74 61 6c 3a 20 77 69 |TP.X\fIf|atal: wi|
|00001a50| 6c 6c 20 6e 6f 74 20 64 | 65 6c 65 74 65 20 69 6e |ll not d|elete in|
|00001a60| 70 75 74 20 66 69 6c 65 | 3a 20 69 74 20 68 61 73 |put file|: it has|
|00001a70| 20 65 78 74 72 61 20 6c | 69 6e 6b 73 5c 66 42 0a | extra l|inks\fB.|
|00001a80| 58 2e 54 50 0a 58 5c 66 | 49 66 61 74 61 6c 3a 20 |X.TP.X\f|Ifatal: |
|00001a90| 63 61 6e 6e 6f 74 20 64 | 65 6c 65 74 65 20 69 6e |cannot d|elete in|
|00001aa0| 70 75 74 20 66 69 6c 65 | 5c 66 42 0a 58 2e 54 50 |put file|\fB.X.TP|
|00001ab0| 0a 58 5c 66 49 77 61 72 | 6e 69 6e 67 3a 20 77 69 |.X\fIwar|ning: wi|
|00001ac0| 6c 6c 20 6e 6f 74 20 73 | 65 74 20 74 69 6d 65 73 |ll not s|et times|
|00001ad0| 20 6f 66 20 6f 75 74 70 | 75 74 20 66 69 6c 65 3a | of outp|ut file:|
|00001ae0| 20 69 74 20 68 61 73 20 | 62 65 65 6e 20 6d 6f 76 | it has |been mov|
|00001af0| 65 64 5c 66 42 0a 58 2e | 54 50 0a 58 5c 66 49 77 |ed\fB.X.|TP.X\fIw|
|00001b00| 61 72 6e 69 6e 67 3a 20 | 63 61 6e 6e 6f 74 20 73 |arning: |cannot s|
|00001b10| 65 74 20 74 69 6d 65 73 | 20 6f 66 20 6f 75 74 70 |et times| of outp|
|00001b20| 75 74 20 66 69 6c 65 5c | 66 42 0a 58 2e 50 50 0a |ut file\|fB.X.PP.|
|00001b30| 58 54 68 65 72 65 20 61 | 72 65 20 73 65 76 65 72 |XThere a|re sever|
|00001b40| 61 6c 20 65 72 72 6f 72 | 73 20 74 68 61 74 20 73 |al error|s that s|
|00001b50| 68 6f 75 6c 64 20 6e 65 | 76 65 72 20 68 61 70 70 |hould ne|ver happ|
|00001b60| 65 6e 3a 0a 58 2e 54 50 | 0a 58 5c 66 49 66 61 74 |en:.X.TP|.X\fIfat|
|00001b70| 61 6c 3a 20 63 61 6e 6e | 6f 74 20 73 74 61 74 20 |al: cann|ot stat |
|00001b80| 69 6e 70 75 74 20 66 69 | 6c 65 5c 66 42 0a 58 2e |input fi|le\fB.X.|
|00001b90| 54 50 0a 58 5c 66 49 66 | 61 74 61 6c 3a 20 63 61 |TP.X\fIf|atal: ca|
|00001ba0| 6e 6e 6f 74 20 73 74 61 | 74 20 6f 75 74 70 75 74 |nnot sta|t output|
|00001bb0| 20 66 69 6c 65 5c 66 42 | 0a 58 2e 54 50 0a 58 5c | file\fB|.X.TP.X\|
|00001bc0| 66 49 66 61 74 61 6c 3a | 20 63 61 6e 6e 6f 74 20 |fIfatal:| cannot |
|00001bd0| 70 72 65 70 61 72 65 20 | 69 6e 70 75 74 5c 66 42 |prepare |input\fB|
|00001be0| 0a 58 2e 54 50 0a 58 5c | 66 49 66 61 74 61 6c 3a |.X.TP.X\|fIfatal:|
|00001bf0| 20 63 61 6e 6e 6f 74 20 | 70 72 65 70 61 72 65 20 | cannot |prepare |
|00001c00| 6f 75 74 70 75 74 5c 66 | 42 0a 58 2e 54 50 0a 58 |output\f|B.X.TP.X|
|00001c10| 5c 66 49 66 61 74 61 6c | 3a 20 63 61 6e 27 74 20 |\fIfatal|: can't |
|00001c20| 66 69 6e 64 20 66 69 6c | 74 65 72 20 70 72 6f 63 |find fil|ter proc|
|00001c30| 65 73 73 5c 66 42 0a 58 | 2e 54 50 0a 58 5c 66 49 |ess\fB.X|.TP.X\fI|
|00001c40| 66 61 74 61 6c 3a 20 63 | 61 6e 6e 6f 74 20 72 65 |fatal: c|annot re|
|00001c50| 73 74 61 74 20 69 6e 70 | 75 74 20 66 69 6c 65 5c |stat inp|ut file\|
|00001c60| 66 42 0a 58 2e 54 50 0a | 58 5c 66 49 66 61 74 61 |fB.X.TP.|X\fIfata|
|00001c70| 6c 3a 20 63 61 6e 6e 6f | 74 20 72 65 73 74 61 74 |l: canno|t restat|
|00001c80| 20 6f 75 74 70 75 74 20 | 66 69 6c 65 5c 66 42 0a | output |file\fB.|
|00001c90| 58 2e 53 48 20 4d 41 43 | 48 49 4e 45 53 0a 58 5c |X.SH MAC|HINES.X\|
|00001ca0| 66 49 66 69 6c 74 65 72 | 66 69 6c 65 5c 66 42 0a |fIfilter|file\fB.|
|00001cb0| 58 68 61 73 20 62 65 65 | 6e 20 74 65 73 74 65 64 |Xhas bee|n tested|
|00001cc0| 0a 58 6f 6e 20 61 6e 20 | 41 73 74 72 6f 6e 61 75 |.Xon an |Astronau|
|00001cd0| 74 69 63 73 20 5a 53 2d | 32 0a 58 72 75 6e 6e 69 |tics ZS-|2.Xrunni|
|00001ce0| 6e 67 20 5a 53 55 6e 69 | 78 2e 0a 58 2e 53 48 20 |ng ZSUni|x..X.SH |
|00001cf0| 46 49 4c 45 53 0a 58 4e | 6f 6e 65 2e 0a 58 2e 53 |FILES.XN|one..X.S|
|00001d00| 48 20 42 55 47 53 0a 58 | 4e 6f 6e 65 20 6b 6e 6f |H BUGS.X|None kno|
|00001d10| 77 6e 2e 0a 58 2e 53 48 | 20 52 45 53 54 52 49 43 |wn..X.SH| RESTRIC|
|00001d20| 54 49 4f 4e 53 0a 58 5c | 66 49 66 69 6c 74 65 72 |TIONS.X\|fIfilter|
|00001d30| 66 69 6c 65 5c 66 42 0a | 58 74 72 69 65 73 20 69 |file\fB.|Xtries i|
|00001d40| 74 73 20 62 65 73 74 20 | 74 6f 20 64 65 74 65 63 |ts best |to detec|
|00001d50| 74 20 77 68 65 6e 20 61 | 20 66 69 6c 65 20 68 61 |t when a| file ha|
|00001d60| 73 20 62 65 65 6e 20 6d | 6f 76 65 64 2c 0a 58 73 |s been m|oved,.Xs|
|00001d70| 6f 20 74 68 61 74 20 69 | 74 20 77 6f 6e 27 74 20 |o that i|t won't |
|00001d80| 64 65 6c 65 74 65 20 74 | 68 65 20 77 72 6f 6e 67 |delete t|he wrong|
|00001d90| 20 66 69 6c 65 20 6f 72 | 20 63 68 61 6e 67 65 20 | file or| change |
|00001da0| 74 68 65 20 74 69 6d 65 | 73 20 6f 66 0a 58 74 68 |the time|s of.Xth|
|00001db0| 65 20 77 72 6f 6e 67 20 | 66 69 6c 65 2e 20 49 74 |e wrong |file. It|
|00001dc0| 20 61 6c 73 6f 20 74 72 | 69 65 73 20 74 6f 20 64 | also tr|ies to d|
|00001dd0| 65 74 65 63 74 20 77 68 | 65 6e 20 74 68 65 20 69 |etect wh|en the i|
|00001de0| 6e 70 75 74 20 66 69 6c | 65 0a 58 68 61 73 20 73 |nput fil|e.Xhas s|
|00001df0| 65 76 65 72 61 6c 20 6c | 69 6e 6b 73 2c 20 69 6e |everal l|inks, in|
|00001e00| 20 77 68 69 63 68 20 63 | 61 73 65 20 69 74 20 64 | which c|ase it d|
|00001e10| 6f 65 73 20 6e 6f 74 20 | 65 76 65 6e 20 74 72 79 |oes not |even try|
|00001e20| 20 74 6f 20 64 65 6c 65 | 74 65 0a 58 74 68 65 20 | to dele|te.Xthe |
|00001e30| 66 69 6c 65 2e 20 55 6e | 66 6f 72 74 75 6e 61 74 |file. Un|fortunat|
|00001e40| 65 6c 79 2c 20 74 68 65 | 72 65 20 69 73 20 61 20 |ely, the|re is a |
|00001e50| 76 65 72 79 20 73 68 6f | 72 74 20 70 65 72 69 6f |very sho|rt perio|
|00001e60| 64 20 6f 66 20 74 69 6d | 65 0a 58 62 65 74 77 65 |d of tim|e.Xbetwe|
|00001e70| 65 6e 20 74 68 65 73 65 | 20 74 65 73 74 73 20 61 |en these| tests a|
|00001e80| 6e 64 20 74 68 65 20 61 | 63 74 75 61 6c 20 6f 70 |nd the a|ctual op|
|00001e90| 65 72 61 74 69 6f 6e 73 | 2c 20 73 6f 0a 58 5c 66 |erations|, so.X\f|
|00001ea0| 49 66 69 6c 74 65 72 66 | 69 6c 65 5c 66 42 0a 58 |Ifilterf|ile\fB.X|
|00001eb0| 63 6f 75 6c 64 20 65 6e | 74 65 72 20 61 20 28 6e |could en|ter a (n|
|00001ec0| 6f 6e 2d 6c 6f 6f 70 69 | 6e 67 29 20 72 61 63 65 |on-loopi|ng) race|
|00001ed0| 20 63 6f 6e 64 69 74 69 | 6f 6e 20 61 6e 64 20 61 | conditi|on and a|
|00001ee0| 63 74 20 69 6e 63 6f 72 | 72 65 63 74 6c 79 2e 0a |ct incor|rectly..|
|00001ef0| 58 54 68 65 72 65 20 69 | 73 20 6e 6f 20 77 61 79 |XThere i|s no way|
|00001f00| 20 74 6f 20 61 76 6f 69 | 64 20 74 68 69 73 20 72 | to avoi|d this r|
|00001f10| 61 63 65 20 77 69 74 68 | 20 61 76 61 69 6c 61 62 |ace with| availab|
|00001f20| 6c 65 20 76 65 72 73 69 | 6f 6e 73 20 6f 66 20 55 |le versi|ons of U|
|00001f30| 4e 49 58 2e 0a 58 2e 50 | 50 0a 58 49 6e 20 6f 74 |NIX..X.P|P.XIn ot|
|00001f40| 68 65 72 20 77 6f 72 64 | 73 2c 20 69 66 20 79 6f |her word|s, if yo|
|00001f50| 75 20 6d 6f 76 65 20 74 | 68 65 20 69 6e 70 75 74 |u move t|he input|
|00001f60| 20 66 69 6c 65 20 6f 75 | 74 20 6f 66 20 74 68 65 | file ou|t of the|
|00001f70| 20 77 61 79 20 61 6e 64 | 20 67 69 76 65 0a 58 61 | way and| give.Xa|
|00001f80| 20 64 69 66 66 65 72 65 | 6e 74 20 66 69 6c 65 20 | differe|nt file |
|00001f90| 74 68 65 20 73 61 6d 65 | 20 6e 61 6d 65 2c 20 74 |the same| name, t|
|00001fa0| 68 65 20 6d 6f 6d 65 6e | 74 20 62 65 66 6f 72 65 |he momen|t before|
|00001fb0| 0a 58 5c 66 49 66 69 6c | 74 65 72 66 69 6c 65 5c |.X\fIfil|terfile\|
|00001fc0| 66 42 0a 58 72 65 6d 6f | 76 65 73 20 74 68 61 74 |fB.Xremo|ves that|
|00001fd0| 20 66 69 6c 65 6e 61 6d | 65 2c 0a 58 79 6f 75 20 | filenam|e,.Xyou |
|00001fe0| 64 65 73 65 72 76 65 20 | 77 68 61 74 20 79 6f 75 |deserve |what you|
|00001ff0| 20 67 65 74 2e 0a 58 2e | 53 48 20 56 45 52 53 49 | get..X.|SH VERSI|
|00002000| 4f 4e 0a 58 66 69 6c 74 | 65 72 66 69 6c 65 20 76 |ON.Xfilt|erfile v|
|00002010| 65 72 73 69 6f 6e 20 31 | 2e 32 30 31 2c 20 64 61 |ersion 1|.201, da|
|00002020| 74 65 64 20 4f 63 74 6f | 62 65 72 20 32 38 2c 20 |ted Octo|ber 28, |
|00002030| 31 39 38 39 2e 0a 58 2e | 53 48 20 41 55 54 48 4f |1989..X.|SH AUTHO|
|00002040| 52 0a 58 43 6f 70 79 72 | 69 67 68 74 20 31 39 38 |R.XCopyr|ight 198|
|00002050| 39 2c 20 44 61 6e 69 65 | 6c 20 4a 2e 20 42 65 72 |9, Danie|l J. Ber|
|00002060| 6e 73 74 65 69 6e 2e 0a | 58 2e 53 48 20 22 53 45 |nstein..|X.SH "SE|
|00002070| 45 20 41 4c 53 4f 22 0a | 58 61 70 70 6c 79 28 31 |E ALSO".|Xapply(1|
|00002080| 29 2c 0a 58 78 61 72 67 | 73 28 31 29 0a 45 4e 44 |),.Xxarg|s(1).END|
|00002090| 5f 4f 46 5f 46 49 4c 45 | 0a 69 66 20 74 65 73 74 |_OF_FILE|.if test|
|000020a0| 20 34 39 36 38 20 2d 6e | 65 20 60 77 63 20 2d 63 | 4968 -n|e `wc -c|
|000020b0| 20 3c 27 66 69 6c 74 65 | 72 66 69 6c 65 2e 6d 61 | <'filte|rfile.ma|
|000020c0| 6e 27 60 3b 20 74 68 65 | 6e 0a 20 20 20 20 65 63 |n'`; the|n. ec|
|000020d0| 68 6f 20 73 68 61 72 3a | 20 5c 22 27 66 69 6c 74 |ho shar:| \"'filt|
|000020e0| 65 72 66 69 6c 65 2e 6d | 61 6e 27 5c 22 20 75 6e |erfile.m|an'\" un|
|000020f0| 70 61 63 6b 65 64 20 77 | 69 74 68 20 77 72 6f 6e |packed w|ith wron|
|00002100| 67 20 73 69 7a 65 21 0a | 66 69 0a 23 20 65 6e 64 |g size!.|fi.# end|
|00002110| 20 6f 66 20 27 66 69 6c | 74 65 72 66 69 6c 65 2e | of 'fil|terfile.|
|00002120| 6d 61 6e 27 0a 66 69 0a | 69 66 20 74 65 73 74 20 |man'.fi.|if test |
|00002130| 2d 66 20 27 66 69 6c 74 | 65 72 66 69 6c 65 2e 63 |-f 'filt|erfile.c|
|00002140| 27 20 2d 61 20 22 24 7b | 31 7d 22 20 21 3d 20 22 |' -a "${|1}" != "|
|00002150| 2d 63 22 20 3b 20 74 68 | 65 6e 20 0a 20 20 65 63 |-c" ; th|en . ec|
|00002160| 68 6f 20 73 68 61 72 3a | 20 57 69 6c 6c 20 6e 6f |ho shar:| Will no|
|00002170| 74 20 63 6c 6f 62 62 65 | 72 20 65 78 69 73 74 69 |t clobbe|r existi|
|00002180| 6e 67 20 66 69 6c 65 20 | 5c 22 27 66 69 6c 74 65 |ng file |\"'filte|
|00002190| 72 66 69 6c 65 2e 63 27 | 5c 22 0a 65 6c 73 65 0a |rfile.c'|\".else.|
|000021a0| 65 63 68 6f 20 73 68 61 | 72 3a 20 45 78 74 72 61 |echo sha|r: Extra|
|000021b0| 63 74 69 6e 67 20 5c 22 | 27 66 69 6c 74 65 72 66 |cting \"|'filterf|
|000021c0| 69 6c 65 2e 63 27 5c 22 | 20 5c 28 39 33 30 33 20 |ile.c'\"| \(9303 |
|000021d0| 63 68 61 72 61 63 74 65 | 72 73 5c 29 0a 73 65 64 |characte|rs\).sed|
|000021e0| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 27 66 69 6c 74 | "s/^X//|" >'filt|
|000021f0| 65 72 66 69 6c 65 2e 63 | 27 20 3c 3c 27 45 4e 44 |erfile.c|' <<'END|
|00002200| 5f 4f 46 5f 46 49 4c 45 | 27 0a 58 2f 2a 0a 58 66 |_OF_FILE|'.X/*.Xf|
|00002210| 69 6c 74 65 72 66 69 6c | 65 2e 63 3a 20 50 69 70 |ilterfil|e.c: Pip|
|00002220| 65 20 61 20 66 69 6c 65 | 20 74 68 72 6f 75 67 68 |e a file| through|
|00002230| 20 61 20 66 69 6c 74 65 | 72 20 69 6e 74 6f 20 61 | a filte|r into a|
|00002240| 6e 6f 74 68 65 72 20 66 | 69 6c 65 2e 0a 58 0a 58 |nother f|ile..X.X|
|00002250| 54 68 69 73 20 70 72 6f | 67 72 61 6d 20 69 73 20 |This pro|gram is |
|00002260| 61 6e 20 6f 62 6e 6f 78 | 69 6f 75 73 20 65 78 61 |an obnox|ious exa|
|00002270| 6d 70 6c 65 20 6f 66 20 | 68 6f 77 20 74 6f 20 63 |mple of |how to c|
|00002280| 68 65 63 6b 20 72 65 74 | 75 72 6e 20 63 6f 64 65 |heck ret|urn code|
|00002290| 73 2e 0a 58 2a 2f 0a 58 | 0a 58 73 74 61 74 69 63 |s..X*/.X|.Xstatic|
|000022a0| 20 63 68 61 72 20 66 69 | 6c 74 65 72 66 69 6c 65 | char fi|lterfile|
|000022b0| 61 75 74 68 6f 72 5b 5d | 20 3d 0a 58 22 66 69 6c |author[]| =.X"fil|
|000022c0| 74 65 72 66 69 6c 65 20 | 77 61 73 20 77 72 69 74 |terfile |was writ|
|000022d0| 74 65 6e 20 62 79 20 44 | 61 6e 69 65 6c 20 4a 2e |ten by D|aniel J.|
|000022e0| 20 42 65 72 6e 73 74 65 | 69 6e 2e 5c 6e 5c 0a 58 | Bernste|in.\n\.X|
|000022f0| 49 6e 74 65 72 6e 65 74 | 20 61 64 64 72 65 73 73 |Internet| address|
|00002300| 3a 20 62 72 6e 73 74 6e | 64 40 61 63 66 31 30 2e |: brnstn|d@acf10.|
|00002310| 6e 79 75 2e 65 64 75 2e | 5c 6e 22 3b 0a 58 0a 58 |nyu.edu.|\n";.X.X|
|00002320| 73 74 61 74 69 63 20 63 | 68 61 72 20 66 69 6c 74 |static c|har filt|
|00002330| 65 72 66 69 6c 65 76 65 | 72 73 69 6f 6e 5b 5d 20 |erfileve|rsion[] |
|00002340| 3d 20 0a 58 22 66 69 6c | 74 65 72 66 69 6c 65 20 |= .X"fil|terfile |
|00002350| 76 65 72 73 69 6f 6e 20 | 31 2e 32 30 31 2c 20 4f |version |1.201, O|
|00002360| 63 74 6f 62 65 72 20 32 | 38 2c 20 31 39 38 39 2e |ctober 2|8, 1989.|
|00002370| 5c 6e 5c 0a 58 43 6f 70 | 79 72 69 67 68 74 20 28 |\n\.XCop|yright (|
|00002380| 63 29 20 31 39 38 39 2c | 20 44 61 6e 69 65 6c 20 |c) 1989,| Daniel |
|00002390| 4a 2e 20 42 65 72 6e 73 | 74 65 69 6e 2e 5c 6e 5c |J. Berns|tein.\n\|
|000023a0| 0a 58 41 6c 6c 20 72 69 | 67 68 74 73 20 72 65 73 |.XAll ri|ghts res|
|000023b0| 65 72 76 65 64 2e 5c 6e | 22 3b 0a 58 0a 58 73 74 |erved.\n|";.X.Xst|
|000023c0| 61 74 69 63 20 63 68 61 | 72 20 66 69 6c 74 65 72 |atic cha|r filter|
|000023d0| 66 69 6c 65 63 6f 70 79 | 72 69 67 68 74 5b 5d 20 |filecopy|right[] |
|000023e0| 3d 0a 58 22 66 69 6c 74 | 65 72 66 69 6c 65 20 76 |=.X"filt|erfile v|
|000023f0| 65 72 73 69 6f 6e 20 31 | 2e 32 30 31 2c 20 4f 63 |ersion 1|.201, Oc|
|00002400| 74 6f 62 65 72 20 32 38 | 2c 20 31 39 38 39 2e 5c |tober 28|, 1989.\|
|00002410| 6e 5c 0a 58 43 6f 70 79 | 72 69 67 68 74 20 28 63 |n\.XCopy|right (c|
|00002420| 29 20 31 39 38 39 2c 20 | 44 61 6e 69 65 6c 20 4a |) 1989, |Daniel J|
|00002430| 2e 20 42 65 72 6e 73 74 | 65 69 6e 2e 5c 6e 5c 0a |. Bernst|ein.\n\.|
|00002440| 58 41 6c 6c 20 72 69 67 | 68 74 73 20 72 65 73 65 |XAll rig|hts rese|
|00002450| 72 76 65 64 2e 5c 6e 5c | 0a 58 5c 6e 5c 0a 58 59 |rved.\n\|.X\n\.XY|
|00002460| 6f 75 20 61 72 65 20 67 | 72 61 6e 74 65 64 20 74 |ou are g|ranted t|
|00002470| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 72 69 67 |he follo|wing rig|
|00002480| 68 74 73 3a 20 41 2e 20 | 54 6f 20 6d 61 6b 65 20 |hts: A. |To make |
|00002490| 63 6f 70 69 65 73 20 6f | 66 20 74 68 69 73 20 77 |copies o|f this w|
|000024a0| 6f 72 6b 20 69 6e 5c 6e | 5c 0a 58 6f 72 69 67 69 |ork in\n|\.Xorigi|
|000024b0| 6e 61 6c 20 66 6f 72 6d | 2c 20 73 6f 20 6c 6f 6e |nal form|, so lon|
|000024c0| 67 20 61 73 20 28 31 29 | 20 74 68 65 20 63 6f 70 |g as (1)| the cop|
|000024d0| 69 65 73 20 61 72 65 20 | 65 78 61 63 74 20 61 6e |ies are |exact an|
|000024e0| 64 20 63 6f 6d 70 6c 65 | 74 65 3b 20 28 32 29 20 |d comple|te; (2) |
|000024f0| 74 68 65 5c 6e 5c 0a 58 | 63 6f 70 69 65 73 20 69 |the\n\.X|copies i|
|00002500| 6e 63 6c 75 64 65 20 74 | 68 65 20 63 6f 70 79 72 |nclude t|he copyr|
|00002510| 69 67 68 74 20 6e 6f 74 | 69 63 65 2c 20 74 68 69 |ight not|ice, thi|
|00002520| 73 20 70 61 72 61 67 72 | 61 70 68 2c 20 61 6e 64 |s paragr|aph, and|
|00002530| 20 74 68 65 20 64 69 73 | 63 6c 61 69 6d 65 72 5c | the dis|claimer\|
|00002540| 6e 5c 0a 58 6f 66 20 77 | 61 72 72 61 6e 74 79 20 |n\.Xof w|arranty |
|00002550| 69 6e 20 74 68 65 69 72 | 20 65 6e 74 69 72 65 74 |in their| entiret|
|00002560| 79 2e 20 42 2e 20 54 6f | 20 64 69 73 74 72 69 62 |y. B. To| distrib|
|00002570| 75 74 65 20 74 68 69 73 | 20 77 6f 72 6b 2c 20 6f |ute this| work, o|
|00002580| 72 20 63 6f 70 69 65 73 | 20 6d 61 64 65 5c 6e 5c |r copies| made\n\|
|00002590| 0a 58 75 6e 64 65 72 20 | 74 68 65 20 70 72 6f 76 |.Xunder |the prov|
|000025a0| 69 73 69 6f 6e 73 20 61 | 62 6f 76 65 2c 20 73 6f |isions a|bove, so|
|000025b0| 20 6c 6f 6e 67 20 61 73 | 20 28 31 29 20 74 68 69 | long as| (1) thi|
|000025c0| 73 20 69 73 20 74 68 65 | 20 6f 72 69 67 69 6e 61 |s is the| origina|
|000025d0| 6c 20 77 6f 72 6b 20 61 | 6e 64 5c 6e 5c 0a 58 6e |l work a|nd\n\.Xn|
|000025e0| 6f 74 20 61 20 64 65 72 | 69 76 61 74 69 76 65 20 |ot a der|ivative |
|000025f0| 66 6f 72 6d 3b 20 28 32 | 29 20 79 6f 75 20 64 6f |form; (2|) you do|
|00002600| 20 6e 6f 74 20 63 68 61 | 72 67 65 20 61 20 66 65 | not cha|rge a fe|
|00002610| 65 20 66 6f 72 20 63 6f | 70 79 69 6e 67 20 6f 72 |e for co|pying or|
|00002620| 20 66 6f 72 5c 6e 5c 0a | 58 64 69 73 74 72 69 62 | for\n\.|Xdistrib|
|00002630| 75 74 69 6f 6e 3b 20 28 | 33 29 20 79 6f 75 20 65 |ution; (|3) you e|
|00002640| 6e 73 75 72 65 20 74 68 | 61 74 20 74 68 65 20 64 |nsure th|at the d|
|00002650| 69 73 74 72 69 62 75 74 | 65 64 20 66 6f 72 6d 20 |istribut|ed form |
|00002660| 69 6e 63 6c 75 64 65 73 | 20 74 68 65 5c 6e 5c 0a |includes| the\n\.|
|00002670| 58 63 6f 70 79 72 69 67 | 68 74 20 6e 6f 74 69 63 |Xcopyrig|ht notic|
|00002680| 65 2c 20 74 68 69 73 20 | 70 61 72 61 67 72 61 70 |e, this |paragrap|
|00002690| 68 2c 20 61 6e 64 20 74 | 68 65 20 64 69 73 63 6c |h, and t|he discl|
|000026a0| 61 69 6d 65 72 20 6f 66 | 20 77 61 72 72 61 6e 74 |aimer of| warrant|
|000026b0| 79 20 69 6e 20 74 68 65 | 69 72 5c 6e 5c 0a 58 65 |y in the|ir\n\.Xe|
|000026c0| 6e 74 69 72 65 74 79 2e | 20 54 68 65 73 65 20 72 |ntirety.| These r|
|000026d0| 69 67 68 74 73 20 61 72 | 65 20 74 65 6d 70 6f 72 |ights ar|e tempor|
|000026e0| 61 72 79 20 61 6e 64 20 | 72 65 76 6f 63 61 62 6c |ary and |revocabl|
|000026f0| 65 20 75 70 6f 6e 20 77 | 72 69 74 74 65 6e 2c 20 |e upon w|ritten, |
|00002700| 6f 72 61 6c 2c 20 6f 72 | 5c 6e 5c 0a 58 6f 74 68 |oral, or|\n\.Xoth|
|00002710| 65 72 20 6e 6f 74 69 63 | 65 20 62 79 20 44 61 6e |er notic|e by Dan|
|00002720| 69 65 6c 20 4a 2e 20 42 | 65 72 6e 73 74 65 69 6e |iel J. B|ernstein|
|00002730| 2e 20 54 68 69 73 20 63 | 6f 70 79 72 69 67 68 74 |. This c|opyright|
|00002740| 20 6e 6f 74 69 63 65 20 | 73 68 61 6c 6c 20 62 65 | notice |shall be|
|00002750| 5c 6e 5c 0a 58 67 6f 76 | 65 72 6e 65 64 20 62 79 |\n\.Xgov|erned by|
|00002760| 20 74 68 65 20 6c 61 77 | 73 20 6f 66 20 74 68 65 | the law|s of the|
|00002770| 20 73 74 61 74 65 20 6f | 66 20 4e 65 77 20 59 6f | state o|f New Yo|
|00002780| 72 6b 2e 5c 6e 5c 0a 58 | 5c 6e 5c 0a 58 49 66 20 |rk.\n\.X|\n\.XIf |
|00002790| 79 6f 75 20 68 61 76 65 | 20 71 75 65 73 74 69 6f |you have| questio|
|000027a0| 6e 73 20 61 62 6f 75 74 | 20 66 69 6c 74 65 72 66 |ns about| filterf|
|000027b0| 69 6c 65 20 6f 72 20 61 | 62 6f 75 74 20 74 68 69 |ile or a|bout thi|
|000027c0| 73 20 63 6f 70 79 72 69 | 67 68 74 20 6e 6f 74 69 |s copyri|ght noti|
|000027d0| 63 65 2c 5c 6e 5c 0a 58 | 6f 72 20 69 66 20 79 6f |ce,\n\.X|or if yo|
|000027e0| 75 20 77 6f 75 6c 64 20 | 6c 69 6b 65 20 61 64 64 |u would |like add|
|000027f0| 69 74 69 6f 6e 61 6c 20 | 72 69 67 68 74 73 20 62 |itional |rights b|
|00002800| 65 79 6f 6e 64 20 74 68 | 6f 73 65 20 67 72 61 6e |eyond th|ose gran|
|00002810| 74 65 64 20 61 62 6f 76 | 65 2c 5c 6e 5c 0a 58 70 |ted abov|e,\n\.Xp|
|00002820| 6c 65 61 73 65 20 66 65 | 65 6c 20 66 72 65 65 20 |lease fe|el free |
|00002830| 74 6f 20 63 6f 6e 74 61 | 63 74 20 74 68 65 20 61 |to conta|ct the a|
|00002840| 75 74 68 6f 72 20 61 74 | 20 62 72 6e 73 74 6e 64 |uthor at| brnstnd|
|00002850| 40 61 63 66 31 30 2e 6e | 79 75 2e 65 64 75 5c 6e |@acf10.n|yu.edu\n|
|00002860| 5c 0a 58 6f 6e 20 74 68 | 65 20 49 6e 74 65 72 6e |\.Xon th|e Intern|
|00002870| 65 74 2e 5c 6e 22 3b 0a | 58 0a 58 73 74 61 74 69 |et.\n";.|X.Xstati|
|00002880| 63 20 63 68 61 72 20 66 | 69 6c 74 65 72 66 69 6c |c char f|ilterfil|
|00002890| 65 77 61 72 72 61 6e 74 | 79 5b 5d 20 3d 0a 58 22 |ewarrant|y[] =.X"|
|000028a0| 54 6f 20 74 68 65 20 65 | 78 74 65 6e 74 20 70 65 |To the e|xtent pe|
|000028b0| 72 6d 69 74 74 65 64 20 | 62 79 20 61 70 70 6c 69 |rmitted |by appli|
|000028c0| 63 61 62 6c 65 20 6c 61 | 77 2c 20 44 61 6e 69 65 |cable la|w, Danie|
|000028d0| 6c 20 4a 2e 20 42 65 72 | 6e 73 74 65 69 6e 20 64 |l J. Ber|nstein d|
|000028e0| 69 73 63 6c 61 69 6d 73 | 5c 6e 5c 0a 58 61 6c 6c |isclaims|\n\.Xall|
|000028f0| 20 77 61 72 72 61 6e 74 | 69 65 73 2c 20 65 78 70 | warrant|ies, exp|
|00002900| 6c 69 63 69 74 20 6f 72 | 20 69 6d 70 6c 69 65 64 |licit or| implied|
|00002910| 2c 20 69 6e 63 6c 75 64 | 69 6e 67 20 62 75 74 20 |, includ|ing but |
|00002920| 6e 6f 74 20 6c 69 6d 69 | 74 65 64 20 74 6f 20 74 |not limi|ted to t|
|00002930| 68 65 5c 6e 5c 0a 58 69 | 6d 70 6c 69 65 64 20 77 |he\n\.Xi|mplied w|
|00002940| 61 72 72 61 6e 74 69 65 | 73 20 6f 66 20 6d 65 72 |arrantie|s of mer|
|00002950| 63 68 61 6e 74 61 62 69 | 6c 69 74 79 20 61 6e 64 |chantabi|lity and|
|00002960| 20 66 69 74 6e 65 73 73 | 20 66 6f 72 20 61 20 70 | fitness| for a p|
|00002970| 61 72 74 69 63 75 6c 61 | 72 20 70 75 72 70 6f 73 |articula|r purpos|
|00002980| 65 2e 5c 6e 5c 0a 58 44 | 61 6e 69 65 6c 20 4a 2e |e.\n\.XD|aniel J.|
|00002990| 20 42 65 72 6e 73 74 65 | 69 6e 20 69 73 20 6e 6f | Bernste|in is no|
|000029a0| 74 20 61 6e 64 20 73 68 | 61 6c 6c 20 6e 6f 74 20 |t and sh|all not |
|000029b0| 62 65 20 6c 69 61 62 6c | 65 20 66 6f 72 20 61 6e |be liabl|e for an|
|000029c0| 79 20 64 61 6d 61 67 65 | 73 2c 5c 6e 5c 0a 58 69 |y damage|s,\n\.Xi|
|000029d0| 6e 63 69 64 65 6e 74 61 | 6c 20 6f 72 20 63 6f 6e |ncidenta|l or con|
|000029e0| 73 65 71 75 65 6e 74 69 | 61 6c 2c 20 61 72 69 73 |sequenti|al, aris|
|000029f0| 69 6e 67 20 66 72 6f 6d | 20 74 68 65 20 75 73 65 |ing from| the use|
|00002a00| 20 6f 66 20 74 68 69 73 | 20 70 72 6f 67 72 61 6d | of this| program|
|00002a10| 2c 20 65 76 65 6e 5c 6e | 5c 0a 58 69 66 20 79 6f |, even\n|\.Xif yo|
|00002a20| 75 20 69 6e 66 6f 72 6d | 20 68 69 6d 20 6f 66 20 |u inform| him of |
|00002a30| 74 68 65 20 70 6f 73 73 | 69 62 69 6c 69 74 79 20 |the poss|ibility |
|00002a40| 6f 66 20 73 75 63 68 20 | 64 61 6d 61 67 65 73 2e |of such |damages.|
|00002a50| 20 54 68 69 73 20 64 69 | 73 63 6c 61 69 6d 65 72 | This di|sclaimer|
|00002a60| 5c 6e 5c 0a 58 73 68 61 | 6c 6c 20 62 65 20 67 6f |\n\.Xsha|ll be go|
|00002a70| 76 65 72 6e 65 64 20 62 | 79 20 74 68 65 20 6c 61 |verned b|y the la|
|00002a80| 77 73 20 6f 66 20 74 68 | 65 20 73 74 61 74 65 20 |ws of th|e state |
|00002a90| 6f 66 20 4e 65 77 20 59 | 6f 72 6b 2e 5c 6e 5c 0a |of New Y|ork.\n\.|
|00002aa0| 58 5c 6e 5c 0a 58 49 6e | 20 6f 74 68 65 72 20 77 |X\n\.XIn| other w|
|00002ab0| 6f 72 64 73 2c 20 75 73 | 65 20 74 68 69 73 20 70 |ords, us|e this p|
|00002ac0| 72 6f 67 72 61 6d 20 61 | 74 20 79 6f 75 72 20 6f |rogram a|t your o|
|00002ad0| 77 6e 20 72 69 73 6b 2e | 5c 6e 5c 0a 58 5c 6e 5c |wn risk.|\n\.X\n\|
|00002ae0| 0a 58 49 66 20 79 6f 75 | 20 68 61 76 65 20 71 75 |.XIf you| have qu|
|00002af0| 65 73 74 69 6f 6e 73 20 | 61 62 6f 75 74 20 66 69 |estions |about fi|
|00002b00| 6c 74 65 72 66 69 6c 65 | 20 6f 72 20 61 62 6f 75 |lterfile| or abou|
|00002b10| 74 20 74 68 69 73 20 64 | 69 73 63 6c 61 69 6d 65 |t this d|isclaime|
|00002b20| 72 20 6f 66 20 77 61 72 | 72 61 6e 74 79 2c 5c 6e |r of war|ranty,\n|
|00002b30| 5c 0a 58 70 6c 65 61 73 | 65 20 66 65 65 6c 20 66 |\.Xpleas|e feel f|
|00002b40| 72 65 65 20 74 6f 20 63 | 6f 6e 74 61 63 74 20 74 |ree to c|ontact t|
|00002b50| 68 65 20 61 75 74 68 6f | 72 20 61 74 20 62 72 6e |he autho|r at brn|
|00002b60| 73 74 6e 64 40 61 63 66 | 31 30 2e 6e 79 75 2e 65 |stnd@acf|10.nyu.e|
|00002b70| 64 75 5c 6e 5c 0a 58 6f | 6e 20 74 68 65 20 49 6e |du\n\.Xo|n the In|
|00002b80| 74 65 72 6e 65 74 2e 5c | 6e 22 3b 0a 58 0a 58 73 |ternet.\|n";.X.Xs|
|00002b90| 74 61 74 69 63 20 63 68 | 61 72 20 66 69 6c 74 65 |tatic ch|ar filte|
|00002ba0| 72 66 69 6c 65 75 73 61 | 67 65 5b 5d 20 3d 0a 58 |rfileusa|ge[] =.X|
|00002bb0| 22 55 73 61 67 65 3a 20 | 66 69 6c 74 65 72 66 69 |"Usage: |filterfi|
|00002bc0| 6c 65 20 5b 20 2d 64 44 | 70 50 74 54 41 43 48 55 |le [ -dD|pPtTACHU|
|00002bd0| 56 57 20 5d 20 5b 20 2d | 6f 6f 75 74 20 5d 20 5b |VW ] [ -|oout ] [|
|00002be0| 20 2d 65 65 78 74 20 5d | 5c 6e 5c 0a 58 20 20 20 | -eext ]|\n\.X |
|00002bf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 66 | | f|
|00002c00| 69 6c 65 20 2f 70 61 74 | 68 2f 66 69 6c 74 65 72 |ile /pat|h/filter|
|00002c10| 20 5b 20 61 72 67 20 2e | 2e 2e 20 5d 5c 6e 5c 0a | [ arg .|.. ]\n\.|
|00002c20| 58 48 65 6c 70 3a 20 20 | 66 69 6c 74 65 72 66 69 |XHelp: |filterfi|
|00002c30| 6c 65 20 2d 48 5c 6e 22 | 3b 0a 58 0a 58 73 74 61 |le -H\n"|;.X.Xsta|
|00002c40| 74 69 63 20 63 68 61 72 | 20 66 69 6c 74 65 72 66 |tic char| filterf|
|00002c50| 69 6c 65 68 65 6c 70 5b | 5d 20 3d 0a 58 22 66 69 |ilehelp[|] =.X"fi|
|00002c60| 6c 74 65 72 66 69 6c 65 | 20 61 70 70 6c 69 65 73 |lterfile| applies|
|00002c70| 20 61 20 66 69 6c 74 65 | 72 20 74 6f 20 61 20 66 | a filte|r to a f|
|00002c80| 69 6c 65 2c 20 70 6c 61 | 63 69 6e 67 20 74 68 65 |ile, pla|cing the|
|00002c90| 20 6f 75 74 70 75 74 20 | 69 6e 20 61 20 6e 65 77 | output |in a new|
|00002ca0| 20 66 69 6c 65 2e 5c 6e | 5c 0a 58 5c 6e 5c 0a 58 | file.\n|\.X\n\.X|
|00002cb0| 66 69 6c 74 65 72 66 69 | 6c 65 20 2d 41 3a 20 70 |filterfi|le -A: p|
|00002cc0| 72 69 6e 74 20 61 75 74 | 68 6f 72 73 68 69 70 20 |rint aut|horship |
|00002cd0| 6e 6f 74 69 63 65 5c 6e | 5c 0a 58 66 69 6c 74 65 |notice\n|\.Xfilte|
|00002ce0| 72 66 69 6c 65 20 2d 43 | 3a 20 70 72 69 6e 74 20 |rfile -C|: print |
|00002cf0| 63 6f 70 79 72 69 67 68 | 74 20 6e 6f 74 69 63 65 |copyrigh|t notice|
|00002d00| 5c 6e 5c 0a 58 66 69 6c | 74 65 72 66 69 6c 65 20 |\n\.Xfil|terfile |
|00002d10| 2d 48 3a 20 70 72 69 6e | 74 20 74 68 69 73 20 6e |-H: prin|t this n|
|00002d20| 6f 74 69 63 65 5c 6e 5c | 0a 58 66 69 6c 74 65 72 |otice\n\|.Xfilter|
|00002d30| 66 69 6c 65 20 2d 55 3a | 20 70 72 69 6e 74 20 73 |file -U:| print s|
|00002d40| 68 6f 72 74 20 75 73 61 | 67 65 20 73 75 6d 6d 61 |hort usa|ge summa|
|00002d50| 72 79 5c 6e 5c 0a 58 66 | 69 6c 74 65 72 66 69 6c |ry\n\.Xf|ilterfil|
|00002d60| 65 20 2d 56 3a 20 70 72 | 69 6e 74 20 76 65 72 73 |e -V: pr|int vers|
|00002d70| 69 6f 6e 20 6e 75 6d 62 | 65 72 5c 6e 5c 0a 58 66 |ion numb|er\n\.Xf|
|00002d80| 69 6c 74 65 72 66 69 6c | 65 20 2d 57 3a 20 70 72 |ilterfil|e -W: pr|
|00002d90| 69 6e 74 20 64 69 73 63 | 6c 61 69 6d 65 72 20 6f |int disc|laimer o|
|00002da0| 66 20 77 61 72 72 61 6e | 74 79 5c 6e 5c 0a 58 5c |f warran|ty\n\.X\|
|00002db0| 6e 5c 0a 58 66 69 6c 74 | 65 72 66 69 6c 65 20 5b |n\.Xfilt|erfile [|
|00002dc0| 20 2d 64 44 70 50 74 54 | 20 5d 20 5b 20 2d 6f 6f | -dDpPtT| ] [ -oo|
|00002dd0| 75 74 20 5d 20 5b 20 2d | 65 65 78 74 20 5d 5c 6e |ut ] [ -|eext ]\n|
|00002de0| 5c 0a 58 20 20 20 20 20 | 20 20 20 20 20 20 66 69 |\.X | fi|
|00002df0| 6c 65 20 2f 70 61 74 68 | 2f 66 69 6c 74 65 72 20 |le /path|/filter |
|00002e00| 5b 20 61 72 67 20 2e 2e | 2e 20 5d 3a 20 61 70 70 |[ arg ..|. ]: app|
|00002e10| 6c 79 20 66 69 6c 74 65 | 72 20 74 6f 20 66 69 6c |ly filte|r to fil|
|00002e20| 65 5c 6e 5c 0a 58 20 20 | 2d 64 3a 20 64 65 6c 65 |e\n\.X |-d: dele|
|00002e30| 74 65 20 69 6e 70 75 74 | 20 66 69 6c 65 5c 6e 5c |te input| file\n\|
|00002e40| 0a 58 20 20 2d 44 3a 20 | 64 6f 20 6e 6f 74 20 64 |.X -D: |do not d|
|00002e50| 65 6c 65 74 65 20 69 6e | 70 75 74 20 66 69 6c 65 |elete in|put file|
|00002e60| 20 28 64 65 66 61 75 6c | 74 29 5c 6e 5c 0a 58 20 | (defaul|t)\n\.X |
|00002e70| 20 2d 70 3a 20 70 72 65 | 73 65 72 76 65 20 70 72 | -p: pre|serve pr|
|00002e80| 6f 74 65 63 74 69 6f 6e | 20 6f 66 20 66 69 6c 65 |otection| of file|
|00002e90| 5c 6e 5c 0a 58 20 20 2d | 50 3a 20 64 6f 20 6e 6f |\n\.X -|P: do no|
|00002ea0| 74 20 70 72 65 73 65 72 | 76 65 20 70 72 6f 74 65 |t preser|ve prote|
|00002eb0| 63 74 69 6f 6e 20 6f 66 | 20 66 69 6c 65 20 28 64 |ction of| file (d|
|00002ec0| 65 66 61 75 6c 74 29 5c | 6e 5c 0a 58 20 20 2d 74 |efault)\|n\.X -t|
|00002ed0| 3a 20 70 72 65 73 65 72 | 76 65 20 61 63 63 65 73 |: preser|ve acces|
|00002ee0| 73 20 61 6e 64 20 6d 6f | 64 69 66 69 63 61 74 69 |s and mo|dificati|
|00002ef0| 6f 6e 20 74 69 6d 65 73 | 20 6f 66 20 66 69 6c 65 |on times| of file|
|00002f00| 5c 6e 5c 0a 58 20 20 2d | 54 3a 20 64 6f 20 6e 6f |\n\.X -|T: do no|
|00002f10| 74 20 70 72 65 73 65 72 | 76 65 20 74 69 6d 65 73 |t preser|ve times|
|00002f20| 20 28 64 65 66 61 75 6c | 74 29 5c 6e 5c 0a 58 20 | (defaul|t)\n\.X |
|00002f30| 20 2d 65 65 78 74 3a 20 | 73 65 6e 74 20 6f 75 74 | -eext: |sent out|
|00002f40| 70 75 74 20 74 6f 20 66 | 69 6c 65 2e 65 78 74 2c |put to f|ile.ext,|
|00002f50| 20 6f 72 20 69 66 20 65 | 78 74 20 62 65 67 69 6e | or if e|xt begin|
|00002f60| 73 20 77 69 74 68 20 2e | 20 72 65 6d 6f 76 65 20 |s with .| remove |
|00002f70| 69 74 20 66 72 6f 6d 20 | 6e 61 6d 65 5c 6e 5c 0a |it from |name\n\.|
|00002f80| 58 20 20 2d 6f 6f 75 74 | 3a 20 73 65 6e 64 20 6f |X -oout|: send o|
|00002f90| 75 74 70 75 74 20 74 6f | 20 6f 75 74 20 28 6f 76 |utput to| out (ov|
|00002fa0| 65 72 72 69 64 65 73 20 | 2d 65 29 5c 6e 5c 0a 58 |errides |-e)\n\.X|
|00002fb0| 5c 6e 5c 0a 58 49 66 20 | 79 6f 75 20 68 61 76 65 |\n\.XIf |you have|
|00002fc0| 20 71 75 65 73 74 69 6f | 6e 73 20 61 62 6f 75 74 | questio|ns about|
|00002fd0| 20 6f 72 20 73 75 67 67 | 65 73 74 69 6f 6e 73 20 | or sugg|estions |
|00002fe0| 66 6f 72 20 66 69 6c 74 | 65 72 66 69 6c 65 2c 20 |for filt|erfile, |
|00002ff0| 70 6c 65 61 73 65 20 66 | 65 65 6c 20 66 72 65 65 |please f|eel free|
|00003000| 5c 6e 5c 0a 58 74 6f 20 | 63 6f 6e 74 61 63 74 20 |\n\.Xto |contact |
|00003010| 74 68 65 20 61 75 74 68 | 6f 72 2c 20 44 61 6e 69 |the auth|or, Dani|
|00003020| 65 6c 20 4a 2e 20 42 65 | 72 6e 73 74 65 69 6e 2c |el J. Be|rnstein,|
|00003030| 20 61 74 20 62 72 6e 73 | 74 6e 64 40 61 63 66 31 | at brns|tnd@acf1|
|00003040| 30 2e 6e 79 75 2e 65 64 | 75 5c 6e 5c 0a 58 6f 6e |0.nyu.ed|u\n\.Xon|
|00003050| 20 74 68 65 20 49 6e 74 | 65 72 6e 65 74 2e 5c 6e | the Int|ernet.\n|
|00003060| 22 3b 0a 58 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |";.X.X#i|nclude <|
|00003070| 73 74 64 69 6f 2e 68 3e | 0a 58 23 69 6e 63 6c 75 |stdio.h>|.X#inclu|
|00003080| 64 65 20 3c 73 79 73 2f | 74 79 70 65 73 2e 68 3e |de <sys/|types.h>|
|00003090| 0a 58 23 69 6e 63 6c 75 | 64 65 20 3c 73 79 73 2f |.X#inclu|de <sys/|
|000030a0| 73 74 61 74 2e 68 3e 0a | 58 23 69 6e 63 6c 75 64 |stat.h>.|X#includ|
|000030b0| 65 20 3c 73 79 73 2f 66 | 69 6c 65 2e 68 3e 0a 58 |e <sys/f|ile.h>.X|
|000030c0| 23 69 66 64 65 66 20 42 | 53 44 0a 58 23 69 6e 63 |#ifdef B|SD.X#inc|
|000030d0| 6c 75 64 65 20 3c 6c 69 | 6d 69 74 73 2e 68 3e 0a |lude <li|mits.h>.|
|000030e0| 58 23 65 6e 64 69 66 0a | 58 23 69 6e 63 6c 75 64 |X#endif.|X#includ|
|000030f0| 65 20 3c 73 79 73 2f 77 | 61 69 74 2e 68 3e 0a 58 |e <sys/w|ait.h>.X|
|00003100| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 74 69 |#include| <sys/ti|
|00003110| 6d 65 2e 68 3e 0a 58 0a | 58 65 78 74 65 72 6e 20 |me.h>.X.|Xextern |
|00003120| 63 68 61 72 20 2a 67 65 | 74 65 6e 76 28 29 3b 20 |char *ge|tenv(); |
|00003130| 0a 58 65 78 74 65 72 6e | 20 63 68 61 72 20 2a 6d |.Xextern| char *m|
|00003140| 61 6c 6c 6f 63 28 29 3b | 20 0a 58 0a 58 69 6e 74 |alloc();| .X.Xint|
|00003150| 20 66 6c 61 67 64 65 6c | 65 74 65 20 3d 20 30 3b | flagdel|ete = 0;|
|00003160| 0a 58 69 6e 74 20 66 6c | 61 67 70 72 6f 74 65 63 |.Xint fl|agprotec|
|00003170| 74 20 3d 20 30 3b 0a 58 | 69 6e 74 20 66 6c 61 67 |t = 0;.X|int flag|
|00003180| 74 69 6d 65 73 20 3d 20 | 30 3b 0a 58 0a 58 69 6e |times = |0;.X.Xin|
|00003190| 74 20 66 6c 61 67 75 6e | 61 70 70 65 6e 64 20 3d |t flagun|append =|
|000031a0| 20 30 3b 0a 58 0a 58 63 | 68 61 72 20 2a 66 6e 6f | 0;.X.Xc|har *fno|
|000031b0| 75 74 20 3d 20 30 3b 0a | 58 63 68 61 72 20 2a 66 |ut = 0;.|Xchar *f|
|000031c0| 6e 69 6e 20 3d 20 30 3b | 0a 58 63 68 61 72 20 2a |nin = 0;|.Xchar *|
|000031d0| 2a 66 69 6c 74 65 72 20 | 3d 20 30 3b 0a 58 63 68 |*filter |= 0;.Xch|
|000031e0| 61 72 20 2a 66 6e 61 70 | 70 65 6e 64 20 3d 20 30 |ar *fnap|pend = 0|
|000031f0| 3b 0a 58 0a 58 6d 61 69 | 6e 28 61 72 67 63 2c 61 |;.X.Xmai|n(argc,a|
|00003200| 72 67 76 2c 65 6e 76 70 | 29 0a 58 69 6e 74 20 61 |rgv,envp|).Xint a|
|00003210| 72 67 63 3b 0a 58 63 68 | 61 72 20 2a 61 72 67 76 |rgc;.Xch|ar *argv|
|00003220| 5b 5d 3b 0a 58 63 68 61 | 72 20 2a 65 6e 76 70 5b |[];.Xcha|r *envp[|
|00003230| 5d 3b 0a 58 7b 0a 58 20 | 63 68 61 72 20 2a 73 3b |];.X{.X |char *s;|
|00003240| 0a 58 20 69 6e 74 20 66 | 3b 0a 58 20 69 6e 74 20 |.X int f|;.X int |
|00003250| 66 64 69 6e 3b 0a 58 20 | 69 6e 74 20 66 64 6f 75 |fdin;.X |int fdou|
|00003260| 74 3b 0a 58 20 75 6e 69 | 6f 6e 20 77 61 69 74 20 |t;.X uni|on wait |
|00003270| 77 73 74 61 74 3b 0a 58 | 20 73 74 72 75 63 74 20 |wstat;.X| struct |
|00003280| 73 74 61 74 20 73 74 69 | 6e 6f 6c 64 3b 0a 58 20 |stat sti|nold;.X |
|00003290| 73 74 72 75 63 74 20 73 | 74 61 74 20 73 74 6f 75 |struct s|tat stou|
|000032a0| 74 6f 6c 64 3b 0a 58 20 | 73 74 72 75 63 74 20 73 |told;.X |struct s|
|000032b0| 74 61 74 20 73 74 69 6e | 3b 0a 58 20 73 74 72 75 |tat stin|;.X stru|
|000032c0| 63 74 20 73 74 61 74 20 | 73 74 6f 75 74 3b 0a 58 |ct stat |stout;.X|
|000032d0| 20 73 74 72 75 63 74 20 | 74 69 6d 65 76 61 6c 20 | struct |timeval |
|000032e0| 74 76 70 5b 32 5d 3b 0a | 58 0a 58 20 66 6e 61 70 |tvp[2];.|X.X fnap|
|000032f0| 70 65 6e 64 20 3d 20 67 | 65 74 65 6e 76 28 22 46 |pend = g|etenv("F|
|00003300| 49 4c 54 45 52 46 49 4c | 45 45 58 54 22 29 3b 0a |ILTERFIL|EEXT");.|
|00003310| 58 0a 58 20 77 68 69 6c | 65 20 28 2a 28 2b 2b 61 |X.X whil|e (*(++a|
|00003320| 72 67 76 29 29 0a 58 20 | 20 20 69 66 20 28 2a 2a |rgv)).X | if (**|
|00003330| 61 72 67 76 20 3d 3d 20 | 27 2d 27 29 0a 58 20 20 |argv == |'-').X |
|00003340| 20 20 20 77 68 69 6c 65 | 20 28 2a 28 2b 2b 28 2a | while| (*(++(*|
|00003350| 61 72 67 76 29 29 29 0a | 58 20 20 20 20 20 20 20 |argv))).|X |
|00003360| 73 77 69 74 63 68 28 2a | 2a 61 72 67 76 29 0a 58 |switch(*|*argv).X|
|00003370| 20 20 20 20 20 20 20 20 | 7b 0a 58 09 20 63 61 73 | |{.X. cas|
|00003380| 65 20 27 64 27 3a 20 66 | 6c 61 67 64 65 6c 65 74 |e 'd': f|lagdelet|
|00003390| 65 20 3d 20 31 3b 20 62 | 72 65 61 6b 3b 0a 58 09 |e = 1; b|reak;.X.|
|000033a0| 20 63 61 73 65 20 27 44 | 27 3a 20 66 6c 61 67 64 | case 'D|': flagd|
|000033b0| 65 6c 65 74 65 20 3d 20 | 30 3b 20 62 72 65 61 6b |elete = |0; break|
|000033c0| 3b 0a 58 09 20 63 61 73 | 65 20 27 70 27 3a 20 66 |;.X. cas|e 'p': f|
|000033d0| 6c 61 67 70 72 6f 74 65 | 63 74 20 3d 20 31 3b 20 |lagprote|ct = 1; |
|000033e0| 62 72 65 61 6b 3b 0a 58 | 09 20 63 61 73 65 20 27 |break;.X|. case '|
|000033f0| 50 27 3a 20 66 6c 61 67 | 70 72 6f 74 65 63 74 20 |P': flag|protect |
|00003400| 3d 20 30 3b 20 62 72 65 | 61 6b 3b 0a 58 09 20 63 |= 0; bre|ak;.X. c|
|00003410| 61 73 65 20 27 74 27 3a | 20 66 6c 61 67 74 69 6d |ase 't':| flagtim|
|00003420| 65 73 20 3d 20 31 3b 20 | 62 72 65 61 6b 3b 0a 58 |es = 1; |break;.X|
|00003430| 09 20 63 61 73 65 20 27 | 54 27 3a 20 66 6c 61 67 |. case '|T': flag|
|00003440| 74 69 6d 65 73 20 3d 20 | 30 3b 20 62 72 65 61 6b |times = |0; break|
|00003450| 3b 0a 58 09 20 63 61 73 | 65 20 27 65 27 3a 20 66 |;.X. cas|e 'e': f|
|00003460| 6e 61 70 70 65 6e 64 20 | 3d 20 2a 61 72 67 76 20 |nappend |= *argv |
|00003470| 2b 20 31 3b 0a 58 09 09 | 20 20 20 77 68 69 6c 65 |+ 1;.X..| while|
|00003480| 20 28 2a 28 2b 2b 28 2a | 61 72 67 76 29 29 29 20 | (*(++(*|argv))) |
|00003490| 2f 2a 20 6e 75 6c 6c 20 | 2a 2f 20 3b 0a 58 09 09 |/* null |*/ ;.X..|
|000034a0| 20 20 20 2d 2d 28 2a 61 | 72 67 76 29 3b 20 62 72 | --(*a|rgv); br|
|000034b0| 65 61 6b 3b 20 2f 2a 20 | 77 65 20 72 65 61 6c 6c |eak; /* |we reall|
|000034c0| 79 20 77 61 6e 74 20 62 | 72 65 61 6b 62 72 65 61 |y want b|reakbrea|
|000034d0| 6b 20 68 65 72 65 20 2a | 2f 0a 58 09 20 63 61 73 |k here *|/.X. cas|
|000034e0| 65 20 27 6f 27 3a 20 66 | 6e 6f 75 74 20 3d 20 2a |e 'o': f|nout = *|
|000034f0| 61 72 67 76 20 2b 20 31 | 3b 0a 58 09 09 20 20 20 |argv + 1|;.X.. |
|00003500| 77 68 69 6c 65 20 28 2a | 28 2b 2b 28 2a 61 72 67 |while (*|(++(*arg|
|00003510| 76 29 29 29 20 2f 2a 20 | 6e 75 6c 6c 20 2a 2f 20 |v))) /* |null */ |
|00003520| 3b 0a 58 09 09 20 20 20 | 2d 2d 28 2a 61 72 67 76 |;.X.. |--(*argv|
|00003530| 29 3b 20 62 72 65 61 6b | 3b 20 2f 2a 20 77 65 20 |); break|; /* we |
|00003540| 72 65 61 6c 6c 79 20 77 | 61 6e 74 20 62 72 65 61 |really w|ant brea|
|00003550| 6b 62 72 65 61 6b 20 68 | 65 72 65 20 2a 2f 0a 58 |kbreak h|ere */.X|
|00003560| 09 20 63 61 73 65 20 27 | 41 27 3a 20 70 72 69 6e |. case '|A': prin|
|00003570| 74 66 28 66 69 6c 74 65 | 72 66 69 6c 65 61 75 74 |tf(filte|rfileaut|
|00003580| 68 6f 72 29 3b 20 65 78 | 69 74 28 30 29 3b 0a 58 |hor); ex|it(0);.X|
|00003590| 20 20 20 20 20 20 20 20 | 20 63 61 73 65 20 27 43 | | case 'C|
|000035a0| 27 3a 20 70 72 69 6e 74 | 66 28 66 69 6c 74 65 72 |': print|f(filter|
|000035b0| 66 69 6c 65 63 6f 70 79 | 72 69 67 68 74 29 3b 20 |filecopy|right); |
|000035c0| 65 78 69 74 28 30 29 3b | 0a 58 20 20 20 20 20 20 |exit(0);|.X |
|000035d0| 20 20 20 63 61 73 65 20 | 27 56 27 3a 20 70 72 69 | case |'V': pri|
|000035e0| 6e 74 66 28 66 69 6c 74 | 65 72 66 69 6c 65 76 65 |ntf(filt|erfileve|
|000035f0| 72 73 69 6f 6e 29 3b 20 | 65 78 69 74 28 30 29 3b |rsion); |exit(0);|
|00003600| 0a 58 20 20 20 20 20 20 | 20 20 20 63 61 73 65 20 |.X | case |
|00003610| 27 57 27 3a 20 70 72 69 | 6e 74 66 28 66 69 6c 74 |'W': pri|ntf(filt|
|00003620| 65 72 66 69 6c 65 77 61 | 72 72 61 6e 74 79 29 3b |erfilewa|rranty);|
|00003630| 20 65 78 69 74 28 30 29 | 3b 0a 58 20 20 20 20 20 | exit(0)|;.X |
|00003640| 20 20 20 20 63 61 73 65 | 20 27 48 27 3a 20 70 72 | case| 'H': pr|
|00003650| 69 6e 74 66 28 66 69 6c | 74 65 72 66 69 6c 65 68 |intf(fil|terfileh|
|00003660| 65 6c 70 29 3b 20 65 78 | 69 74 28 30 29 3b 0a 58 |elp); ex|it(0);.X|
|00003670| 20 20 20 20 20 20 20 20 | 20 63 61 73 65 20 27 55 | | case 'U|
|00003680| 27 3a 20 70 72 69 6e 74 | 66 28 66 69 6c 74 65 72 |': print|f(filter|
|00003690| 66 69 6c 65 75 73 61 67 | 65 29 3b 20 65 78 69 74 |fileusag|e); exit|
|000036a0| 28 30 29 3b 0a 58 20 20 | 20 20 20 20 20 20 20 64 |(0);.X | d|
|000036b0| 65 66 61 75 6c 74 3a 20 | 3b 0a 58 09 7d 0a 58 20 |efault: |;.X.}.X |
|000036c0| 20 20 65 6c 73 65 20 0a | 58 20 20 20 20 20 69 66 | else .|X if|
|000036d0| 20 28 66 6e 69 6e 20 3d | 3d 20 30 29 20 0a 58 20 | (fnin =|= 0) .X |
|000036e0| 20 20 20 20 20 20 66 6e | 69 6e 20 3d 20 2a 61 72 | fn|in = *ar|
|000036f0| 67 76 3b 0a 58 20 20 20 | 20 20 65 6c 73 65 0a 58 |gv;.X | else.X|
|00003700| 20 20 20 20 20 20 20 69 | 66 20 28 66 69 6c 74 65 | i|f (filte|
|00003710| 72 20 3d 3d 20 30 29 20 | 0a 58 20 20 20 20 20 20 |r == 0) |.X |
|00003720| 20 20 7b 0a 58 20 20 20 | 20 20 20 20 20 20 66 69 | {.X | fi|
|00003730| 6c 74 65 72 20 3d 20 61 | 72 67 76 3b 0a 58 09 20 |lter = a|rgv;.X. |
|00003740| 62 72 65 61 6b 3b 0a 58 | 20 20 20 20 20 20 20 20 |break;.X| |
|00003750| 7d 0a 58 20 0a 58 20 69 | 66 20 28 28 66 6e 69 6e |}.X .X i|f ((fnin|
|00003760| 20 3d 3d 20 30 29 20 7c | 7c 20 28 66 69 6c 74 65 | == 0) ||| (filte|
|00003770| 72 20 3d 3d 20 30 29 29 | 0a 58 20 20 7b 0a 58 20 |r == 0))|.X {.X |
|00003780| 20 20 70 72 69 6e 74 66 | 28 66 69 6c 74 65 72 66 | printf|(filterf|
|00003790| 69 6c 65 75 73 61 67 65 | 29 3b 20 65 78 69 74 28 |ileusage|); exit(|
|000037a0| 31 29 3b 0a 58 20 20 7d | 0a 58 20 69 66 20 28 66 |1);.X }|.X if (f|
|000037b0| 6e 6f 75 74 20 3d 3d 20 | 30 29 0a 58 20 20 7b 0a |nout == |0).X {.|
|000037c0| 58 20 20 20 66 6c 61 67 | 75 6e 61 70 70 65 6e 64 |X flag|unappend|
|000037d0| 20 3d 20 28 2a 66 6e 61 | 70 70 65 6e 64 20 3d 3d | = (*fna|ppend ==|
|000037e0| 20 27 2e 27 29 3b 0a 58 | 20 20 20 66 6f 72 20 28 | '.');.X| for (|
|000037f0| 73 20 3d 20 66 6e 61 70 | 70 65 6e 64 3b 2a 73 3b |s = fnap|pend;*s;|
|00003800| 73 2b 2b 29 0a 58 20 20 | 20 20 20 69 66 20 28 2a |s++).X | if (*|
|00003810| 73 20 3d 3d 20 27 2f 27 | 29 0a 58 20 20 20 20 20 |s == '/'|).X |
|00003820| 20 20 2a 73 20 3d 20 27 | 2e 27 3b 20 0a 58 20 20 | *s = '|.'; .X |
|00003830| 20 66 6e 6f 75 74 20 3d | 20 6d 61 6c 6c 6f 63 28 | fnout =| malloc(|
|00003840| 28 75 6e 73 69 67 6e 65 | 64 29 20 28 73 74 72 6c |(unsigne|d) (strl|
|00003850| 65 6e 28 66 6e 69 6e 29 | 20 2b 20 73 74 72 6c 65 |en(fnin)| + strle|
|00003860| 6e 28 66 6e 61 70 70 65 | 6e 64 29 20 2b 20 32 29 |n(fnappe|nd) + 2)|
|00003870| 29 3b 0a 58 20 20 20 69 | 66 20 28 66 6e 6f 75 74 |);.X i|f (fnout|
|00003880| 20 3d 3d 20 30 29 0a 58 | 20 20 20 20 7b 0a 58 20 | == 0).X| {.X |
|00003890| 20 20 20 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 | fpri|ntf(stde|
|000038a0| 72 72 2c 22 66 69 6c 74 | 65 72 66 69 6c 65 3a 20 |rr,"filt|erfile: |
|000038b0| 66 61 74 61 6c 3a 20 63 | 61 6e 6e 6f 74 20 63 72 |fatal: c|annot cr|
|000038c0| 65 61 74 65 20 6f 75 74 | 70 75 74 20 66 69 6c 65 |eate out|put file|
|000038d0| 20 6e 61 6d 65 3a 20 5c | 0a 58 6f 75 74 20 6f 66 | name: \|.Xout of|
|000038e0| 20 6d 65 6d 6f 72 79 5c | 6e 22 29 3b 0a 58 20 20 | memory\|n");.X |
|000038f0| 20 20 20 65 78 69 74 28 | 31 29 3b 0a 58 20 20 20 | exit(|1);.X |
|00003900| 20 7d 0a 58 20 20 20 28 | 76 6f 69 64 29 20 73 74 | }.X (|void) st|
|00003910| 72 63 70 79 28 66 6e 6f | 75 74 2c 66 6e 69 6e 29 |rcpy(fno|ut,fnin)|
|00003920| 3b 0a 58 20 20 20 69 66 | 20 28 66 6c 61 67 75 6e |;.X if| (flagun|
|00003930| 61 70 70 65 6e 64 20 26 | 26 20 28 73 74 72 6c 65 |append &|& (strle|
|00003940| 6e 28 66 6e 6f 75 74 29 | 20 3e 20 73 74 72 6c 65 |n(fnout)| > strle|
|00003950| 6e 28 66 6e 61 70 70 65 | 6e 64 29 29 20 26 26 0a |n(fnappe|nd)) &&.|
|00003960| 58 09 28 73 74 72 63 6d | 70 28 66 6e 6f 75 74 20 |X.(strcm|p(fnout |
|00003970| 2b 20 73 74 72 6c 65 6e | 28 66 6e 6f 75 74 29 20 |+ strlen|(fnout) |
|00003980| 2d 20 73 74 72 6c 65 6e | 28 66 6e 61 70 70 65 6e |- strlen|(fnappen|
|00003990| 64 29 2c 66 6e 61 70 70 | 65 6e 64 29 20 3d 3d 20 |d),fnapp|end) == |
|000039a0| 30 29 29 0a 58 20 20 20 | 20 20 66 6e 6f 75 74 5b |0)).X | fnout[|
|000039b0| 73 74 72 6c 65 6e 28 66 | 6e 6f 75 74 29 20 2d 20 |strlen(f|nout) - |
|000039c0| 73 74 72 6c 65 6e 28 66 | 6e 61 70 70 65 6e 64 29 |strlen(f|nappend)|
|000039d0| 5d 20 3d 20 30 3b 0a 58 | 20 20 20 65 6c 73 65 0a |] = 0;.X| else.|
|000039e0| 58 20 20 20 20 7b 0a 58 | 20 20 20 20 20 28 76 6f |X {.X| (vo|
|000039f0| 69 64 29 20 73 74 72 63 | 61 74 28 66 6e 6f 75 74 |id) strc|at(fnout|
|00003a00| 2c 22 2e 22 29 3b 0a 58 | 20 20 20 20 20 69 66 20 |,".");.X| if |
|00003a10| 28 66 6e 61 70 70 65 6e | 64 20 21 3d 20 4e 55 4c |(fnappen|d != NUL|
|00003a20| 4c 29 0a 58 20 20 20 20 | 20 20 20 28 76 6f 69 64 |L).X | (void|
|00003a30| 29 20 73 74 72 63 61 74 | 28 66 6e 6f 75 74 2c 66 |) strcat|(fnout,f|
|00003a40| 6e 61 70 70 65 6e 64 29 | 3b 0a 58 20 20 20 20 7d |nappend)|;.X }|
|00003a50| 0a 58 20 20 7d 0a 58 0a | 58 20 2f 2a 20 4f 6b 61 |.X }.X.|X /* Oka|
|00003a60| 79 2e 20 4e 6f 77 20 77 | 65 20 68 61 76 65 20 66 |y. Now w|e have f|
|00003a70| 6e 69 6e 2c 20 66 6e 6f | 75 74 2c 20 61 6e 64 20 |nin, fno|ut, and |
|00003a80| 66 69 6c 74 65 72 2e 20 | 2a 2f 0a 58 0a 58 20 66 |filter. |*/.X.X f|
|00003a90| 64 69 6e 20 3d 20 6f 70 | 65 6e 28 66 6e 69 6e 2c |din = op|en(fnin,|
|00003aa0| 4f 5f 52 44 4f 4e 4c 59 | 29 3b 0a 58 20 69 66 20 |O_RDONLY|);.X if |
|00003ab0| 28 66 64 69 6e 20 3d 3d | 20 2d 31 29 0a 58 20 20 |(fdin ==| -1).X |
|00003ac0| 7b 20 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |{ fprint|f(stderr|
|00003ad0| 2c 22 66 69 6c 74 65 72 | 66 69 6c 65 3a 20 66 61 |,"filter|file: fa|
|00003ae0| 74 61 6c 3a 20 63 61 6e | 6e 6f 74 20 6f 70 65 6e |tal: can|not open|
|00003af0| 20 69 6e 70 75 74 20 66 | 69 6c 65 20 22 29 3b 0a | input f|ile ");.|
|00003b00| 58 20 20 20 70 65 72 72 | 6f 72 28 66 6e 69 6e 29 |X perr|or(fnin)|
|00003b10| 3b 20 65 78 69 74 28 31 | 29 3b 20 7d 0a 58 20 69 |; exit(1|); }.X i|
|00003b20| 66 20 28 66 73 74 61 74 | 28 66 64 69 6e 2c 26 73 |f (fstat|(fdin,&s|
|00003b30| 74 69 6e 6f 6c 64 29 20 | 3d 3d 20 2d 31 29 0a 58 |tinold) |== -1).X|
|00003b40| 20 20 7b 20 70 65 72 72 | 6f 72 28 22 66 69 6c 74 | { perr|or("filt|
|00003b50| 65 72 66 69 6c 65 3a 20 | 66 61 74 61 6c 3a 20 63 |erfile: |fatal: c|
|00003b60| 61 6e 6e 6f 74 20 73 74 | 61 74 20 69 6e 70 75 74 |annot st|at input|
|00003b70| 20 66 69 6c 65 22 29 3b | 20 65 78 69 74 28 31 29 | file");| exit(1)|
|00003b80| 3b 20 7d 0a 58 20 69 66 | 20 28 66 6c 61 67 64 65 |; }.X if| (flagde|
|00003b90| 6c 65 74 65 20 26 26 20 | 28 73 74 69 6e 6f 6c 64 |lete && |(stinold|
|00003ba0| 2e 73 74 5f 6e 6c 69 6e | 6b 20 3e 20 31 29 29 0a |.st_nlin|k > 1)).|
|00003bb0| 58 20 20 7b 20 66 70 72 | 69 6e 74 66 28 73 74 64 |X { fpr|intf(std|
|00003bc0| 65 72 72 2c 22 66 69 6c | 74 65 72 66 69 6c 65 3a |err,"fil|terfile:|
|00003bd0| 20 66 61 74 61 6c 3a 20 | 77 69 6c 6c 20 6e 6f 74 | fatal: |will not|
|00003be0| 20 70 72 6f 63 65 65 64 | 3a 20 5c 0a 58 69 6e 70 | proceed|: \.Xinp|
|00003bf0| 75 74 20 66 69 6c 65 20 | 25 73 20 68 61 73 20 65 |ut file |%s has e|
|00003c00| 78 74 72 61 20 6c 69 6e | 6b 73 5c 6e 22 2c 66 6e |xtra lin|ks\n",fn|
|00003c10| 69 6e 29 3b 20 65 78 69 | 74 28 31 29 3b 20 7d 0a |in); exi|t(1); }.|
|00003c20| 58 0a 58 20 74 76 70 5b | 30 5d 2e 74 76 5f 73 65 |X.X tvp[|0].tv_se|
|00003c30| 63 20 3d 20 73 74 69 6e | 6f 6c 64 2e 73 74 5f 61 |c = stin|old.st_a|
|00003c40| 74 69 6d 65 3b 0a 58 20 | 74 76 70 5b 30 5d 2e 74 |time;.X |tvp[0].t|
|00003c50| 76 5f 75 73 65 63 20 3d | 20 30 3b 0a 58 20 74 76 |v_usec =| 0;.X tv|
|00003c60| 70 5b 31 5d 2e 74 76 5f | 73 65 63 20 3d 20 73 74 |p[1].tv_|sec = st|
|00003c70| 69 6e 6f 6c 64 2e 73 74 | 5f 6d 74 69 6d 65 3b 0a |inold.st|_mtime;.|
|00003c80| 58 20 74 76 70 5b 31 5d | 2e 74 76 5f 75 73 65 63 |X tvp[1]|.tv_usec|
|00003c90| 20 3d 20 30 3b 0a 58 0a | 58 20 66 64 6f 75 74 20 | = 0;.X.|X fdout |
|00003ca0| 3d 20 6f 70 65 6e 28 66 | 6e 6f 75 74 2c 4f 5f 57 |= open(f|nout,O_W|
|00003cb0| 52 4f 4e 4c 59 20 7c 20 | 4f 5f 43 52 45 41 54 20 |RONLY | |O_CREAT |
|00003cc0| 7c 20 4f 5f 45 58 43 4c | 2c 30 36 30 30 29 3b 0a || O_EXCL|,0600);.|
|00003cd0| 58 20 69 66 20 28 66 64 | 6f 75 74 20 3d 3d 20 2d |X if (fd|out == -|
|00003ce0| 31 29 0a 58 20 20 7b 20 | 66 70 72 69 6e 74 66 28 |1).X { |fprintf(|
|00003cf0| 73 74 64 65 72 72 2c 22 | 66 69 6c 74 65 72 66 69 |stderr,"|filterfi|
|00003d00| 6c 65 3a 20 66 61 74 61 | 6c 3a 20 63 61 6e 6e 6f |le: fata|l: canno|
|00003d10| 74 20 63 72 65 61 74 65 | 20 6f 75 74 70 75 74 20 |t create| output |
|00003d20| 66 69 6c 65 20 22 29 3b | 0a 58 20 20 20 70 65 72 |file ");|.X per|
|00003d30| 72 6f 72 28 66 6e 6f 75 | 74 29 3b 20 65 78 69 74 |ror(fnou|t); exit|
|00003d40| 28 31 29 3b 20 7d 0a 58 | 20 69 66 20 28 66 73 74 |(1); }.X| if (fst|
|00003d50| 61 74 28 66 64 6f 75 74 | 2c 26 73 74 6f 75 74 6f |at(fdout|,&stouto|
|00003d60| 6c 64 29 20 3d 3d 20 2d | 31 29 0a 58 20 20 7b 20 |ld) == -|1).X { |
|00003d70| 70 65 72 72 6f 72 28 22 | 66 69 6c 74 65 72 66 69 |perror("|filterfi|
|00003d80| 6c 65 3a 20 66 61 74 61 | 6c 3a 20 63 61 6e 6e 6f |le: fata|l: canno|
|00003d90| 74 20 73 74 61 74 20 6f | 75 74 70 75 74 20 66 69 |t stat o|utput fi|
|00003da0| 6c 65 22 29 3b 20 65 78 | 69 74 28 31 29 3b 20 7d |le"); ex|it(1); }|
|00003db0| 0a 58 0a 58 20 69 66 20 | 28 66 6c 61 67 70 72 6f |.X.X if |(flagpro|
|00003dc0| 74 65 63 74 29 0a 58 20 | 20 20 69 66 20 28 66 63 |tect).X | if (fc|
|00003dd0| 68 6d 6f 64 28 66 64 6f | 75 74 2c 73 74 69 6e 6f |hmod(fdo|ut,stino|
|00003de0| 6c 64 2e 73 74 5f 6d 6f | 64 65 20 26 20 30 37 37 |ld.st_mo|de & 077|
|00003df0| 37 29 20 3d 3d 20 2d 31 | 29 0a 58 20 20 20 20 20 |7) == -1|).X |
|00003e00| 70 65 72 72 6f 72 28 22 | 66 69 6c 74 65 72 66 69 |perror("|filterfi|
|00003e10| 6c 65 3a 20 77 61 72 6e | 69 6e 67 3a 20 63 61 6e |le: warn|ing: can|
|00003e20| 6e 6f 74 20 63 68 61 6e | 67 65 20 70 72 6f 74 65 |not chan|ge prote|
|00003e30| 63 74 69 6f 6e 73 20 6f | 66 20 6f 75 74 70 75 74 |ctions o|f output|
|00003e40| 20 66 69 6c 65 22 29 3b | 0a 58 0a 58 20 69 66 20 | file");|.X.X if |
|00003e50| 28 28 66 20 3d 20 66 6f | 72 6b 28 29 29 20 3d 3d |((f = fo|rk()) ==|
|00003e60| 20 30 29 20 2f 2a 20 63 | 68 69 6c 64 20 2a 2f 0a | 0) /* c|hild */.|
|00003e70| 58 20 20 7b 0a 58 20 20 | 20 69 66 20 28 64 75 70 |X {.X | if (dup|
|00003e80| 32 28 66 64 69 6e 2c 30 | 29 20 3d 3d 20 2d 31 29 |2(fdin,0|) == -1)|
|00003e90| 0a 58 20 20 20 20 7b 20 | 70 65 72 72 6f 72 28 22 |.X { |perror("|
|00003ea0| 66 69 6c 74 65 72 66 69 | 6c 65 3a 20 66 61 74 61 |filterfi|le: fata|
|00003eb0| 6c 3a 20 63 61 6e 6e 6f | 74 20 70 72 65 70 61 72 |l: canno|t prepar|
|00003ec0| 65 20 69 6e 70 75 74 22 | 29 3b 20 65 78 69 74 28 |e input"|); exit(|
|00003ed0| 31 29 3b 20 7d 0a 58 20 | 20 20 69 66 20 28 64 75 |1); }.X | if (du|
|00003ee0| 70 32 28 66 64 6f 75 74 | 2c 31 29 20 3d 3d 20 2d |p2(fdout|,1) == -|
|00003ef0| 31 29 0a 58 20 20 20 20 | 7b 20 70 65 72 72 6f 72 |1).X |{ perror|
|00003f00| 28 22 66 69 6c 74 65 72 | 66 69 6c 65 3a 20 66 61 |("filter|file: fa|
|00003f10| 74 61 6c 3a 20 63 61 6e | 6e 6f 74 20 70 72 65 70 |tal: can|not prep|
|00003f20| 61 72 65 20 6f 75 74 70 | 75 74 22 29 3b 20 65 78 |are outp|ut"); ex|
|00003f30| 69 74 28 31 29 3b 20 7d | 0a 58 20 20 20 65 78 65 |it(1); }|.X exe|
|00003f40| 63 76 70 28 2a 66 69 6c | 74 65 72 2c 66 69 6c 74 |cvp(*fil|ter,filt|
|00003f50| 65 72 29 3b 0a 58 20 20 | 20 66 70 72 69 6e 74 66 |er);.X | fprintf|
|00003f60| 28 73 74 64 65 72 72 2c | 22 66 69 6c 74 65 72 66 |(stderr,|"filterf|
|00003f70| 69 6c 65 3a 20 66 61 74 | 61 6c 3a 20 63 61 6e 6e |ile: fat|al: cann|
|00003f80| 6f 74 20 65 78 65 63 75 | 74 65 20 66 69 6c 74 65 |ot execu|te filte|
|00003f90| 72 5c 6e 22 29 3b 0a 58 | 20 20 20 65 78 69 74 28 |r\n");.X| exit(|
|00003fa0| 31 29 3b 0a 58 20 20 7d | 0a 58 20 65 6c 73 65 20 |1);.X }|.X else |
|00003fb0| 69 66 20 28 66 20 3d 3d | 20 2d 31 29 20 2f 2a 20 |if (f ==| -1) /* |
|00003fc0| 66 6f 72 6b 20 66 61 69 | 6c 65 64 20 2a 2f 0a 58 |fork fai|led */.X|
|00003fd0| 20 20 7b 20 70 65 72 72 | 6f 72 28 22 66 69 6c 74 | { perr|or("filt|
|00003fe0| 65 72 66 69 6c 65 3a 20 | 66 61 74 61 6c 3a 20 63 |erfile: |fatal: c|
|00003ff0| 61 6e 6e 6f 74 20 66 6f | 72 6b 22 29 3b 20 65 78 |annot fo|rk"); ex|
|00004000| 69 74 28 31 29 3b 20 7d | 0a 58 0a 58 20 2f 2a 20 |it(1); }|.X.X /* |
|00004010| 70 61 72 65 6e 74 20 2a | 2f 0a 58 20 63 6c 6f 73 |parent *|/.X clos|
|00004020| 65 28 66 64 69 6e 29 3b | 0a 58 20 63 6c 6f 73 65 |e(fdin);|.X close|
|00004030| 28 66 64 6f 75 74 29 3b | 0a 58 20 69 66 20 28 77 |(fdout);|.X if (w|
|00004040| 61 69 74 28 26 77 73 74 | 61 74 29 20 3d 3d 20 2d |ait(&wst|at) == -|
|00004050| 31 29 20 0a 58 20 20 7b | 20 70 65 72 72 6f 72 28 |1) .X {| perror(|
|00004060| 22 66 69 6c 74 65 72 66 | 69 6c 65 3a 20 66 61 74 |"filterf|ile: fat|
|00004070| 61 6c 3a 20 63 61 6e 27 | 74 20 66 69 6e 64 20 66 |al: can'|t find f|
|00004080| 69 6c 74 65 72 20 70 72 | 6f 63 65 73 73 22 29 3b |ilter pr|ocess");|
|00004090| 20 65 78 69 74 28 31 29 | 3b 20 7d 0a 58 20 69 66 | exit(1)|; }.X if|
|000040a0| 20 28 77 73 74 61 74 2e | 77 5f 54 2e 77 5f 54 65 | (wstat.|w_T.w_Te|
|000040b0| 72 6d 73 69 67 29 0a 58 | 20 20 20 65 78 69 74 28 |rmsig).X| exit(|
|000040c0| 31 29 3b 20 0a 58 20 69 | 66 20 28 77 73 74 61 74 |1); .X i|f (wstat|
|000040d0| 2e 77 5f 54 2e 77 5f 52 | 65 74 63 6f 64 65 29 0a |.w_T.w_R|etcode).|
|000040e0| 58 20 20 20 65 78 69 74 | 28 28 69 6e 74 29 20 77 |X exit|((int) w|
|000040f0| 73 74 61 74 2e 77 5f 54 | 2e 77 5f 52 65 74 63 6f |stat.w_T|.w_Retco|
|00004100| 64 65 29 3b 20 0a 58 20 | 69 66 20 28 77 73 74 61 |de); .X |if (wsta|
|00004110| 74 2e 77 5f 54 2e 77 5f | 43 6f 72 65 64 75 6d 70 |t.w_T.w_|Coredump|
|00004120| 29 0a 58 20 20 20 65 78 | 69 74 28 31 29 3b 20 0a |).X ex|it(1); .|
|00004130| 58 0a 58 20 2f 2a 20 46 | 69 6c 74 65 72 20 65 78 |X.X /* F|ilter ex|
|00004140| 69 74 65 64 20 68 61 70 | 70 69 6c 79 2e 20 2a 2f |ited hap|pily. */|
|00004150| 0a 58 0a 58 20 69 66 20 | 28 66 6c 61 67 64 65 6c |.X.X if |(flagdel|
|00004160| 65 74 65 29 0a 58 20 20 | 7b 0a 58 20 20 20 2f 2a |ete).X |{.X /*|
|00004170| 20 52 61 63 65 21 20 52 | 61 63 65 21 20 52 61 63 | Race! R|ace! Rac|
|00004180| 65 21 20 2a 2f 0a 58 20 | 20 20 66 64 69 6e 20 3d |e! */.X | fdin =|
|00004190| 20 6f 70 65 6e 28 66 6e | 69 6e 2c 4f 5f 52 44 4f | open(fn|in,O_RDO|
|000041a0| 4e 4c 59 29 3b 0a 58 20 | 20 20 69 66 20 28 66 64 |NLY);.X | if (fd|
|000041b0| 69 6e 20 3d 3d 20 2d 31 | 29 0a 58 20 20 20 20 7b |in == -1|).X {|
|000041c0| 20 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c | fprintf|(stderr,|
|000041d0| 22 66 69 6c 74 65 72 66 | 69 6c 65 3a 20 66 61 74 |"filterf|ile: fat|
|000041e0| 61 6c 3a 20 63 61 6e 6e | 6f 74 20 72 65 6f 70 65 |al: cann|ot reope|
|000041f0| 6e 20 69 6e 70 75 74 20 | 66 69 6c 65 20 22 29 3b |n input |file ");|
|00004200| 0a 58 20 20 20 20 20 70 | 65 72 72 6f 72 28 66 6e |.X p|error(fn|
|00004210| 69 6e 29 3b 20 65 78 69 | 74 28 31 29 3b 20 7d 0a |in); exi|t(1); }.|
|00004220| 58 20 20 20 69 66 20 28 | 66 73 74 61 74 28 66 64 |X if (|fstat(fd|
|00004230| 69 6e 2c 26 73 74 69 6e | 29 20 3d 3d 20 2d 31 29 |in,&stin|) == -1)|
|00004240| 0a 58 20 20 20 20 7b 20 | 66 70 72 69 6e 74 66 28 |.X { |fprintf(|
|00004250| 73 74 64 65 72 72 2c 22 | 66 69 6c 74 65 72 66 69 |stderr,"|filterfi|
|00004260| 6c 65 3a 20 66 61 74 61 | 6c 3a 20 63 61 6e 6e 6f |le: fata|l: canno|
|00004270| 74 20 72 65 73 74 61 74 | 20 69 6e 70 75 74 20 66 |t restat| input f|
|00004280| 69 6c 65 20 22 29 3b 0a | 58 20 20 20 20 20 70 65 |ile ");.|X pe|
|00004290| 72 72 6f 72 28 66 6e 69 | 6e 29 3b 20 65 78 69 74 |rror(fni|n); exit|
|000042a0| 28 31 29 3b 20 7d 0a 58 | 20 20 20 69 66 20 28 28 |(1); }.X| if ((|
|000042b0| 73 74 69 6e 2e 73 74 5f | 64 65 76 20 21 3d 20 73 |stin.st_|dev != s|
|000042c0| 74 69 6e 6f 6c 64 2e 73 | 74 5f 64 65 76 29 20 7c |tinold.s|t_dev) ||
|000042d0| 7c 20 28 73 74 69 6e 2e | 73 74 5f 69 6e 6f 20 21 || (stin.|st_ino !|
|000042e0| 3d 20 73 74 69 6e 6f 6c | 64 2e 73 74 5f 69 6e 6f |= stinol|d.st_ino|
|000042f0| 29 29 0a 58 20 20 20 20 | 7b 20 66 70 72 69 6e 74 |)).X |{ fprint|
|00004300| 66 28 73 74 64 65 72 72 | 2c 22 66 69 6c 74 65 72 |f(stderr|,"filter|
|00004310| 66 69 6c 65 3a 20 66 61 | 74 61 6c 3a 20 77 69 6c |file: fa|tal: wil|
|00004320| 6c 20 6e 6f 74 20 64 65 | 6c 65 74 65 20 69 6e 70 |l not de|lete inp|
|00004330| 75 74 20 66 69 6c 65 20 | 25 73 3a 20 5c 0a 58 69 |ut file |%s: \.Xi|
|00004340| 74 20 68 61 73 20 62 65 | 65 6e 20 6d 6f 76 65 64 |t has be|en moved|
|00004350| 5c 6e 22 2c 66 6e 69 6e | 29 3b 20 65 78 69 74 28 |\n",fnin|); exit(|
|00004360| 31 29 3b 20 7d 0a 58 20 | 20 20 69 66 20 28 73 74 |1); }.X | if (st|
|00004370| 69 6e 2e 73 74 5f 6e 6c | 69 6e 6b 20 3e 20 31 29 |in.st_nl|ink > 1)|
|00004380| 0a 58 20 20 20 20 7b 20 | 66 70 72 69 6e 74 66 28 |.X { |fprintf(|
|00004390| 73 74 64 65 72 72 2c 22 | 66 69 6c 74 65 72 66 69 |stderr,"|filterfi|
|000043a0| 6c 65 3a 20 66 61 74 61 | 6c 3a 20 77 69 6c 6c 20 |le: fata|l: will |
|000043b0| 6e 6f 74 20 64 65 6c 65 | 74 65 20 69 6e 70 75 74 |not dele|te input|
|000043c0| 20 66 69 6c 65 20 25 73 | 3a 20 5c 0a 58 69 74 20 | file %s|: \.Xit |
|000043d0| 68 61 73 20 65 78 74 72 | 61 20 6c 69 6e 6b 73 5c |has extr|a links\|
|000043e0| 6e 22 2c 66 6e 69 6e 29 | 3b 20 65 78 69 74 28 31 |n",fnin)|; exit(1|
|000043f0| 29 3b 20 7d 0a 58 20 20 | 20 2f 2a 20 52 61 63 65 |); }.X | /* Race|
|00004400| 21 20 52 61 63 65 21 20 | 52 61 63 65 21 20 2a 2f |! Race! |Race! */|
|00004410| 0a 58 20 20 20 69 66 20 | 28 75 6e 6c 69 6e 6b 28 |.X if |(unlink(|
|00004420| 66 6e 69 6e 29 20 3d 3d | 20 2d 31 29 0a 58 20 20 |fnin) ==| -1).X |
|00004430| 20 20 7b 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 | { fpri|ntf(stde|
|00004440| 72 72 2c 22 66 69 6c 74 | 65 72 66 69 6c 65 3a 20 |rr,"filt|erfile: |
|00004450| 66 61 74 61 6c 3a 20 63 | 61 6e 6e 6f 74 20 64 65 |fatal: c|annot de|
|00004460| 6c 65 74 65 20 69 6e 70 | 75 74 20 66 69 6c 65 20 |lete inp|ut file |
|00004470| 22 29 3b 0a 58 20 20 20 | 20 20 70 65 72 72 6f 72 |");.X | perror|
|00004480| 28 66 6e 69 6e 29 3b 20 | 65 78 69 74 28 31 29 3b |(fnin); |exit(1);|
|00004490| 20 7d 0a 58 20 20 20 28 | 76 6f 69 64 29 20 63 6c | }.X (|void) cl|
|000044a0| 6f 73 65 28 66 64 69 6e | 29 3b 0a 58 20 20 7d 0a |ose(fdin|);.X }.|
|000044b0| 58 0a 58 20 69 66 20 28 | 66 6c 61 67 74 69 6d 65 |X.X if (|flagtime|
|000044c0| 73 29 0a 58 20 20 7b 0a | 58 20 20 20 2f 2a 20 52 |s).X {.|X /* R|
|000044d0| 61 63 65 21 20 52 61 63 | 65 21 20 52 61 63 65 21 |ace! Rac|e! Race!|
|000044e0| 20 2a 2f 0a 58 20 20 20 | 66 64 6f 75 74 20 3d 20 | */.X |fdout = |
|000044f0| 6f 70 65 6e 28 66 6e 6f | 75 74 2c 4f 5f 52 44 4f |open(fno|ut,O_RDO|
|00004500| 4e 4c 59 29 3b 0a 58 20 | 20 20 69 66 20 28 66 64 |NLY);.X | if (fd|
|00004510| 6f 75 74 20 3d 3d 20 2d | 31 29 0a 58 20 20 20 20 |out == -|1).X |
|00004520| 7b 20 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |{ fprint|f(stderr|
|00004530| 2c 22 66 69 6c 74 65 72 | 66 69 6c 65 3a 20 66 61 |,"filter|file: fa|
|00004540| 74 61 6c 3a 20 63 61 6e | 6e 6f 74 20 72 65 6f 70 |tal: can|not reop|
|00004550| 65 6e 20 6f 75 74 70 75 | 74 20 66 69 6c 65 20 22 |en outpu|t file "|
|00004560| 29 3b 0a 58 20 20 20 20 | 20 70 65 72 72 6f 72 28 |);.X | perror(|
|00004570| 66 6e 6f 75 74 29 3b 20 | 65 78 69 74 28 31 29 3b |fnout); |exit(1);|
|00004580| 20 7d 0a 58 20 20 20 69 | 66 20 28 66 73 74 61 74 | }.X i|f (fstat|
|00004590| 28 66 64 6f 75 74 2c 26 | 73 74 6f 75 74 29 20 3d |(fdout,&|stout) =|
|000045a0| 3d 20 2d 31 29 0a 58 20 | 20 20 20 7b 20 70 65 72 |= -1).X | { per|
|000045b0| 72 6f 72 28 22 66 69 6c | 74 65 72 66 69 6c 65 3a |ror("fil|terfile:|
|000045c0| 20 66 61 74 61 6c 3a 20 | 63 61 6e 6e 6f 74 20 72 | fatal: |cannot r|
|000045d0| 65 73 74 61 74 20 6f 75 | 74 70 75 74 20 66 69 6c |estat ou|tput fil|
|000045e0| 65 22 29 3b 20 65 78 69 | 74 28 31 29 3b 20 7d 0a |e"); exi|t(1); }.|
|000045f0| 58 20 20 20 69 66 20 28 | 28 73 74 6f 75 74 2e 73 |X if (|(stout.s|
|00004600| 74 5f 64 65 76 20 21 3d | 20 73 74 6f 75 74 6f 6c |t_dev !=| stoutol|
|00004610| 64 2e 73 74 5f 64 65 76 | 29 20 7c 7c 20 28 73 74 |d.st_dev|) || (st|
|00004620| 6f 75 74 2e 73 74 5f 69 | 6e 6f 20 21 3d 20 73 74 |out.st_i|no != st|
|00004630| 6f 75 74 6f 6c 64 2e 73 | 74 5f 69 6e 6f 29 29 0a |outold.s|t_ino)).|
|00004640| 58 20 20 20 20 7b 20 66 | 70 72 69 6e 74 66 28 73 |X { f|printf(s|
|00004650| 74 64 65 72 72 2c 22 66 | 69 6c 74 65 72 66 69 6c |tderr,"f|ilterfil|
|00004660| 65 3a 20 77 61 72 6e 69 | 6e 67 3a 20 77 69 6c 6c |e: warni|ng: will|
|00004670| 20 6e 6f 74 20 73 65 74 | 20 74 69 6d 65 73 20 6f | not set| times o|
|00004680| 66 20 5c 0a 58 6f 75 74 | 70 75 74 20 66 69 6c 65 |f \.Xout|put file|
|00004690| 20 25 73 3a 20 69 74 20 | 68 61 73 20 62 65 65 6e | %s: it |has been|
|000046a0| 20 6d 6f 76 65 64 5c 6e | 22 2c 66 6e 6f 75 74 29 | moved\n|",fnout)|
|000046b0| 3b 20 65 78 69 74 28 31 | 29 3b 20 7d 0a 58 20 20 |; exit(1|); }.X |
|000046c0| 20 2f 2a 20 52 61 63 65 | 21 20 52 61 63 65 21 20 | /* Race|! Race! |
|000046d0| 52 61 63 65 21 20 2a 2f | 0a 58 20 20 20 69 66 20 |Race! */|.X if |
|000046e0| 28 75 74 69 6d 65 73 28 | 66 6e 6f 75 74 2c 74 76 |(utimes(|fnout,tv|
|000046f0| 70 29 20 3d 3d 20 2d 31 | 29 0a 58 20 20 20 20 7b |p) == -1|).X {|
|00004700| 20 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c | fprintf|(stderr,|
|00004710| 22 66 69 6c 74 65 72 66 | 69 6c 65 3a 20 77 61 72 |"filterf|ile: war|
|00004720| 6e 69 6e 67 3a 20 63 61 | 6e 6e 6f 74 20 73 65 74 |ning: ca|nnot set|
|00004730| 20 74 69 6d 65 73 20 6f | 66 20 6f 75 74 70 75 74 | times o|f output|
|00004740| 20 66 69 6c 65 20 22 29 | 3b 0a 58 20 20 20 20 20 | file ")|;.X |
|00004750| 70 65 72 72 6f 72 28 66 | 6e 6f 75 74 29 3b 20 65 |perror(f|nout); e|
|00004760| 78 69 74 28 31 29 3b 20 | 7d 0a 58 20 20 7d 0a 58 |xit(1); |}.X }.X|
|00004770| 0a 58 20 65 78 69 74 28 | 30 29 3b 0a 58 7d 0a 45 |.X exit(|0);.X}.E|
|00004780| 4e 44 5f 4f 46 5f 46 49 | 4c 45 0a 69 66 20 74 65 |ND_OF_FI|LE.if te|
|00004790| 73 74 20 39 33 30 33 20 | 2d 6e 65 20 60 77 63 20 |st 9303 |-ne `wc |
|000047a0| 2d 63 20 3c 27 66 69 6c | 74 65 72 66 69 6c 65 2e |-c <'fil|terfile.|
|000047b0| 63 27 60 3b 20 74 68 65 | 6e 0a 20 20 20 20 65 63 |c'`; the|n. ec|
|000047c0| 68 6f 20 73 68 61 72 3a | 20 5c 22 27 66 69 6c 74 |ho shar:| \"'filt|
|000047d0| 65 72 66 69 6c 65 2e 63 | 27 5c 22 20 75 6e 70 61 |erfile.c|'\" unpa|
|000047e0| 63 6b 65 64 20 77 69 74 | 68 20 77 72 6f 6e 67 20 |cked wit|h wrong |
|000047f0| 73 69 7a 65 21 0a 66 69 | 0a 23 20 65 6e 64 20 6f |size!.fi|.# end o|
|00004800| 66 20 27 66 69 6c 74 65 | 72 66 69 6c 65 2e 63 27 |f 'filte|rfile.c'|
|00004810| 0a 66 69 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |.fi.if t|est -f '|
|00004820| 4d 61 6b 65 66 69 6c 65 | 27 20 2d 61 20 22 24 7b |Makefile|' -a "${|
|00004830| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|00004840| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|00004850| 20 57 69 6c 6c 20 6e 6f | 74 20 63 6c 6f 62 62 65 | Will no|t clobbe|
|00004860| 72 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |r existi|ng file |
|00004870| 5c 22 27 4d 61 6b 65 66 | 69 6c 65 27 5c 22 0a 65 |\"'Makef|ile'\".e|
|00004880| 6c 73 65 0a 65 63 68 6f | 20 73 68 61 72 3a 20 45 |lse.echo| shar: E|
|00004890| 78 74 72 61 63 74 69 6e | 67 20 5c 22 27 4d 61 6b |xtractin|g \"'Mak|
|000048a0| 65 66 69 6c 65 27 5c 22 | 20 5c 28 32 33 36 20 63 |efile'\"| \(236 c|
|000048b0| 68 61 72 61 63 74 65 72 | 73 5c 29 0a 73 65 64 20 |haracter|s\).sed |
|000048c0| 22 73 2f 5e 58 2f 2f 22 | 20 3e 27 4d 61 6b 65 66 |"s/^X//"| >'Makef|
|000048d0| 69 6c 65 27 20 3c 3c 27 | 45 4e 44 5f 4f 46 5f 46 |ile' <<'|END_OF_F|
|000048e0| 49 4c 45 27 0a 58 43 43 | 4f 50 54 53 3d 2d 4f 0a |ILE'.XCC|OPTS=-O.|
|000048f0| 58 4e 52 4f 46 46 4f 50 | 54 53 3d 2d 6d 61 6e 0a |XNROFFOP|TS=-man.|
|00004900| 58 0a 58 64 65 66 61 75 | 6c 74 3a 20 61 6c 6c 0a |X.Xdefau|lt: all.|
|00004910| 58 0a 58 61 6c 6c 3a 20 | 66 69 6c 74 65 72 66 69 |X.Xall: |filterfi|
|00004920| 6c 65 20 66 69 6c 74 65 | 72 66 69 6c 65 2e 31 0a |le filte|rfile.1.|
|00004930| 58 0a 58 66 69 6c 74 65 | 72 66 69 6c 65 3a 20 66 |X.Xfilte|rfile: f|
|00004940| 69 6c 74 65 72 66 69 6c | 65 2e 63 20 4d 61 6b 65 |ilterfil|e.c Make|
|00004950| 66 69 6c 65 0a 58 09 63 | 63 20 24 28 43 43 4f 50 |file.X.c|c $(CCOP|
|00004960| 54 53 29 20 2d 6f 20 66 | 69 6c 74 65 72 66 69 6c |TS) -o f|ilterfil|
|00004970| 65 20 66 69 6c 74 65 72 | 66 69 6c 65 2e 63 0a 58 |e filter|file.c.X|
|00004980| 0a 58 66 69 6c 74 65 72 | 66 69 6c 65 2e 31 3a 20 |.Xfilter|file.1: |
|00004990| 66 69 6c 74 65 72 66 69 | 6c 65 2e 6d 61 6e 20 4d |filterfi|le.man M|
|000049a0| 61 6b 65 66 69 6c 65 0a | 58 09 6e 72 6f 66 66 20 |akefile.|X.nroff |
|000049b0| 24 28 4e 52 4f 46 46 4f | 50 54 53 29 20 3c 20 66 |$(NROFFO|PTS) < f|
|000049c0| 69 6c 74 65 72 66 69 6c | 65 2e 6d 61 6e 20 3e 20 |ilterfil|e.man > |
|000049d0| 66 69 6c 74 65 72 66 69 | 6c 65 2e 31 0a 45 4e 44 |filterfi|le.1.END|
|000049e0| 5f 4f 46 5f 46 49 4c 45 | 0a 69 66 20 74 65 73 74 |_OF_FILE|.if test|
|000049f0| 20 32 33 36 20 2d 6e 65 | 20 60 77 63 20 2d 63 20 | 236 -ne| `wc -c |
|00004a00| 3c 27 4d 61 6b 65 66 69 | 6c 65 27 60 3b 20 74 68 |<'Makefi|le'`; th|
|00004a10| 65 6e 0a 20 20 20 20 65 | 63 68 6f 20 73 68 61 72 |en. e|cho shar|
|00004a20| 3a 20 5c 22 27 4d 61 6b | 65 66 69 6c 65 27 5c 22 |: \"'Mak|efile'\"|
|00004a30| 20 75 6e 70 61 63 6b 65 | 64 20 77 69 74 68 20 77 | unpacke|d with w|
|00004a40| 72 6f 6e 67 20 73 69 7a | 65 21 0a 66 69 0a 23 20 |rong siz|e!.fi.# |
|00004a50| 65 6e 64 20 6f 66 20 27 | 4d 61 6b 65 66 69 6c 65 |end of '|Makefile|
|00004a60| 27 0a 66 69 0a 65 63 68 | 6f 20 73 68 61 72 3a 20 |'.fi.ech|o shar: |
|00004a70| 45 6e 64 20 6f 66 20 73 | 68 65 6c 6c 20 61 72 63 |End of s|hell arc|
|00004a80| 68 69 76 65 2e 0a 65 78 | 69 74 20 30 0a 0a |hive..ex|it 0.. |
+--------+-------------------------+-------------------------+--------+--------+