home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / misc / volume03 / newspa.ths < prev    next >
SHell self-extracting ARchive  |  1991-08-27  |  6.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: newspa.ths

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 Proximity Technology Lexicon/Thesaurus (other/proximityTechLexicon) ext Unsupported
1% dexvert WordPerfect Thesaurus (other/wordPerfectThesaurus) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 75 75 | 6e 65 74 21 77 79 73 65 |Path: uu|net!wyse|
|00000010| 21 76 73 69 31 21 75 62 | 76 61 78 21 61 6d 65 73 |!vsi1!ub|vax!ames|
|00000020| 21 6e 63 61 72 21 68 75 | 73 63 36 21 6e 65 63 6e |!ncar!hu|sc6!necn|
|00000030| 74 63 21 6e 63 6f 61 73 | 74 21 61 6c 6c 62 65 72 |tc!ncoas|t!allber|
|00000040| 79 0a 46 72 6f 6d 3a 20 | 6a 62 75 63 6b 40 65 70 |y.From: |jbuck@ep|
|00000050| 69 6d 61 73 73 2e 45 50 | 49 2e 43 4f 4d 20 28 4a |imass.EP|I.COM (J|
|00000060| 6f 65 20 42 75 63 6b 29 | 0a 4e 65 77 73 67 72 6f |oe Buck)|.Newsgro|
|00000070| 75 70 73 3a 20 63 6f 6d | 70 2e 73 6f 75 72 63 65 |ups: com|p.source|
|00000080| 73 2e 6d 69 73 63 0a 53 | 75 62 6a 65 63 74 3a 20 |s.misc.S|ubject: |
|00000090| 76 30 33 69 30 36 36 3a | 20 50 65 72 6c 20 70 72 |v03i066:| Perl pr|
|000000a0| 6f 67 72 61 6d 20 66 6f | 72 20 61 63 63 75 6d 75 |ogram fo|r accumu|
|000000b0| 6c 61 74 69 6e 67 20 55 | 73 65 6e 65 74 20 74 72 |lating U|senet tr|
|000000c0| 61 66 66 69 63 20 73 74 | 61 74 69 73 74 69 63 73 |affic st|atistics|
|000000d0| 0a 4d 65 73 73 61 67 65 | 2d 49 44 3a 20 3c 32 32 |.Message|-ID: <22|
|000000e0| 35 30 40 65 70 69 6d 61 | 73 73 2e 45 50 49 2e 43 |50@epima|ss.EPI.C|
|000000f0| 4f 4d 3e 0a 44 61 74 65 | 3a 20 32 39 20 4a 75 6e |OM>.Date|: 29 Jun|
|00000100| 20 38 38 20 30 32 3a 35 | 34 3a 30 33 20 47 4d 54 | 88 02:5|4:03 GMT|
|00000110| 0a 53 65 6e 64 65 72 3a | 20 61 6c 6c 62 65 72 79 |.Sender:| allbery|
|00000120| 40 6e 63 6f 61 73 74 2e | 55 55 43 50 0a 52 65 70 |@ncoast.|UUCP.Rep|
|00000130| 6c 79 2d 54 6f 3a 20 6a | 62 75 63 6b 40 65 70 69 |ly-To: j|buck@epi|
|00000140| 6d 61 73 73 2e 45 50 49 | 2e 43 4f 4d 20 28 4a 6f |mass.EPI|.COM (Jo|
|00000150| 65 20 42 75 63 6b 29 0a | 4f 72 67 61 6e 69 7a 61 |e Buck).|Organiza|
|00000160| 74 69 6f 6e 3a 20 45 6e | 74 72 6f 70 69 63 20 50 |tion: En|tropic P|
|00000170| 72 6f 63 65 73 73 69 6e | 67 2c 20 49 6e 63 2e 2c |rocessin|g, Inc.,|
|00000180| 20 43 75 70 65 72 74 69 | 6e 6f 2c 20 43 41 0a 4c | Cuperti|no, CA.L|
|00000190| 69 6e 65 73 3a 20 32 33 | 30 0a 41 70 70 72 6f 76 |ines: 23|0.Approv|
|000001a0| 65 64 3a 20 61 6c 6c 62 | 65 72 79 40 6e 63 6f 61 |ed: allb|ery@ncoa|
|000001b0| 73 74 2e 55 55 43 50 0a | 0a 50 6f 73 74 69 6e 67 |st.UUCP.|.Posting|
|000001c0| 2d 6e 75 6d 62 65 72 3a | 20 56 6f 6c 75 6d 65 20 |-number:| Volume |
|000001d0| 33 2c 20 49 73 73 75 65 | 20 36 36 0a 53 75 62 6d |3, Issue| 66.Subm|
|000001e0| 69 74 74 65 64 2d 62 79 | 3a 20 22 4a 6f 65 20 42 |itted-by|: "Joe B|
|000001f0| 75 63 6b 22 20 3c 6a 62 | 75 63 6b 40 65 70 69 6d |uck" <jb|uck@epim|
|00000200| 61 73 73 2e 45 50 49 2e | 43 4f 4d 3e 0a 41 72 63 |ass.EPI.|COM>.Arc|
|00000210| 68 69 76 65 2d 6e 61 6d | 65 3a 20 6e 65 77 73 70 |hive-nam|e: newsp|
|00000220| 61 74 68 73 0a 0a 23 21 | 20 2f 62 69 6e 2f 73 68 |aths..#!| /bin/sh|
|00000230| 0a 23 20 54 68 69 73 20 | 69 73 20 61 20 73 68 65 |.# This |is a she|
|00000240| 6c 6c 20 61 72 63 68 69 | 76 65 2c 20 6d 65 61 6e |ll archi|ve, mean|
|00000250| 69 6e 67 3a 0a 23 20 31 | 2e 20 52 65 6d 6f 76 65 |ing:.# 1|. Remove|
|00000260| 20 65 76 65 72 79 74 68 | 69 6e 67 20 61 62 6f 76 | everyth|ing abov|
|00000270| 65 20 74 68 65 20 23 21 | 20 2f 62 69 6e 2f 73 68 |e the #!| /bin/sh|
|00000280| 20 6c 69 6e 65 2e 0a 23 | 20 32 2e 20 53 61 76 65 | line..#| 2. Save|
|00000290| 20 74 68 65 20 72 65 73 | 75 6c 74 69 6e 67 20 74 | the res|ulting t|
|000002a0| 65 78 74 20 69 6e 20 61 | 20 66 69 6c 65 2e 0a 23 |ext in a| file..#|
|000002b0| 20 33 2e 20 45 78 65 63 | 75 74 65 20 74 68 65 20 | 3. Exec|ute the |
|000002c0| 66 69 6c 65 20 77 69 74 | 68 20 2f 62 69 6e 2f 73 |file wit|h /bin/s|
|000002d0| 68 20 28 6e 6f 74 20 63 | 73 68 29 20 74 6f 20 63 |h (not c|sh) to c|
|000002e0| 72 65 61 74 65 20 74 68 | 65 20 66 69 6c 65 73 3a |reate th|e files:|
|000002f0| 0a 23 09 52 45 41 44 4d | 45 0a 23 09 6e 65 77 73 |.#.READM|E.#.news|
|00000300| 70 61 74 68 73 0a 23 09 | 6e 65 77 73 70 61 74 68 |paths.#.|newspath|
|00000310| 73 2e 31 0a 23 09 74 77 | 6f 77 61 79 0a 23 20 54 |s.1.#.tw|oway.# T|
|00000320| 68 69 73 20 61 72 63 68 | 69 76 65 20 63 72 65 61 |his arch|ive crea|
|00000330| 74 65 64 3a 20 54 75 65 | 20 4a 75 6e 20 32 38 20 |ted: Tue| Jun 28 |
|00000340| 31 39 3a 35 32 3a 31 30 | 20 31 39 38 38 0a 65 78 |19:52:10| 1988.ex|
|00000350| 70 6f 72 74 20 50 41 54 | 48 3b 20 50 41 54 48 3d |port PAT|H; PATH=|
|00000360| 2f 62 69 6e 3a 24 50 41 | 54 48 0a 69 66 20 74 65 |/bin:$PA|TH.if te|
|00000370| 73 74 20 2d 66 20 27 52 | 45 41 44 4d 45 27 0a 74 |st -f 'R|EADME'.t|
|00000380| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|00000390| 77 69 6c 6c 20 6e 6f 74 | 20 6f 76 65 72 2d 77 72 |will not| over-wr|
|000003a0| 69 74 65 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ite exis|ting fil|
|000003b0| 65 20 22 27 52 45 41 44 | 4d 45 27 22 0a 65 6c 73 |e "'READ|ME'".els|
|000003c0| 65 0a 63 61 74 20 3c 3c | 20 5c 53 48 41 52 5f 45 |e.cat <<| \SHAR_E|
|000003d0| 4f 46 20 3e 20 27 52 45 | 41 44 4d 45 27 0a 48 65 |OF > 'RE|ADME'.He|
|000003e0| 72 65 27 73 20 74 68 65 | 20 73 74 75 66 66 20 49 |re's the| stuff I|
|000003f0| 20 75 73 65 64 20 74 6f | 20 67 65 6e 65 72 61 74 | used to| generat|
|00000400| 65 20 74 68 65 20 6d 61 | 70 20 69 6e 20 61 72 74 |e the ma|p in art|
|00000410| 69 63 6c 65 20 3c 32 32 | 34 39 40 65 70 69 6d 61 |icle <22|49@epima|
|00000420| 73 73 2e 65 70 69 2e 63 | 6f 6d 3e 2e 0a 48 61 76 |ss.epi.c|om>..Hav|
|00000430| 65 20 66 75 6e 2e 20 20 | 49 66 20 6f 6e 6c 79 20 |e fun. |If only |
|00000440| 69 74 20 64 72 65 77 20 | 74 68 65 20 6d 61 70 73 |it drew |the maps|
|00000450| 20 74 6f 6f 20 2d 2d 20 | 6d 61 79 62 65 20 42 72 | too -- |maybe Br|
|00000460| 69 61 6e 20 52 65 69 64 | 20 63 61 6e 20 61 74 74 |ian Reid| can att|
|00000470| 61 63 68 0a 69 74 20 74 | 6f 20 73 6f 6d 65 74 68 |ach.it t|o someth|
|00000480| 69 6e 67 2e 0a 0a 2d 20 | 4a 6f 65 0a 0a 53 48 41 |ing...- |Joe..SHA|
|00000490| 52 5f 45 4f 46 0a 66 69 | 20 23 20 65 6e 64 20 6f |R_EOF.fi| # end o|
|000004a0| 66 20 6f 76 65 72 77 72 | 69 74 69 6e 67 20 63 68 |f overwr|iting ch|
|000004b0| 65 63 6b 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |eck.if t|est -f '|
|000004c0| 6e 65 77 73 70 61 74 68 | 73 27 0a 74 68 65 6e 0a |newspath|s'.then.|
|000004d0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 77 69 6c 6c |.echo sh|ar: will|
|000004e0| 20 6e 6f 74 20 6f 76 65 | 72 2d 77 72 69 74 65 20 | not ove|r-write |
|000004f0| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|00000500| 6e 65 77 73 70 61 74 68 | 73 27 22 0a 65 6c 73 65 |newspath|s'".else|
|00000510| 0a 63 61 74 20 3c 3c 20 | 5c 53 48 41 52 5f 45 4f |.cat << |\SHAR_EO|
|00000520| 46 20 3e 20 27 6e 65 77 | 73 70 61 74 68 73 27 0a |F > 'new|spaths'.|
|00000530| 23 21 20 2f 75 73 72 2f | 62 69 6e 2f 70 65 72 6c |#! /usr/|bin/perl|
|00000540| 0a 0a 23 20 43 6f 70 79 | 72 69 67 68 74 20 31 39 |..# Copy|right 19|
|00000550| 38 38 20 62 79 20 4a 6f | 73 65 70 68 20 54 2e 20 |88 by Jo|seph T. |
|00000560| 42 75 63 6b 2c 20 6a 62 | 75 63 6b 40 65 70 69 6d |Buck, jb|uck@epim|
|00000570| 61 73 73 2e 65 70 69 2e | 63 6f 6d 2e 0a 23 20 59 |ass.epi.|com..# Y|
|00000580| 6f 75 20 6d 61 79 20 66 | 72 65 65 6c 79 20 75 73 |ou may f|reely us|
|00000590| 65 20 61 6e 64 20 63 6f | 70 79 20 74 68 69 73 20 |e and co|py this |
|000005a0| 70 72 6f 67 72 61 6d 20 | 61 73 20 6c 6f 6e 67 20 |program |as long |
|000005b0| 61 73 20 79 6f 75 0a 23 | 20 6c 65 61 76 65 20 6d |as you.#| leave m|
|000005c0| 79 20 6e 61 6d 65 20 68 | 65 72 65 2e 0a 0a 23 20 |y name h|ere...# |
|000005d0| 6e 65 77 73 70 61 74 68 | 73 20 2d 2d 20 6e 65 77 |newspath|s -- new|
|000005e0| 73 20 70 61 74 68 20 73 | 74 61 74 69 73 74 69 63 |s path s|tatistic|
|000005f0| 73 20 67 61 74 68 65 72 | 65 72 0a 0a 23 20 54 68 |s gather|er..# Th|
|00000600| 69 73 20 70 65 72 6c 20 | 70 72 6f 67 72 61 6d 20 |is perl |program |
|00000610| 73 63 61 6e 73 20 74 68 | 72 6f 75 67 68 20 61 6c |scans th|rough al|
|00000620| 6c 20 74 68 65 20 6e 65 | 77 73 20 6f 6e 20 79 6f |l the ne|ws on yo|
|00000630| 75 72 20 73 70 6f 6f 6c | 0a 23 20 28 75 73 69 6e |ur spool|.# (usin|
|00000640| 67 20 74 68 65 20 68 69 | 73 74 6f 72 79 20 66 69 |g the hi|story fi|
|00000650| 6c 65 20 74 6f 20 66 69 | 6e 64 20 74 68 65 20 61 |le to fi|nd the a|
|00000660| 72 74 69 63 6c 65 73 29 | 20 61 6e 64 20 70 72 69 |rticles)| and pri|
|00000670| 6e 74 73 0a 23 20 6f 75 | 74 20 61 20 73 6f 72 74 |nts.# ou|t a sort|
|00000680| 65 64 20 6c 69 73 74 20 | 6f 66 20 66 72 65 71 75 |ed list |of frequ|
|00000690| 65 6e 63 69 65 73 20 74 | 68 61 74 20 65 61 63 68 |encies t|hat each|
|000006a0| 20 70 61 69 72 20 6f 66 | 20 68 6f 73 74 73 0a 23 | pair of| hosts.#|
|000006b0| 20 61 70 70 65 61 72 73 | 20 69 6e 20 74 68 65 20 | appears| in the |
|000006c0| 50 61 74 68 3a 20 68 65 | 61 64 65 72 73 2e 20 20 |Path: he|aders. |
|000006d0| 54 68 61 74 20 69 73 2c | 20 69 74 20 64 65 74 65 |That is,| it dete|
|000006e0| 72 6d 69 6e 65 73 20 68 | 6f 77 2c 0a 23 20 6f 6e |rmines h|ow,.# on|
|000006f0| 20 61 76 65 72 61 67 65 | 2c 20 79 6f 75 72 20 6e | average|, your n|
|00000700| 65 77 73 20 67 65 74 73 | 20 74 6f 20 79 6f 75 2e |ews gets| to you.|
|00000710| 0a 23 0a 23 20 49 66 20 | 61 6e 20 61 72 67 75 6d |.#.# If |an argum|
|00000720| 65 6e 74 20 69 73 20 67 | 69 76 65 6e 2c 20 69 74 |ent is g|iven, it|
|00000730| 20 69 73 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 | is the |name of |
|00000740| 61 20 70 72 65 76 69 6f | 75 73 20 6f 75 74 70 75 |a previo|us outpu|
|00000750| 74 0a 23 20 6f 66 20 74 | 68 69 73 20 70 72 6f 67 |t.# of t|his prog|
|00000760| 72 61 6d 2e 20 20 54 68 | 65 20 66 69 67 75 72 65 |ram. Th|e figure|
|00000770| 73 20 61 72 65 20 72 65 | 61 64 20 69 6e 2c 20 61 |s are re|ad in, a|
|00000780| 6e 64 20 68 6f 73 74 20 | 70 61 69 72 73 0a 23 20 |nd host |pairs.# |
|00000790| 66 72 6f 6d 20 61 72 74 | 69 63 6c 65 73 20 6e 65 |from art|icles ne|
|000007a0| 77 65 72 20 74 68 61 6e | 20 74 68 65 20 69 6e 70 |wer than| the inp|
|000007b0| 75 74 20 66 69 6c 65 20 | 61 72 65 20 61 64 64 65 |ut file |are adde|
|000007c0| 64 20 69 6e 2e 0a 23 20 | 53 6f 20 74 68 61 74 20 |d in..# |So that |
|000007d0| 74 68 69 73 20 77 69 6c | 6c 20 77 6f 72 6b 2c 20 |this wil|l work, |
|000007e0| 74 68 65 20 66 69 72 73 | 74 20 6c 69 6e 65 20 6f |the firs|t line o|
|000007f0| 66 20 74 68 65 20 6f 75 | 74 70 75 74 20 6f 66 20 |f the ou|tput of |
|00000800| 74 68 65 0a 23 20 70 72 | 6f 67 72 61 6d 20 69 73 |the.# pr|ogram is|
|00000810| 20 6f 66 20 74 68 65 20 | 66 6f 72 6d 0a 23 20 4c | of the |form.# L|
|00000820| 61 73 74 2d 49 44 3a 20 | 3c 35 36 37 39 40 63 68 |ast-ID: |<5679@ch|
|00000830| 69 6e 65 74 2e 55 55 43 | 50 3e 0a 23 20 28 77 69 |inet.UUC|P>.# (wi|
|00000840| 74 68 6f 75 74 20 74 68 | 65 20 23 20 73 69 67 6e |thout th|e # sign|
|00000850| 29 2e 20 20 49 74 20 72 | 65 63 6f 72 64 73 20 74 |). It r|ecords t|
|00000860| 68 65 20 6c 61 73 74 20 | 4d 65 73 73 61 67 65 2d |he last |Message-|
|00000870| 49 44 20 69 6e 20 74 68 | 65 0a 23 20 68 69 73 74 |ID in th|e.# hist|
|00000880| 6f 72 79 20 66 69 6c 65 | 3b 20 74 6f 20 61 64 64 |ory file|; to add|
|00000890| 20 6e 65 77 20 61 72 74 | 69 63 6c 65 73 2c 20 77 | new art|icles, w|
|000008a0| 65 20 73 6b 69 70 20 69 | 6e 20 74 68 65 20 68 69 |e skip i|n the hi|
|000008b0| 73 74 6f 72 79 20 66 69 | 6c 65 0a 23 20 75 6e 74 |story fi|le.# unt|
|000008c0| 69 6c 20 77 65 20 66 69 | 6e 64 20 69 74 2e 0a 0a |il we fi|nd it...|
|000008d0| 24 73 6b 69 70 20 3d 20 | 30 3b 0a 69 66 20 28 24 |$skip = |0;.if ($|
|000008e0| 23 41 52 47 56 20 3e 3d | 20 30 29 20 7b 0a 20 20 |#ARGV >=| 0) {. |
|000008f0| 20 20 24 6f 66 69 6c 65 | 20 3d 20 24 41 52 47 56 | $ofile| = $ARGV|
|00000900| 5b 30 5d 3b 0a 20 20 20 | 20 64 69 65 20 22 43 61 |[0];. | die "Ca|
|00000910| 6e 27 74 20 6f 70 65 6e | 20 24 6f 66 69 6c 65 21 |n't open| $ofile!|
|00000920| 5c 6e 22 20 75 6e 6c 65 | 73 73 20 6f 70 65 6e 20 |\n" unle|ss open |
|00000930| 28 6f 66 2c 20 24 6f 66 | 69 6c 65 29 3b 0a 23 20 |(of, $of|ile);.# |
|00000940| 46 69 72 73 74 20 6c 69 | 6e 65 20 6d 75 73 74 20 |First li|ne must |
|00000950| 63 6f 6e 74 61 69 6e 20 | 6c 61 73 74 20 6d 73 67 |contain |last msg|
|00000960| 69 64 20 74 6f 20 75 73 | 65 2e 0a 20 20 20 20 24 |id to us|e.. $|
|00000970| 5f 20 3d 20 3c 6f 66 3e | 3b 0a 20 20 20 20 28 24 |_ = <of>|;. ($|
|00000980| 6b 65 79 2c 20 24 6c 61 | 73 74 5f 69 64 29 20 3d |key, $la|st_id) =|
|00000990| 20 73 70 6c 69 74 20 28 | 27 20 27 29 3b 0a 20 20 | split (|' ');. |
|000009a0| 20 20 64 69 65 20 22 49 | 6e 76 61 6c 69 64 20 69 | die "I|nvalid i|
|000009b0| 6e 70 75 74 20 66 69 6c | 65 20 66 6f 72 6d 61 74 |nput fil|e format|
|000009c0| 21 5c 6e 22 20 69 66 20 | 28 24 6b 65 79 20 6e 65 |!\n" if |($key ne|
|000009d0| 20 22 4c 61 73 74 2d 49 | 44 3a 22 29 3b 0a 20 20 | "Last-I|D:");. |
|000009e0| 20 20 24 73 6b 69 70 20 | 3d 20 31 3b 0a 23 20 52 | $skip |= 1;.# R|
|000009f0| 65 61 64 20 69 6e 20 74 | 68 65 20 6f 6c 64 20 66 |ead in t|he old f|
|00000a00| 69 6c 65 2e 0a 20 20 20 | 20 77 68 69 6c 65 20 28 |ile.. | while (|
|00000a10| 3c 6f 66 3e 29 20 7b 0a | 09 28 24 63 6e 74 2c 20 |<of>) {.|.($cnt, |
|00000a20| 24 70 61 69 72 29 20 3d | 20 73 70 6c 69 74 28 27 |$pair) =| split('|
|00000a30| 20 27 29 3b 0a 09 24 70 | 63 6f 75 6e 74 7b 24 70 | ');..$p|count{$p|
|00000a40| 61 69 72 7d 20 3d 20 24 | 63 6e 74 3b 0a 20 20 20 |air} = $|cnt;. |
|00000a50| 20 7d 0a 7d 0a 23 20 4c | 65 74 27 73 20 67 6f 2e | }.}.# L|et's go.|
|00000a60| 0a 0a 64 69 65 20 22 43 | 61 6e 27 74 20 6f 70 65 |..die "C|an't ope|
|00000a70| 6e 20 68 69 73 74 6f 72 | 79 20 66 69 6c 65 21 5c |n histor|y file!\|
|00000a80| 6e 22 20 75 6e 6c 65 73 | 73 20 6f 70 65 6e 20 28 |n" unles|s open (|
|00000a90| 68 69 73 74 2c 20 22 2f | 75 73 72 2f 6c 69 62 2f |hist, "/|usr/lib/|
|00000aa0| 6e 65 77 73 2f 68 69 73 | 74 6f 72 79 22 29 3b 0a |news/his|tory");.|
|00000ab0| 64 69 65 20 22 43 61 6e | 27 74 20 63 64 20 74 6f |die "Can|'t cd to|
|00000ac0| 20 6e 65 77 73 20 73 70 | 6f 6f 6c 20 64 69 72 65 | news sp|ool dire|
|00000ad0| 63 74 6f 72 79 21 5c 6e | 22 20 75 6e 6c 65 73 73 |ctory!\n|" unless|
|00000ae0| 20 63 68 64 69 72 20 28 | 22 2f 75 73 72 2f 73 70 | chdir (|"/usr/sp|
|00000af0| 6f 6f 6c 2f 6e 65 77 73 | 22 29 3b 0a 0a 24 6e 70 |ool/news|");..$np|
|00000b00| 20 3d 20 24 6e 6c 6f 63 | 61 6c 20 3d 20 30 3b 0a | = $nloc|al = 0;.|
|00000b10| 77 68 69 6c 65 20 28 3c | 68 69 73 74 3e 29 20 7b |while (<|hist>) {|
|00000b20| 0a 23 0a 23 20 24 5f 20 | 63 6f 6e 74 61 69 6e 73 |.#.# $_ |contains|
|00000b30| 20 61 20 6c 69 6e 65 20 | 66 72 6f 6d 20 74 68 65 | a line |from the|
|00000b40| 20 68 69 73 74 6f 72 79 | 20 66 69 6c 65 2e 20 20 | history| file. |
|00000b50| 50 61 72 73 65 20 69 74 | 2e 0a 23 20 53 6b 69 70 |Parse it|..# Skip|
|00000b60| 20 69 74 20 69 66 20 74 | 68 65 20 61 72 74 69 63 | it if t|he artic|
|00000b70| 6c 65 20 68 61 73 20 62 | 65 65 6e 20 63 61 6e 63 |le has b|een canc|
|00000b80| 65 6c 6c 65 64 20 6f 72 | 20 65 78 70 69 72 65 64 |elled or| expired|
|00000b90| 0a 23 20 49 66 20 74 68 | 65 20 24 73 6b 69 70 20 |.# If th|e $skip |
|00000ba0| 66 6c 61 67 20 69 73 20 | 74 72 75 65 2c 20 77 65 |flag is |true, we|
|00000bb0| 20 73 6b 69 70 20 75 6e | 74 69 6c 20 77 65 20 68 | skip un|til we h|
|00000bc0| 61 76 65 20 74 68 65 20 | 72 69 67 68 74 20 6d 73 |ave the |right ms|
|00000bd0| 67 69 64 0a 23 0a 20 20 | 20 20 28 24 69 64 2c 20 |gid.#. | ($id, |
|00000be0| 24 64 61 74 65 2c 20 24 | 74 69 6d 65 2c 20 24 66 |$date, $|time, $f|
|00000bf0| 69 6c 65 29 20 3d 20 73 | 70 6c 69 74 20 28 27 20 |ile) = s|plit (' |
|00000c00| 27 29 3b 0a 20 20 20 20 | 6e 65 78 74 20 69 66 20 |');. |next if |
|00000c10| 28 24 66 69 6c 65 20 65 | 71 20 27 63 61 6e 63 65 |($file e|q 'cance|
|00000c20| 6c 6c 65 64 27 20 7c 7c | 20 24 66 69 6c 65 20 65 |lled' ||| $file e|
|00000c30| 71 20 27 27 29 3b 0a 20 | 20 20 20 69 66 20 28 24 |q '');. | if ($|
|00000c40| 73 6b 69 70 29 20 7b 0a | 09 69 66 20 28 24 69 64 |skip) {.|.if ($id|
|00000c50| 20 65 71 20 24 6c 61 73 | 74 5f 69 64 29 20 7b 20 | eq $las|t_id) { |
|00000c60| 24 73 6b 69 70 20 3d 20 | 30 3b 20 7d 0a 09 6e 65 |$skip = |0; }..ne|
|00000c70| 78 74 3b 0a 20 20 20 20 | 7d 0a 23 0a 23 20 66 6f |xt;. |}.#.# fo|
|00000c80| 72 6d 61 74 20 6f 66 20 | 66 69 65 6c 64 20 69 73 |rmat of |field is|
|00000c90| 20 6c 69 6b 65 20 63 6f | 6d 70 2e 73 6f 75 72 63 | like co|mp.sourc|
|00000ca0| 65 73 2e 75 6e 69 78 2f | 32 33 34 35 20 2e 20 20 |es.unix/|2345 . |
|00000cb0| 47 65 74 20 6e 67 20 61 | 6e 64 20 66 69 6c 65 6e |Get ng a|nd filen|
|00000cc0| 61 6d 65 2e 0a 23 0a 20 | 20 20 20 28 24 6e 67 2c |ame..#. | ($ng,|
|00000cd0| 20 24 6e 29 20 3d 20 73 | 70 6c 69 74 20 28 2f 5c | $n) = s|plit (/\|
|00000ce0| 2f 2f 2c 20 24 66 69 6c | 65 29 3b 0a 20 20 20 20 |//, $fil|e);. |
|00000cf0| 24 66 69 6c 65 20 3d 7e | 20 74 72 25 2e 25 2f 25 |$file =~| tr%.%/%|
|00000d00| 3b 0a 23 0a 23 20 54 68 | 65 20 66 6f 6c 6c 6f 77 |;.#.# Th|e follow|
|00000d10| 69 6e 67 20 6d 61 79 20 | 62 65 20 75 73 65 64 20 |ing may |be used |
|00000d20| 74 6f 20 73 6b 69 70 20 | 61 6e 79 20 6c 6f 63 61 |to skip |any loca|
|00000d30| 6c 20 67 72 6f 75 70 73 | 2e 20 20 48 65 72 65 2c |l groups|. Here,|
|00000d40| 20 77 65 0a 23 20 73 6b | 69 70 20 67 72 6f 75 70 | we.# sk|ip group|
|00000d50| 20 6e 61 6d 65 73 20 62 | 65 67 69 6e 6e 69 6e 67 | names b|eginning|
|00000d60| 20 77 69 74 68 20 22 65 | 70 69 22 20 6f 72 20 22 | with "e|pi" or "|
|00000d70| 73 75 22 2e 20 20 43 68 | 61 6e 67 65 20 74 6f 20 |su". Ch|ange to |
|00000d80| 73 75 69 74 20 74 61 73 | 74 65 2e 0a 23 0a 20 20 |suit tas|te..#. |
|00000d90| 20 20 6e 65 78 74 20 69 | 66 20 24 6e 67 20 3d 7e | next i|f $ng =~|
|00000da0| 20 2f 5e 65 70 69 7c 5e | 73 75 2f 3b 0a 20 20 20 | /^epi|^|su/;. |
|00000db0| 20 6e 65 78 74 20 75 6e | 6c 65 73 73 20 6f 70 65 | next un|less ope|
|00000dc0| 6e 20 28 61 72 74 2c 20 | 24 66 69 6c 65 29 3b 09 |n (art, |$file);.|
|00000dd0| 23 20 73 6b 69 70 20 69 | 66 20 63 61 6e 6e 6f 74 |# skip i|f cannot|
|00000de0| 20 6f 70 65 6e 20 66 69 | 6c 65 0a 23 0a 23 20 41 | open fi|le.#.# A|
|00000df0| 72 74 69 63 6c 65 20 4f | 4b 2e 20 20 47 65 74 20 |rticle O|K. Get |
|00000e00| 69 74 73 20 70 61 74 68 | 2e 0a 20 20 20 20 77 68 |its path|.. wh|
|00000e10| 69 6c 65 20 28 3c 61 72 | 74 3e 29 20 7b 0a 20 20 |ile (<ar|t>) {. |
|00000e20| 20 20 20 20 20 20 28 24 | 68 74 79 70 65 2c 20 24 | ($|htype, $|
|00000e30| 68 76 61 6c 75 65 29 20 | 3d 20 73 70 6c 69 74 20 |hvalue) |= split |
|00000e40| 28 27 20 27 29 3b 0a 09 | 69 66 20 28 24 68 74 79 |(' ');..|if ($hty|
|00000e50| 70 65 20 65 71 20 22 50 | 61 74 68 3a 22 29 20 7b |pe eq "P|ath:") {|
|00000e60| 0a 23 20 57 65 20 68 61 | 76 65 20 74 68 65 20 70 |.# We ha|ve the p|
|00000e70| 61 74 68 2c 20 69 6e 20 | 68 76 61 6c 75 65 2e 0a |ath, in |hvalue..|
|00000e80| 09 20 20 20 20 24 6e 70 | 2b 2b 3b 0a 09 20 20 20 |. $np|++;.. |
|00000e90| 20 40 70 61 74 68 20 3d | 20 73 70 6c 69 74 20 28 | @path =| split (|
|00000ea0| 2f 21 2f 2c 20 24 68 76 | 61 6c 75 65 29 3b 0a 23 |/!/, $hv|alue);.#|
|00000eb0| 20 48 61 6e 64 6c 65 20 | 6c 6f 63 61 6c 6c 79 20 | Handle |locally |
|00000ec0| 70 6f 73 74 65 64 20 61 | 72 74 69 63 6c 65 73 2e |posted a|rticles.|
|00000ed0| 0a 09 20 20 20 20 69 66 | 20 28 24 23 70 61 74 68 |.. if| ($#path|
|00000ee0| 20 3c 20 32 29 20 7b 20 | 24 6e 6c 6f 63 61 6c 2b | < 2) { |$nlocal+|
|00000ef0| 2b 3b 20 6c 61 73 74 3b | 7d 0a 23 20 43 72 65 61 |+; last;|}.# Crea|
|00000f00| 74 65 20 61 6e 64 20 63 | 6f 75 6e 74 20 70 61 69 |te and c|ount pai|
|00000f10| 72 73 2e 0a 09 20 20 20 | 20 66 6f 72 20 28 24 69 |rs... | for ($i|
|00000f20| 20 3d 20 30 3b 20 24 69 | 20 3c 20 24 23 70 61 74 | = 0; $i| < $#pat|
|00000f30| 68 20 2d 20 31 3b 20 24 | 69 2b 2b 29 20 7b 0a 09 |h - 1; $|i++) {..|
|00000f40| 09 24 70 61 69 72 20 3d | 20 24 70 61 74 68 5b 24 |.$pair =| $path[$|
|00000f50| 69 5d 20 2e 20 22 21 22 | 20 2e 20 24 70 61 74 68 |i] . "!"| . $path|
|00000f60| 5b 24 69 2b 31 5d 3b 0a | 09 09 24 70 63 6f 75 6e |[$i+1];.|..$pcoun|
|00000f70| 74 7b 24 70 61 69 72 7d | 20 2b 3d 20 31 3b 0a 09 |t{$pair}| += 1;..|
|00000f80| 20 20 20 20 7d 0a 09 20 | 20 20 20 6c 61 73 74 3b | }.. | last;|
|00000f90| 0a 09 7d 0a 20 20 20 20 | 7d 0a 7d 0a 23 20 4d 61 |..}. |}.}.# Ma|
|00000fa0| 6b 65 20 73 75 72 65 20 | 70 72 69 6e 74 20 6d 65 |ke sure |print me|
|00000fb0| 73 73 61 67 65 20 63 6f | 6d 65 73 20 6f 75 74 20 |ssage co|mes out |
|00000fc0| 62 65 66 6f 72 65 20 73 | 6f 72 74 20 64 61 74 61 |before s|ort data|
|00000fd0| 2e 0a 24 7c 20 3d 20 31 | 3b 0a 70 72 69 6e 74 20 |..$| = 1|;.print |
|00000fe0| 22 4c 61 73 74 2d 49 44 | 3a 20 24 69 64 5c 6e 22 |"Last-ID|: $id\n"|
|00000ff0| 3b 0a 24 7c 20 3d 20 30 | 3b 0a 23 20 77 72 69 74 |;.$| = 0|;.# writ|
|00001000| 65 20 74 68 65 20 64 61 | 74 61 20 6f 75 74 2c 20 |e the da|ta out, |
|00001010| 73 6f 72 74 65 64 2e 20 | 20 4f 70 65 6e 20 61 20 |sorted. | Open a |
|00001020| 70 69 70 65 2e 0a 64 69 | 65 20 22 43 61 6e 27 74 |pipe..di|e "Can't|
|00001030| 20 65 78 65 63 20 73 6f | 72 74 21 5c 6e 22 20 75 | exec so|rt!\n" u|
|00001040| 6e 6c 65 73 73 20 6f 70 | 65 6e 20 28 73 6f 72 74 |nless op|en (sort|
|00001050| 2c 20 22 7c 73 6f 72 74 | 20 2d 6e 72 22 29 3b 0a |, "|sort| -nr");.|
|00001060| 0a 77 68 69 6c 65 20 28 | 28 24 70 61 69 72 2c 20 |.while (|($pair, |
|00001070| 24 6e 29 20 3d 20 65 61 | 63 68 20 28 70 63 6f 75 |$n) = ea|ch (pcou|
|00001080| 6e 74 29 29 20 7b 0a 20 | 20 20 20 70 72 69 6e 74 |nt)) {. | print|
|00001090| 66 20 73 6f 72 74 20 28 | 22 25 36 64 20 25 73 5c |f sort (|"%6d %s\|
|000010a0| 6e 22 2c 20 24 6e 2c 20 | 24 70 61 69 72 29 3b 0a |n", $n, |$pair);.|
|000010b0| 7d 0a 63 6c 6f 73 65 20 | 73 6f 72 74 3b 0a 53 48 |}.close |sort;.SH|
|000010c0| 41 52 5f 45 4f 46 0a 66 | 69 20 23 20 65 6e 64 20 |AR_EOF.f|i # end |
|000010d0| 6f 66 20 6f 76 65 72 77 | 72 69 74 69 6e 67 20 63 |of overw|riting c|
|000010e0| 68 65 63 6b 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |heck.if |test -f |
|000010f0| 27 6e 65 77 73 70 61 74 | 68 73 2e 31 27 0a 74 68 |'newspat|hs.1'.th|
|00001100| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 77 |en..echo| shar: w|
|00001110| 69 6c 6c 20 6e 6f 74 20 | 6f 76 65 72 2d 77 72 69 |ill not |over-wri|
|00001120| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00001130| 20 22 27 6e 65 77 73 70 | 61 74 68 73 2e 31 27 22 | "'newsp|aths.1'"|
|00001140| 0a 65 6c 73 65 0a 63 61 | 74 20 3c 3c 20 5c 53 48 |.else.ca|t << \SH|
|00001150| 41 52 5f 45 4f 46 20 3e | 20 27 6e 65 77 73 70 61 |AR_EOF >| 'newspa|
|00001160| 74 68 73 2e 31 27 0a 2e | 54 48 20 4e 45 57 53 50 |ths.1'..|TH NEWSP|
|00001170| 41 54 48 53 20 31 20 35 | 2f 33 31 2f 38 38 0a 2e |ATHS 1 5|/31/88..|
|00001180| 53 48 20 22 4e 41 4d 45 | 22 0a 6e 65 77 73 70 61 |SH "NAME|".newspa|
|00001190| 74 68 73 20 5c 2d 20 63 | 6f 6c 6c 65 63 74 20 68 |ths \- c|ollect h|
|000011a0| 6f 73 74 20 63 6f 6e 6e | 65 63 74 69 76 69 74 79 |ost conn|ectivity|
|000011b0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 66 72 6f | informa|tion fro|
|000011c0| 6d 20 55 73 65 6e 65 74 | 20 61 72 74 69 63 6c 65 |m Usenet| article|
|000011d0| 73 0a 2e 53 48 20 22 53 | 59 4e 4f 50 53 49 53 22 |s..SH "S|YNOPSIS"|
|000011e0| 0a 2e 42 20 6e 65 77 73 | 70 61 74 68 73 0a 5b 0a |..B news|paths.[.|
|000011f0| 2e 49 20 70 72 65 76 5f | 6f 75 74 0a 5d 0a 2e 53 |.I prev_|out.]..S|
|00001200| 48 20 22 44 45 53 43 52 | 49 50 54 49 4f 4e 22 0a |H "DESCR|IPTION".|
|00001210| 2e 49 20 4e 65 77 73 70 | 61 74 68 73 0a 73 63 61 |.I Newsp|aths.sca|
|00001220| 6e 73 20 74 68 65 20 68 | 69 73 74 6f 72 79 20 66 |ns the h|istory f|
|00001230| 69 6c 65 2c 20 69 6e 0a | 2e 49 52 20 2f 75 73 72 |ile, in.|.IR /usr|
|00001240| 2f 6c 69 62 2f 6e 65 77 | 73 2f 68 69 73 74 6f 72 |/lib/new|s/histor|
|00001250| 79 20 2c 0a 75 73 69 6e | 67 20 69 74 20 74 6f 20 |y ,.usin|g it to |
|00001260| 6c 6f 63 61 74 65 20 55 | 73 65 6e 65 74 20 61 72 |locate U|senet ar|
|00001270| 74 69 63 6c 65 73 2e 20 | 20 46 6f 72 20 65 61 63 |ticles. | For eac|
|00001280| 68 20 61 72 74 69 63 6c | 65 2c 20 74 68 65 20 50 |h articl|e, the P|
|00001290| 61 74 68 3a 0a 68 65 61 | 64 65 72 20 69 73 20 72 |ath:.hea|der is r|
|000012a0| 65 61 64 2c 20 61 6e 64 | 20 73 70 6c 69 74 20 75 |ead, and| split u|
|000012b0| 70 20 69 6e 74 6f 20 69 | 74 73 20 63 6f 6e 73 74 |p into i|ts const|
|000012c0| 69 74 75 65 6e 74 20 68 | 6f 73 74 20 70 61 69 72 |ituent h|ost pair|
|000012d0| 73 2e 0a 41 6e 20 61 73 | 73 6f 63 69 61 74 69 76 |s..An as|sociativ|
|000012e0| 65 20 61 72 72 61 79 20 | 6b 65 65 70 73 20 74 72 |e array |keeps tr|
|000012f0| 61 63 6b 20 6f 66 20 68 | 6f 77 20 6d 61 6e 79 20 |ack of h|ow many |
|00001300| 74 69 6d 65 73 20 65 61 | 63 68 20 70 61 69 72 20 |times ea|ch pair |
|00001310| 6f 66 0a 68 6f 73 74 73 | 20 61 70 70 65 61 72 73 |of.hosts| appears|
|00001320| 20 69 6e 20 61 20 50 61 | 74 68 3a 20 68 65 61 64 | in a Pa|th: head|
|00001330| 65 72 2e 20 20 45 76 65 | 72 79 20 61 72 74 69 63 |er. Eve|ry artic|
|00001340| 6c 65 20 69 6e 20 74 68 | 65 20 68 69 73 74 6f 72 |le in th|e histor|
|00001350| 79 20 66 69 6c 65 20 69 | 73 0a 73 63 61 6e 6e 65 |y file i|s.scanne|
|00001360| 64 2e 0a 2e 50 50 0a 54 | 68 65 20 6f 75 74 70 75 |d...PP.T|he outpu|
|00001370| 74 20 66 6f 72 6d 61 74 | 20 63 6f 6e 73 69 73 74 |t format| consist|
|00001380| 73 20 6f 66 20 74 68 65 | 20 6c 61 73 74 20 4d 65 |s of the| last Me|
|00001390| 73 73 61 67 65 2d 49 44 | 20 69 6e 20 74 68 65 20 |ssage-ID| in the |
|000013a0| 68 69 73 74 6f 72 79 20 | 66 69 6c 65 2c 0a 66 6f |history |file,.fo|
|000013b0| 6c 6c 6f 77 65 64 20 62 | 79 20 61 20 73 6f 72 74 |llowed b|y a sort|
|000013c0| 65 64 20 6c 69 73 74 20 | 6f 66 20 68 6f 73 74 20 |ed list |of host |
|000013d0| 70 61 69 72 73 20 61 6e | 64 20 63 6f 75 6e 74 73 |pairs an|d counts|
|000013e0| 2e 20 20 48 65 72 65 27 | 73 20 61 20 73 61 6d 70 |. Here'|s a samp|
|000013f0| 6c 65 3a 0a 2e 73 70 0a | 2e 6e 66 0a 4c 61 73 74 |le:..sp.|.nf.Last|
|00001400| 2d 49 44 3a 20 3c 32 34 | 35 32 34 40 6f 6c 69 76 |-ID: <24|524@oliv|
|00001410| 65 62 2e 6f 6c 69 76 65 | 74 74 69 2e 63 6f 6d 3e |eb.olive|tti.com>|
|00001420| 0a 20 34 32 38 31 34 20 | 65 70 69 6d 61 73 73 21 |. 42814 |epimass!|
|00001430| 70 79 72 61 6d 69 64 0a | 20 32 32 36 31 30 20 70 |pyramid.| 22610 p|
|00001440| 79 72 61 6d 69 64 21 61 | 6d 65 73 0a 20 31 32 38 |yramid!a|mes. 128|
|00001450| 32 34 20 70 79 72 61 6d | 69 64 21 64 65 63 77 72 |24 pyram|id!decwr|
|00001460| 6c 0a 20 20 37 38 35 34 | 20 61 6d 65 73 21 6d 61 |l. 7854| ames!ma|
|00001470| 69 6c 72 75 73 0a 20 20 | 35 34 32 36 20 6f 6c 69 |ilrus. |5426 oli|
|00001480| 76 65 62 21 61 6d 65 73 | 0a 20 20 35 33 39 31 20 |veb!ames|. 5391 |
|00001490| 61 6d 65 73 21 70 61 73 | 74 65 75 72 0a 20 20 35 |ames!pas|teur. 5|
|000014a0| 32 31 32 20 64 65 63 77 | 72 6c 21 75 63 62 76 61 |212 decw|rl!ucbva|
|000014b0| 78 0a 3c 20 6c 6f 74 73 | 20 6d 6f 72 65 20 3e 0a |x.< lots| more >.|
|000014c0| 2e 66 69 0a 2e 50 50 0a | 49 66 20 61 6e 20 69 6e |.fi..PP.|If an in|
|000014d0| 70 75 74 20 66 69 6c 65 | 20 61 72 67 75 6d 65 6e |put file| argumen|
|000014e0| 74 20 69 73 20 67 69 76 | 65 6e 2c 20 69 74 20 73 |t is giv|en, it s|
|000014f0| 68 6f 75 6c 64 20 62 65 | 20 74 68 65 20 6e 61 6d |hould be| the nam|
|00001500| 65 20 6f 66 20 61 20 70 | 72 65 76 69 6f 75 73 0a |e of a p|revious.|
|00001510| 6f 75 74 70 75 74 20 6f | 66 0a 2e 49 52 20 6e 65 |output o|f..IR ne|
|00001520| 77 73 70 61 74 68 73 20 | 2e 0a 54 68 65 20 66 69 |wspaths |..The fi|
|00001530| 6c 65 20 61 6e 64 20 63 | 6f 75 6e 74 73 20 61 72 |le and c|ounts ar|
|00001540| 65 20 72 65 61 64 20 69 | 6e 2c 20 61 6e 64 20 74 |e read i|n, and t|
|00001550| 68 65 20 68 69 73 74 6f | 72 79 20 66 69 6c 65 20 |he histo|ry file |
|00001560| 69 73 20 73 63 61 6e 6e | 65 64 20 75 6e 74 69 6c |is scann|ed until|
|00001570| 0a 74 68 65 20 4c 61 73 | 74 2d 49 44 20 69 73 20 |.the Las|t-ID is |
|00001580| 66 6f 75 6e 64 2e 20 20 | 4e 6f 72 6d 61 6c 20 70 |found. |Normal p|
|00001590| 72 6f 63 65 73 73 69 6e | 67 20 62 65 67 69 6e 73 |rocessin|g begins|
|000015a0| 20 77 69 74 68 20 74 68 | 65 20 6e 65 78 74 0a 61 | with th|e next.a|
|000015b0| 72 74 69 63 6c 65 20 67 | 69 76 65 6e 20 69 6e 20 |rticle g|iven in |
|000015c0| 74 68 65 20 68 69 73 74 | 6f 72 79 20 66 69 6c 65 |the hist|ory file|
|000015d0| 2e 20 20 54 68 65 20 69 | 64 65 61 20 69 73 20 74 |. The i|dea is t|
|000015e0| 6f 20 62 65 20 61 62 6c | 65 20 74 6f 20 63 6f 6e |o be abl|e to con|
|000015f0| 74 69 6e 75 65 0a 74 6f | 20 61 63 63 75 6d 75 6c |tinue.to| accumul|
|00001600| 61 74 65 20 74 68 65 20 | 63 6f 75 6e 74 73 20 6f |ate the |counts o|
|00001610| 76 65 72 20 6c 6f 6e 67 | 20 70 65 72 69 6f 64 73 |ver long| periods|
|00001620| 20 6f 66 20 74 69 6d 65 | 20 28 64 65 73 70 69 74 | of time| (despit|
|00001630| 65 0a 2e 49 20 65 78 70 | 69 72 65 0a 72 75 6e 73 |e..I exp|ire.runs|
|00001640| 29 20 61 6e 64 20 74 6f | 20 63 6f 75 6e 74 20 65 |) and to| count e|
|00001650| 61 63 68 20 61 72 74 69 | 63 6c 65 20 6f 6e 6c 79 |ach arti|cle only|
|00001660| 20 6f 6e 63 65 2e 20 20 | 49 74 20 69 73 20 61 6e | once. |It is an|
|00001670| 20 65 72 72 6f 72 20 69 | 66 20 74 68 65 0a 67 69 | error i|f the.gi|
|00001680| 76 65 6e 20 4d 65 73 73 | 61 67 65 2d 49 44 20 69 |ven Mess|age-ID i|
|00001690| 73 20 6e 6f 74 20 66 6f | 75 6e 64 20 69 6e 20 74 |s not fo|und in t|
|000016a0| 68 65 20 68 69 73 74 6f | 72 79 20 66 69 6c 65 2e |he histo|ry file.|
|000016b0| 0a 2e 53 48 20 22 53 55 | 47 47 45 53 54 45 44 20 |..SH "SU|GGESTED |
|000016c0| 55 53 45 22 0a 45 76 65 | 72 79 20 6e 69 67 68 74 |USE".Eve|ry night|
|000016d0| 2c 20 66 72 6f 6d 0a 2e | 49 52 20 63 72 6f 6e 20 |, from..|IR cron |
|000016e0| 2c 0a 64 6f 0a 2e 6e 66 | 0a 09 6e 65 77 73 70 61 |,.do..nf|..newspa|
|000016f0| 74 68 73 20 6f 6c 64 2d | 6f 75 74 70 75 74 20 3e |ths old-|output >|
|00001700| 20 6e 65 77 2d 6f 75 74 | 70 75 74 0a 09 6d 76 20 | new-out|put..mv |
|00001710| 6e 65 77 2d 6f 75 74 70 | 75 74 20 6f 6c 64 2d 6f |new-outp|ut old-o|
|00001720| 75 74 70 75 74 0a 2e 66 | 69 0a 2e 73 70 0a 41 66 |utput..f|i..sp.Af|
|00001730| 74 65 72 20 31 20 6d 6f | 6e 74 68 20 6f 66 20 6f |ter 1 mo|nth of o|
|00001740| 70 65 72 61 74 69 6f 6e | 20 61 74 0a 2e 49 20 65 |peration| at..I e|
|00001750| 70 69 6d 61 73 73 20 2c | 0a 74 68 65 20 72 65 73 |pimass ,|.the res|
|00001760| 75 6c 74 69 6e 67 20 6f | 75 74 70 75 74 20 69 73 |ulting o|utput is|
|00001770| 20 31 33 35 4b 20 62 79 | 74 65 73 20 6c 6f 6e 67 | 135K by|tes long|
|00001780| 2e 0a 2e 53 48 20 41 55 | 54 48 4f 52 0a 4a 6f 73 |...SH AU|THOR.Jos|
|00001790| 65 70 68 20 54 2e 20 42 | 75 63 6b 2c 20 6a 62 75 |eph T. B|uck, jbu|
|000017a0| 63 6b 40 65 70 69 6d 61 | 73 73 2e 65 70 69 2e 63 |ck@epima|ss.epi.c|
|000017b0| 6f 6d 0a 53 48 41 52 5f | 45 4f 46 0a 66 69 20 23 |om.SHAR_|EOF.fi #|
|000017c0| 20 65 6e 64 20 6f 66 20 | 6f 76 65 72 77 72 69 74 | end of |overwrit|
|000017d0| 69 6e 67 20 63 68 65 63 | 6b 0a 69 66 20 74 65 73 |ing chec|k.if tes|
|000017e0| 74 20 2d 66 20 27 74 77 | 6f 77 61 79 27 0a 74 68 |t -f 'tw|oway'.th|
|000017f0| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 77 |en..echo| shar: w|
|00001800| 69 6c 6c 20 6e 6f 74 20 | 6f 76 65 72 2d 77 72 69 |ill not |over-wri|
|00001810| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00001820| 20 22 27 74 77 6f 77 61 | 79 27 22 0a 65 6c 73 65 | "'twowa|y'".else|
|00001830| 0a 63 61 74 20 3c 3c 20 | 5c 53 48 41 52 5f 45 4f |.cat << |\SHAR_EO|
|00001840| 46 20 3e 20 27 74 77 6f | 77 61 79 27 0a 23 21 20 |F > 'two|way'.#! |
|00001850| 2f 75 73 72 2f 62 69 6e | 2f 70 65 72 6c 0a 23 0a |/usr/bin|/perl.#.|
|00001860| 23 20 74 77 6f 77 61 79 | 20 2d 2d 20 63 6f 6e 76 |# twoway| -- conv|
|00001870| 65 72 74 20 75 6e 69 64 | 69 72 65 63 74 69 6f 6e |ert unid|irection|
|00001880| 61 6c 20 63 6f 75 6e 74 | 73 20 66 72 6f 6d 20 22 |al count|s from "|
|00001890| 6e 65 77 73 70 61 74 68 | 73 22 20 69 6e 74 6f 20 |newspath|s" into |
|000018a0| 74 77 6f 2d 77 61 79 20 | 63 6f 75 6e 74 73 0a 23 |two-way |counts.#|
|000018b0| 20 55 73 61 67 65 3a 20 | 74 77 6f 77 61 79 20 66 | Usage: |twoway f|
|000018c0| 69 6c 65 0a 23 20 77 68 | 65 72 65 20 66 69 6c 65 |ile.# wh|ere file|
|000018d0| 20 69 73 20 61 6e 20 6f | 75 74 70 75 74 20 66 72 | is an o|utput fr|
|000018e0| 6f 6d 20 22 6e 65 77 73 | 70 61 74 68 73 22 2e 0a |om "news|paths"..|
|000018f0| 0a 24 5f 20 3d 20 3c 3e | 3b 09 23 20 53 6b 69 70 |.$_ = <>|;.# Skip|
|00001900| 20 74 68 65 20 4c 61 73 | 74 2d 49 44 3a 20 6c 69 | the Las|t-ID: li|
|00001910| 6e 65 0a 77 68 69 6c 65 | 20 28 3c 3e 29 20 7b 0a |ne.while| (<>) {.|
|00001920| 20 20 20 20 28 24 6e 2c | 20 24 70 61 69 72 29 20 | ($n,| $pair) |
|00001930| 3d 20 73 70 6c 69 74 20 | 28 27 20 27 29 3b 0a 20 |= split |(' ');. |
|00001940| 20 20 20 28 24 61 2c 20 | 24 62 29 20 3d 20 73 70 | ($a, |$b) = sp|
|00001950| 6c 69 74 20 28 2f 21 2f | 2c 20 24 70 61 69 72 29 |lit (/!/|, $pair)|
|00001960| 3b 0a 20 20 20 20 69 66 | 20 28 24 61 20 67 74 20 |;. if| ($a gt |
|00001970| 24 62 29 20 7b 20 24 70 | 61 69 72 20 3d 20 24 62 |$b) { $p|air = $b|
|00001980| 20 2e 20 22 21 22 20 2e | 20 24 61 3b 20 7d 09 23 | . "!" .| $a; }.#|
|00001990| 20 61 6c 70 68 61 62 65 | 74 69 63 61 6c 20 6f 72 | alphabe|tical or|
|000019a0| 64 65 72 0a 20 20 20 20 | 24 63 6f 75 6e 74 7b 24 |der. |$count{$|
|000019b0| 70 61 69 72 7d 20 2b 3d | 20 24 6e 3b 0a 7d 0a 64 |pair} +=| $n;.}.d|
|000019c0| 69 65 20 22 43 61 6e 27 | 74 20 65 78 65 63 20 73 |ie "Can'|t exec s|
|000019d0| 6f 72 74 21 5c 6e 22 20 | 75 6e 6c 65 73 73 20 6f |ort!\n" |unless o|
|000019e0| 70 65 6e 20 28 73 6f 72 | 74 2c 20 22 7c 73 6f 72 |pen (sor|t, "|sor|
|000019f0| 74 20 2d 6e 72 22 29 3b | 0a 77 68 69 6c 65 20 28 |t -nr");|.while (|
|00001a00| 28 24 70 61 69 72 2c 20 | 24 6e 29 20 3d 20 65 61 |($pair, |$n) = ea|
|00001a10| 63 68 20 28 63 6f 75 6e | 74 29 29 20 7b 0a 20 20 |ch (coun|t)) {. |
|00001a20| 20 20 70 72 69 6e 74 66 | 20 73 6f 72 74 20 28 22 | printf| sort ("|
|00001a30| 25 35 64 20 25 73 5c 6e | 22 2c 20 24 6e 2c 20 24 |%5d %s\n|", $n, $|
|00001a40| 70 61 69 72 29 3b 0a 7d | 0a 63 6c 6f 73 65 20 73 |pair);.}|.close s|
|00001a50| 6f 72 74 3b 0a 53 48 41 | 52 5f 45 4f 46 0a 63 68 |ort;.SHA|R_EOF.ch|
|00001a60| 6d 6f 64 20 2b 78 20 27 | 74 77 6f 77 61 79 27 0a |mod +x '|twoway'.|
|00001a70| 66 69 20 23 20 65 6e 64 | 20 6f 66 20 6f 76 65 72 |fi # end| of over|
|00001a80| 77 72 69 74 69 6e 67 20 | 63 68 65 63 6b 0a 23 09 |writing |check.#.|
|00001a90| 45 6e 64 20 6f 66 20 73 | 68 65 6c 6c 20 61 72 63 |End of s|hell arc|
|00001aa0| 68 69 76 65 0a 65 78 69 | 74 20 30 0a 2d 2d 20 0a |hive.exi|t 0.-- .|
|00001ab0| 2d 20 4a 6f 65 20 42 75 | 63 6b 20 20 7b 75 75 6e |- Joe Bu|ck {uun|
|00001ac0| 65 74 2c 75 63 62 76 61 | 78 2c 70 79 72 61 6d 69 |et,ucbva|x,pyrami|
|00001ad0| 64 2c 3c 73 6d 61 72 74 | 2d 73 69 74 65 3e 7d 21 |d,<smart|-site>}!|
|00001ae0| 65 70 69 6d 61 73 73 2e | 65 70 69 2e 63 6f 6d 21 |epimass.|epi.com!|
|00001af0| 6a 62 75 63 6b 0a 6a 62 | 75 63 6b 40 65 70 69 6d |jbuck.jb|uck@epim|
|00001b00| 61 73 73 2e 65 70 69 2e | 63 6f 6d 09 4f 6c 64 20 |ass.epi.|com.Old |
|00001b10| 41 72 70 61 20 6d 61 69 | 6c 65 72 73 3a 20 6a 62 |Arpa mai|lers: jb|
|00001b20| 75 63 6b 25 65 70 69 6d | 61 73 73 2e 65 70 69 2e |uck%epim|ass.epi.|
|00001b30| 63 6f 6d 40 75 75 6e 65 | 74 2e 75 75 2e 6e 65 74 |com@uune|t.uu.net|
|00001b40| 0a 09 49 66 20 79 6f 75 | 20 6c 65 61 76 65 20 79 |..If you| leave y|
|00001b50| 6f 75 72 20 66 61 74 65 | 20 69 6e 20 74 68 65 20 |our fate| in the |
|00001b60| 68 61 6e 64 73 20 6f 66 | 20 74 68 65 20 67 6f 64 |hands of| the god|
|00001b70| 73 2c 20 64 6f 6e 27 74 | 20 62 65 20 0a 09 73 75 |s, don't| be ..su|
|00001b80| 72 70 72 69 73 65 64 20 | 69 66 20 74 68 65 79 20 |rprised |if they |
|00001b90| 68 61 76 65 20 61 20 66 | 65 77 20 67 72 69 6e 73 |have a f|ew grins|
|00001ba0| 20 61 74 20 79 6f 75 72 | 20 65 78 70 65 6e 73 65 | at your| expense|
|00001bb0| 2e 09 2d 20 54 6f 6d 20 | 52 6f 62 62 69 6e 73 0a |..- Tom |Robbins.|
+--------+-------------------------+-------------------------+--------+--------+