home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / misc / volume09 / rwhopa.rse < prev    next >
SHell self-extracting ARchive  |  1991-08-27  |  6.1 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: rwhopa.rse

ConfidenceProgramDetectionMatch TypeSupport
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 makefile script, ASCII text default
100% TrID E-Mail message (Var. 2) 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 application/mbox default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 64 65 63 | 77 72 6c 21 75 63 62 76 |From dec|wrl!ucbv|
|00000010| 61 78 21 74 75 74 2e 63 | 69 73 2e 6f 68 69 6f 2d |ax!tut.c|is.ohio-|
|00000020| 73 74 61 74 65 2e 65 64 | 75 21 70 61 63 69 66 69 |state.ed|u!pacifi|
|00000030| 63 2e 6d 70 73 2e 6f 68 | 69 6f 2d 73 74 61 74 65 |c.mps.oh|io-state|
|00000040| 2e 65 64 75 21 7a 61 70 | 68 6f 64 2e 6d 70 73 2e |.edu!zap|hod.mps.|
|00000050| 6f 68 69 6f 2d 73 74 61 | 74 65 2e 65 64 75 21 73 |ohio-sta|te.edu!s|
|00000060| 77 72 69 6e 64 65 21 63 | 73 2e 75 74 65 78 61 73 |wrinde!c|s.utexas|
|00000070| 2e 65 64 75 21 75 75 6e | 65 74 21 61 6c 6c 62 65 |.edu!uun|et!allbe|
|00000080| 72 79 20 54 68 75 20 44 | 65 63 20 31 34 20 31 37 |ry Thu D|ec 14 17|
|00000090| 3a 32 33 3a 33 36 20 50 | 53 54 20 31 39 38 39 0a |:23:36 P|ST 1989.|
|000000a0| 41 72 74 69 63 6c 65 20 | 31 32 32 36 20 6f 66 20 |Article |1226 of |
|000000b0| 63 6f 6d 70 2e 73 6f 75 | 72 63 65 73 2e 6d 69 73 |comp.sou|rces.mis|
|000000c0| 63 3a 0a 50 61 74 68 3a | 20 64 65 63 77 72 6c 21 |c:.Path:| decwrl!|
|000000d0| 75 63 62 76 61 78 21 74 | 75 74 2e 63 69 73 2e 6f |ucbvax!t|ut.cis.o|
|000000e0| 68 69 6f 2d 73 74 61 74 | 65 2e 65 64 75 21 70 61 |hio-stat|e.edu!pa|
|000000f0| 63 69 66 69 63 2e 6d 70 | 73 2e 6f 68 69 6f 2d 73 |cific.mp|s.ohio-s|
|00000100| 74 61 74 65 2e 65 64 75 | 21 7a 61 70 68 6f 64 2e |tate.edu|!zaphod.|
|00000110| 6d 70 73 2e 6f 68 69 6f | 2d 73 74 61 74 65 2e 65 |mps.ohio|-state.e|
|00000120| 64 75 21 73 77 72 69 6e | 64 65 21 63 73 2e 75 74 |du!swrin|de!cs.ut|
|00000130| 65 78 61 73 2e 65 64 75 | 21 75 75 6e 65 74 21 61 |exas.edu|!uunet!a|
|00000140| 6c 6c 62 65 72 79 0a 46 | 72 6f 6d 3a 20 61 6c 6c |llbery.F|rom: all|
|00000150| 62 65 72 79 40 75 75 6e | 65 74 2e 55 55 2e 4e 45 |bery@uun|et.UU.NE|
|00000160| 54 20 28 42 72 61 6e 64 | 6f 6e 20 53 2e 20 41 6c |T (Brand|on S. Al|
|00000170| 6c 62 65 72 79 20 2d 20 | 63 6f 6d 70 2e 73 6f 75 |lbery - |comp.sou|
|00000180| 72 63 65 73 2e 6d 69 73 | 63 29 0a 4e 65 77 73 67 |rces.mis|c).Newsg|
|00000190| 72 6f 75 70 73 3a 20 63 | 6f 6d 70 2e 73 6f 75 72 |roups: c|omp.sour|
|000001a0| 63 65 73 2e 6d 69 73 63 | 0a 53 75 62 6a 65 63 74 |ces.misc|.Subject|
|000001b0| 3a 20 76 30 39 69 30 36 | 30 3a 20 72 77 68 6f 20 |: v09i06|0: rwho |
|000001c0| 70 61 72 73 65 72 20 70 | 72 69 6e 74 73 20 72 65 |parser p|rints re|
|000001d0| 61 6c 20 6e 61 6d 65 73 | 0a 4d 65 73 73 61 67 65 |al names|.Message|
|000001e0| 2d 49 44 3a 20 3c 37 33 | 36 37 35 40 75 75 6e 65 |-ID: <73|675@uune|
|000001f0| 74 2e 55 55 2e 4e 45 54 | 3e 0a 44 61 74 65 3a 20 |t.UU.NET|>.Date: |
|00000200| 31 33 20 44 65 63 20 38 | 39 20 30 32 3a 32 36 3a |13 Dec 8|9 02:26:|
|00000210| 32 34 20 47 4d 54 0a 53 | 65 6e 64 65 72 3a 20 61 |24 GMT.S|ender: a|
|00000220| 6c 6c 62 65 72 79 40 75 | 75 6e 65 74 2e 55 55 2e |llbery@u|unet.UU.|
|00000230| 4e 45 54 0a 52 65 70 6c | 79 2d 54 6f 3a 20 72 6f |NET.Repl|y-To: ro|
|00000240| 62 65 72 74 40 6c 6f 6e | 67 73 2e 4c 41 4e 43 45 |bert@lon|gs.LANCE|
|00000250| 2e 43 6f 6c 6f 53 74 61 | 74 65 2e 45 64 75 20 28 |.ColoSta|te.Edu (|
|00000260| 52 6f 62 65 72 74 20 54 | 68 6f 6d 70 73 6f 6e 29 |Robert T|hompson)|
|00000270| 0a 4f 72 67 61 6e 69 7a | 61 74 69 6f 6e 3a 20 43 |.Organiz|ation: C|
|00000280| 6f 6c 6f 72 61 64 6f 20 | 53 74 61 74 65 20 55 6e |olorado |State Un|
|00000290| 69 76 65 72 73 69 74 79 | 2c 20 46 6f 72 74 20 43 |iversity|, Fort C|
|000002a0| 6f 6c 6c 69 6e 73 2c 20 | 43 4f 20 20 38 30 35 32 |ollins, |CO 8052|
|000002b0| 33 0a 4c 69 6e 65 73 3a | 20 31 39 34 0a 41 70 70 |3.Lines:| 194.App|
|000002c0| 72 6f 76 65 64 3a 20 61 | 6c 6c 62 65 72 79 40 75 |roved: a|llbery@u|
|000002d0| 75 6e 65 74 2e 55 55 2e | 4e 45 54 20 28 42 72 61 |unet.UU.|NET (Bra|
|000002e0| 6e 64 6f 6e 20 53 2e 20 | 41 6c 6c 62 65 72 79 20 |ndon S. |Allbery |
|000002f0| 2d 20 63 6f 6d 70 2e 73 | 6f 75 72 63 65 73 2e 6d |- comp.s|ources.m|
|00000300| 69 73 63 29 0a 0a 50 6f | 73 74 69 6e 67 2d 6e 75 |isc)..Po|sting-nu|
|00000310| 6d 62 65 72 3a 20 56 6f | 6c 75 6d 65 20 39 2c 20 |mber: Vo|lume 9, |
|00000320| 49 73 73 75 65 20 36 30 | 0a 53 75 62 6d 69 74 74 |Issue 60|.Submitt|
|00000330| 65 64 2d 62 79 3a 20 72 | 6f 62 65 72 74 40 6c 6f |ed-by: r|obert@lo|
|00000340| 6e 67 73 2e 4c 41 4e 43 | 45 2e 43 6f 6c 6f 53 74 |ngs.LANC|E.ColoSt|
|00000350| 61 74 65 2e 45 64 75 20 | 28 52 6f 62 65 72 74 20 |ate.Edu |(Robert |
|00000360| 54 68 6f 6d 70 73 6f 6e | 29 0a 41 72 63 68 69 76 |Thompson|).Archiv|
|00000370| 65 2d 6e 61 6d 65 3a 20 | 72 77 68 6f 70 61 72 73 |e-name: |rwhopars|
|00000380| 65 0a 0a 48 65 72 65 20 | 69 73 20 61 20 70 72 6f |e..Here |is a pro|
|00000390| 67 72 61 6d 20 74 68 61 | 74 20 79 6f 75 20 6d 69 |gram tha|t you mi|
|000003a0| 67 68 74 20 66 69 6e 64 | 20 75 73 65 66 75 6c 2c |ght find| useful,|
|000003b0| 20 70 65 6f 70 6c 65 20 | 61 72 72 6f 75 6e 64 20 | people |arround |
|000003c0| 68 65 72 65 20 68 61 76 | 65 2e 20 20 49 74 0a 70 |here hav|e. It.p|
|000003d0| 61 72 73 65 73 20 74 68 | 65 20 6f 75 74 70 75 74 |arses th|e output|
|000003e0| 20 66 72 6f 6d 20 72 77 | 68 6f 20 61 6e 64 20 72 | from rw|ho and r|
|000003f0| 65 74 75 72 6e 73 20 73 | 6f 6d 65 20 69 6e 74 65 |eturns s|ome inte|
|00000400| 72 65 73 74 69 6e 67 20 | 69 6e 66 6f 72 6d 61 74 |resting |informat|
|00000410| 69 6f 6e 2e 0a 0a 09 2d | 52 6f 62 65 72 74 0a 0a |ion....-|Robert..|
|00000420| 23 21 20 2f 62 69 6e 2f | 73 68 0a 23 20 54 68 69 |#! /bin/|sh.# Thi|
|00000430| 73 20 69 73 20 61 20 73 | 68 65 6c 6c 20 61 72 63 |s is a s|hell arc|
|00000440| 68 69 76 65 2e 20 20 52 | 65 6d 6f 76 65 20 61 6e |hive. R|emove an|
|00000450| 79 74 68 69 6e 67 20 62 | 65 66 6f 72 65 20 74 68 |ything b|efore th|
|00000460| 69 73 20 6c 69 6e 65 2c | 20 74 68 65 6e 20 75 6e |is line,| then un|
|00000470| 70 61 63 6b 0a 23 20 69 | 74 20 62 79 20 73 61 76 |pack.# i|t by sav|
|00000480| 69 6e 67 20 69 74 20 69 | 6e 74 6f 20 61 20 66 69 |ing it i|nto a fi|
|00000490| 6c 65 20 61 6e 64 20 74 | 79 70 69 6e 67 20 22 73 |le and t|yping "s|
|000004a0| 68 20 66 69 6c 65 22 2e | 20 20 54 6f 20 6f 76 65 |h file".| To ove|
|000004b0| 72 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 0a |rwrite e|xisting.|
|000004c0| 23 20 66 69 6c 65 73 2c | 20 74 79 70 65 20 22 73 |# files,| type "s|
|000004d0| 68 20 66 69 6c 65 20 2d | 63 22 2e 20 20 59 6f 75 |h file -|c". You|
|000004e0| 20 63 61 6e 20 61 6c 73 | 6f 20 66 65 65 64 20 74 | can als|o feed t|
|000004f0| 68 69 73 20 61 73 20 73 | 74 61 6e 64 61 72 64 20 |his as s|tandard |
|00000500| 69 6e 70 75 74 20 76 69 | 61 0a 23 20 75 6e 73 68 |input vi|a.# unsh|
|00000510| 61 72 2c 20 6f 72 20 62 | 79 20 74 79 70 69 6e 67 |ar, or b|y typing|
|00000520| 20 22 73 68 20 3c 66 69 | 6c 65 22 2c 20 65 2e 67 | "sh <fi|le", e.g|
|00000530| 2e 2e 20 20 49 66 20 74 | 68 69 73 20 61 72 63 68 |.. If t|his arch|
|00000540| 69 76 65 20 69 73 20 63 | 6f 6d 70 6c 65 74 65 2c |ive is c|omplete,|
|00000550| 20 79 6f 75 0a 23 20 77 | 69 6c 6c 20 73 65 65 20 | you.# w|ill see |
|00000560| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 6d 65 |the foll|owing me|
|00000570| 73 73 61 67 65 20 61 74 | 20 74 68 65 20 65 6e 64 |ssage at| the end|
|00000580| 3a 0a 23 09 09 22 45 6e | 64 20 6f 66 20 73 68 65 |:.#.."En|d of she|
|00000590| 6c 6c 20 61 72 63 68 69 | 76 65 2e 22 0a 23 20 43 |ll archi|ve.".# C|
|000005a0| 6f 6e 74 65 6e 74 73 3a | 20 20 52 45 41 44 4d 45 |ontents:| README|
|000005b0| 20 4d 61 6b 65 66 69 6c | 65 20 72 77 68 6f 70 2e | Makefil|e rwhop.|
|000005c0| 6e 20 72 77 68 6f 70 61 | 72 73 65 2e 63 0a 23 20 |n rwhopa|rse.c.# |
|000005d0| 57 72 61 70 70 65 64 20 | 62 79 20 72 6f 62 65 72 |Wrapped |by rober|
|000005e0| 74 40 6c 6f 6e 67 73 2e | 4c 41 4e 43 45 2e 43 6f |t@longs.|LANCE.Co|
|000005f0| 6c 6f 53 74 61 74 65 2e | 45 64 75 20 6f 6e 20 4d |loState.|Edu on M|
|00000600| 6f 6e 20 44 65 63 20 31 | 31 20 32 31 3a 31 36 3a |on Dec 1|1 21:16:|
|00000610| 34 31 20 31 39 38 39 0a | 50 41 54 48 3d 2f 62 69 |41 1989.|PATH=/bi|
|00000620| 6e 3a 2f 75 73 72 2f 62 | 69 6e 3a 2f 75 73 72 2f |n:/usr/b|in:/usr/|
|00000630| 75 63 62 20 3b 20 65 78 | 70 6f 72 74 20 50 41 54 |ucb ; ex|port PAT|
|00000640| 48 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 52 45 |H.if tes|t -f 'RE|
|00000650| 41 44 4d 45 27 20 2d 61 | 20 22 24 7b 31 7d 22 20 |ADME' -a| "${1}" |
|00000660| 21 3d 20 22 2d 63 22 20 | 3b 20 74 68 65 6e 20 0a |!= "-c" |; then .|
|00000670| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 57 69 6c | echo s|har: Wil|
|00000680| 6c 20 6e 6f 74 20 63 6c | 6f 62 62 65 72 20 65 78 |l not cl|obber ex|
|00000690| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 5c 22 27 52 |isting f|ile \"'R|
|000006a0| 45 41 44 4d 45 27 5c 22 | 0a 65 6c 73 65 0a 65 63 |EADME'\"|.else.ec|
|000006b0| 68 6f 20 73 68 61 72 3a | 20 45 78 74 72 61 63 74 |ho shar:| Extract|
|000006c0| 69 6e 67 20 5c 22 27 52 | 45 41 44 4d 45 27 5c 22 |ing \"'R|EADME'\"|
|000006d0| 20 5c 28 35 39 35 20 63 | 68 61 72 61 63 74 65 72 | \(595 c|haracter|
|000006e0| 73 5c 29 0a 73 65 64 20 | 22 73 2f 5e 58 2f 2f 22 |s\).sed |"s/^X//"|
|000006f0| 20 3e 27 52 45 41 44 4d | 45 27 20 3c 3c 27 45 4e | >'READM|E' <<'EN|
|00000700| 44 5f 4f 46 5f 46 49 4c | 45 27 0a 72 77 68 6f 70 |D_OF_FIL|E'.rwhop|
|00000710| 20 69 73 20 61 20 70 72 | 6f 67 72 61 6d 20 49 20 | is a pr|ogram I |
|00000720| 77 72 6f 74 65 20 6f 6e | 65 20 62 6f 72 65 64 20 |wrote on|e bored |
|00000730| 53 75 6e 64 61 79 20 6e | 69 67 68 74 20 66 6f 72 |Sunday n|ight for|
|00000740| 20 73 6f 6d 65 74 68 69 | 6e 67 20 74 6f 20 64 6f | somethi|ng to do|
|00000750| 2e 20 20 49 0a 77 61 73 | 20 70 72 6f 6d 70 74 65 |. I.was| prompte|
|00000760| 64 20 74 6f 20 70 6f 73 | 74 20 74 68 69 73 20 63 |d to pos|t this c|
|00000770| 6f 64 65 20 66 6f 72 20 | 6f 74 68 65 72 73 20 74 |ode for |others t|
|00000780| 6f 20 75 73 65 2e 20 20 | 54 68 65 20 6d 61 69 6e |o use. |The main|
|00000790| 20 72 65 61 73 6f 6e 20 | 66 6f 72 20 74 68 65 0a | reason |for the.|
|000007a0| 70 72 6f 67 72 61 6d 20 | 69 73 20 74 6f 20 72 65 |program |is to re|
|000007b0| 74 75 72 6e 20 74 68 65 | 20 75 73 65 72 73 20 72 |turn the| users r|
|000007c0| 65 61 6c 20 6e 61 6d 65 | 20 69 6e 73 74 65 61 64 |eal name| instead|
|000007d0| 20 6f 66 20 6a 75 73 74 | 20 74 68 65 20 6c 6f 67 | of just| the log|
|000007e0| 69 6e 20 6e 61 6d 65 2e | 0a 49 66 20 74 68 65 72 |in name.|.If ther|
|000007f0| 65 20 61 72 65 20 61 6e | 79 20 70 72 6f 62 6c 65 |e are an|y proble|
|00000800| 6d 73 2c 20 73 65 6e 64 | 20 6d 65 20 6d 61 69 6c |ms, send| me mail|
|00000810| 20 61 6e 64 20 49 20 77 | 69 6c 6c 20 74 72 79 20 | and I w|ill try |
|00000820| 74 6f 20 72 65 63 74 69 | 66 79 20 74 68 65 20 62 |to recti|fy the b|
|00000830| 75 67 2e 0a 58 0a 54 68 | 69 73 20 63 6f 65 64 20 |ug..X.Th|is coed |
|00000840| 69 73 20 73 75 70 70 6c | 69 65 64 20 77 69 74 68 |is suppl|ied with|
|00000850| 6f 75 74 20 63 6f 70 79 | 72 69 67 68 74 2c 20 64 |out copy|right, d|
|00000860| 6f 20 77 69 74 68 20 69 | 74 20 77 68 61 74 20 79 |o with i|t what y|
|00000870| 6f 75 20 70 6c 65 61 73 | 65 2e 20 20 28 54 65 6c |ou pleas|e. (Tel|
|00000880| 6c 0a 6d 65 20 6f 66 20 | 61 6e 79 20 69 6d 70 72 |l.me of |any impr|
|00000890| 6f 76 65 6d 65 6e 74 73 | 20 79 6f 75 20 68 61 76 |ovements| you hav|
|000008a0| 65 2e 29 20 20 49 20 77 | 61 73 20 74 68 69 6e 6b |e.) I w|as think|
|000008b0| 69 6e 67 20 6f 66 20 6d | 61 6b 69 6e 67 20 74 68 |ing of m|aking th|
|000008c0| 65 20 70 72 6f 67 72 61 | 6d 0a 73 65 61 72 63 68 |e progra|m.search|
|000008d0| 20 66 6f 72 20 61 20 68 | 6f 73 74 20 72 61 74 68 | for a h|ost rath|
|000008e0| 65 72 20 74 68 61 6e 20 | 6a 75 73 74 20 61 20 75 |er than |just a u|
|000008f0| 73 65 72 20 28 6d 61 79 | 62 65 20 73 6f 6d 65 64 |ser (may|be somed|
|00000900| 61 79 29 2e 20 20 0a 58 | 0a 52 6f 62 65 72 74 0a |ay). .X|.Robert.|
|00000910| 43 53 55 20 2d 20 43 65 | 6e 74 65 72 20 66 6f 72 |CSU - Ce|nter for|
|00000920| 43 6f 6d 70 75 74 65 72 | 20 41 73 73 69 73 74 65 |Computer| Assiste|
|00000930| 64 20 45 6e 67 69 6e 65 | 65 72 69 6e 67 0a 58 0a |d Engine|ering.X.|
|00000940| 72 6f 62 65 72 74 40 6c | 6f 6e 67 73 2e 4c 41 4e |robert@l|ongs.LAN|
|00000950| 43 45 2e 43 6f 6c 6f 53 | 74 61 74 65 2e 45 64 75 |CE.ColoS|tate.Edu|
|00000960| 0a 45 4e 44 5f 4f 46 5f | 46 49 4c 45 0a 69 66 20 |.END_OF_|FILE.if |
|00000970| 74 65 73 74 20 35 39 35 | 20 2d 6e 65 20 60 77 63 |test 595| -ne `wc|
|00000980| 20 2d 63 20 3c 27 52 45 | 41 44 4d 45 27 60 3b 20 | -c <'RE|ADME'`; |
|00000990| 74 68 65 6e 0a 20 20 20 | 20 65 63 68 6f 20 73 68 |then. | echo sh|
|000009a0| 61 72 3a 20 5c 22 27 52 | 45 41 44 4d 45 27 5c 22 |ar: \"'R|EADME'\"|
|000009b0| 20 75 6e 70 61 63 6b 65 | 64 20 77 69 74 68 20 77 | unpacke|d with w|
|000009c0| 72 6f 6e 67 20 73 69 7a | 65 21 0a 66 69 0a 23 20 |rong siz|e!.fi.# |
|000009d0| 65 6e 64 20 6f 66 20 27 | 52 45 41 44 4d 45 27 0a |end of '|README'.|
|000009e0| 66 69 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 4d |fi.if te|st -f 'M|
|000009f0| 61 6b 65 66 69 6c 65 27 | 20 2d 61 20 22 24 7b 31 |akefile'| -a "${1|
|00000a00| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00000a10| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|00000a20| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|00000a30| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|00000a40| 22 27 4d 61 6b 65 66 69 | 6c 65 27 5c 22 0a 65 6c |"'Makefi|le'\".el|
|00000a50| 73 65 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 45 78 |se.echo |shar: Ex|
|00000a60| 74 72 61 63 74 69 6e 67 | 20 5c 22 27 4d 61 6b 65 |tracting| \"'Make|
|00000a70| 66 69 6c 65 27 5c 22 20 | 5c 28 34 36 39 20 63 68 |file'\" |\(469 ch|
|00000a80| 61 72 61 63 74 65 72 73 | 5c 29 0a 73 65 64 20 22 |aracters|\).sed "|
|00000a90| 73 2f 5e 58 2f 2f 22 20 | 3e 27 4d 61 6b 65 66 69 |s/^X//" |>'Makefi|
|00000aa0| 6c 65 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |le' <<'E|ND_OF_FI|
|00000ab0| 4c 45 27 0a 58 23 23 23 | 23 23 23 23 23 23 23 23 |LE'.X###|########|
|00000ac0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000ad0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000ae0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000af0| 23 23 23 23 23 23 0a 58 | 23 0a 58 23 20 72 77 68 |######.X|#.X# rwh|
|00000b00| 6f 70 61 72 73 65 20 6d | 61 6b 65 66 69 6c 65 20 |oparse m|akefile |
|00000b10| 63 72 65 61 74 65 64 20 | 31 32 2f 31 30 2f 38 39 |created |12/10/89|
|00000b20| 0a 58 23 0a 58 23 20 4e | 6f 20 63 6f 70 79 72 69 |.X#.X# N|o copyri|
|00000b30| 67 68 74 73 20 69 6e 70 | 6c 69 65 64 20 6f 72 20 |ghts inp|lied or |
|00000b40| 72 65 71 75 65 73 74 65 | 64 2e 20 20 54 68 69 73 |requeste|d. This|
|00000b50| 20 63 6f 64 65 20 69 73 | 20 73 75 70 70 6c 69 65 | code is| supplie|
|00000b60| 64 20 61 73 20 69 73 0a | 58 23 20 68 61 76 65 20 |d as is.|X# have |
|00000b70| 66 75 6e 20 75 73 69 6e | 67 20 69 74 20 61 6e 64 |fun usin|g it and|
|00000b80| 20 72 65 70 6f 72 74 20 | 61 6e 79 20 62 75 67 73 | report |any bugs|
|00000b90| 20 74 6f 3a 0a 58 23 0a | 58 23 20 20 09 72 6f 62 | to:.X#.|X# .rob|
|00000ba0| 65 72 74 40 6c 6f 6e 67 | 73 2e 4c 41 4e 43 45 2e |ert@long|s.LANCE.|
|00000bb0| 43 6f 6c 6f 53 74 61 74 | 65 2e 65 64 75 0a 58 23 |ColoStat|e.edu.X#|
|00000bc0| 0a 58 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |.X######|########|
|00000bd0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000be0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000bf0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000c00| 23 23 23 0a 4f 42 4a 53 | 3d 09 72 77 68 6f 70 61 |###.OBJS|=.rwhopa|
|00000c10| 72 73 65 2e 6f 0a 53 52 | 43 53 3d 09 72 77 68 6f |rse.o.SR|CS=.rwho|
|00000c20| 70 61 72 73 65 2e 63 0a | 58 0a 54 41 52 47 45 54 |parse.c.|X.TARGET|
|00000c30| 3d 20 72 77 68 6f 70 0a | 43 43 3d 20 67 63 63 20 |= rwhop.|CC= gcc |
|00000c40| 2d 4f 20 2d 61 6e 73 69 | 0a 58 0a 61 6c 6c 3a 09 |-O -ansi|.X.all:.|
|00000c50| 0a 58 09 24 28 43 43 29 | 20 2d 6f 20 24 28 54 41 |.X.$(CC)| -o $(TA|
|00000c60| 52 47 45 54 29 20 72 77 | 68 6f 70 61 72 73 65 2e |RGET) rw|hoparse.|
|00000c70| 63 20 0a 58 09 0a 63 6c | 65 61 6e 3a 0a 58 09 72 |c .X..cl|ean:.X.r|
|00000c80| 6d 20 2d 66 20 2a 2e 6f | 20 24 28 54 41 52 47 45 |m -f *.o| $(TARGE|
|00000c90| 54 29 20 63 6f 72 65 0a | 45 4e 44 5f 4f 46 5f 46 |T) core.|END_OF_F|
|00000ca0| 49 4c 45 0a 69 66 20 74 | 65 73 74 20 34 36 39 20 |ILE.if t|est 469 |
|00000cb0| 2d 6e 65 20 60 77 63 20 | 2d 63 20 3c 27 4d 61 6b |-ne `wc |-c <'Mak|
|00000cc0| 65 66 69 6c 65 27 60 3b | 20 74 68 65 6e 0a 20 20 |efile'`;| then. |
|00000cd0| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 5c 22 27 | echo s|har: \"'|
|00000ce0| 4d 61 6b 65 66 69 6c 65 | 27 5c 22 20 75 6e 70 61 |Makefile|'\" unpa|
|00000cf0| 63 6b 65 64 20 77 69 74 | 68 20 77 72 6f 6e 67 20 |cked wit|h wrong |
|00000d00| 73 69 7a 65 21 0a 66 69 | 0a 23 20 65 6e 64 20 6f |size!.fi|.# end o|
|00000d10| 66 20 27 4d 61 6b 65 66 | 69 6c 65 27 0a 66 69 0a |f 'Makef|ile'.fi.|
|00000d20| 69 66 20 74 65 73 74 20 | 2d 66 20 27 72 77 68 6f |if test |-f 'rwho|
|00000d30| 70 2e 6e 27 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |p.n' -a |"${1}" !|
|00000d40| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|00000d50| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|00000d60| 20 6e 6f 74 20 63 6c 6f | 62 62 65 72 20 65 78 69 | not clo|bber exi|
|00000d70| 73 74 69 6e 67 20 66 69 | 6c 65 20 5c 22 27 72 77 |sting fi|le \"'rw|
|00000d80| 68 6f 70 2e 6e 27 5c 22 | 0a 65 6c 73 65 0a 65 63 |hop.n'\"|.else.ec|
|00000d90| 68 6f 20 73 68 61 72 3a | 20 45 78 74 72 61 63 74 |ho shar:| Extract|
|00000da0| 69 6e 67 20 5c 22 27 72 | 77 68 6f 70 2e 6e 27 5c |ing \"'r|whop.n'\|
|00000db0| 22 20 5c 28 31 30 38 33 | 20 63 68 61 72 61 63 74 |" \(1083| charact|
|00000dc0| 65 72 73 5c 29 0a 73 65 | 64 20 22 73 2f 5e 58 2f |ers\).se|d "s/^X/|
|00000dd0| 2f 22 20 3e 27 72 77 68 | 6f 70 2e 6e 27 20 3c 3c |/" >'rwh|op.n' <<|
|00000de0| 27 45 4e 44 5f 4f 46 5f | 46 49 4c 45 27 0a 58 2e |'END_OF_|FILE'.X.|
|00000df0| 5c 22 20 53 43 43 53 49 | 44 3a 20 40 28 23 29 72 |\" SCCSI|D: @(#)r|
|00000e00| 77 68 6f 70 2e 6e 20 31 | 2e 30 20 31 32 2f 31 30 |whop.n 1|.0 12/10|
|00000e10| 2f 38 39 0a 58 2e 54 48 | 20 72 77 68 6f 70 20 6e |/89.X.TH| rwhop n|
|00000e20| 0a 58 2e 53 48 20 4e 41 | 4d 45 0a 72 77 68 6f 70 |.X.SH NA|ME.rwhop|
|00000e30| 20 5c 2d 20 72 77 68 6f | 28 31 29 20 6f 75 74 70 | \- rwho|(1) outp|
|00000e40| 75 74 20 70 61 72 73 65 | 72 0a 58 2e 53 48 20 53 |ut parse|r.X.SH S|
|00000e50| 59 4e 54 41 58 0a 58 2e | 42 20 72 77 68 6f 70 0a |YNTAX.X.|B rwhop.|
|00000e60| 58 5b 0a 58 2e 42 20 5c | 2d 61 68 0a 58 5d 20 5b |X[.X.B \|-ah.X] [|
|00000e70| 5c 66 49 75 73 65 72 73 | 5c 66 52 5d 0a 58 2e 53 |\fIusers|\fR].X.S|
|00000e80| 48 20 44 45 53 43 52 49 | 50 54 49 4f 4e 0a 54 68 |H DESCRI|PTION.Th|
|00000e90| 65 0a 58 2e 50 4e 20 72 | 77 68 6f 70 0a 63 6f 6d |e.X.PN r|whop.com|
|00000ea0| 6d 61 6e 64 20 74 61 6b | 65 73 20 74 68 65 20 6f |mand tak|es the o|
|00000eb0| 75 74 70 75 74 20 66 72 | 6f 6d 20 72 77 68 6f 28 |utput fr|om rwho(|
|00000ec0| 31 29 20 76 69 61 20 61 | 20 70 69 70 65 20 73 74 |1) via a| pipe st|
|00000ed0| 72 65 61 6d 20 63 6f 6e | 6e 65 63 74 69 6f 6e 2e |ream con|nection.|
|00000ee0| 0a 54 68 65 20 72 65 74 | 75 72 6e 65 64 20 69 6e |.The ret|urned in|
|00000ef0| 66 6f 72 6d 61 74 69 6f | 6e 20 69 73 20 74 68 65 |formatio|n is the|
|00000f00| 20 73 61 6d 65 20 61 73 | 20 74 68 61 74 20 6f 66 | same as| that of|
|00000f10| 20 72 77 68 6f 20 77 69 | 74 68 20 74 68 65 20 66 | rwho wi|th the f|
|00000f20| 6f 6c 6c 6f 77 69 6e 67 | 0a 65 78 63 65 70 74 69 |ollowing|.excepti|
|00000f30| 6f 6e 73 3a 20 31 29 20 | 66 75 6c 6c 79 20 71 75 |ons: 1) |fully qu|
|00000f40| 61 6c 69 66 69 65 64 20 | 68 6f 73 74 20 6e 61 6d |alified |host nam|
|00000f50| 65 73 20 61 72 65 20 74 | 72 75 6e 63 61 74 65 64 |es are t|runcated|
|00000f60| 20 74 6f 20 74 68 65 20 | 66 69 72 73 74 20 6c 65 | to the |first le|
|00000f70| 76 65 6c 2e 0a 58 32 29 | 20 54 68 65 20 75 73 65 |vel..X2)| The use|
|00000f80| 72 73 27 20 67 65 63 6f | 73 20 69 6e 66 6f 72 6d |rs' geco|s inform|
|00000f90| 61 74 69 6f 6e 20 69 73 | 20 72 65 74 72 65 69 76 |ation is| retreiv|
|00000fa0| 65 64 20 76 69 61 20 74 | 68 65 20 67 65 74 70 77 |ed via t|he getpw|
|00000fb0| 6e 61 6d 28 33 29 20 63 | 61 6c 6c 2e 0a 54 68 65 |nam(3) c|all..The|
|00000fc0| 20 66 69 72 73 74 20 66 | 69 65 6c 64 20 6f 66 20 | first f|ield of |
|00000fd0| 74 68 65 20 67 65 63 6f | 73 20 69 6e 66 6f 72 6d |the geco|s inform|
|00000fe0| 61 74 69 6f 6e 20 69 73 | 20 70 72 69 6e 74 65 64 |ation is| printed|
|00000ff0| 20 75 6e 20 74 68 65 20 | 68 65 61 64 69 6e 67 20 | un the |heading |
|00001000| 6f 66 20 27 52 65 61 6c | 0a 4e 61 6d 65 27 0a 58 |of 'Real|.Name'.X|
|00001010| 2e 53 48 20 4f 50 54 49 | 4f 4e 53 0a 58 2e 49 50 |.SH OPTI|ONS.X.IP|
|00001020| 20 5c 66 42 5c 2d 61 5c | 66 52 20 32 30 0a 4c 69 | \fB\-a\|fR 20.Li|
|00001030| 73 74 73 20 61 6c 6c 20 | 75 73 65 72 73 2e 20 20 |sts all |users. |
|00001040| 4e 6f 72 6d 61 6c 6c 79 | 2c 0a 58 2e 50 4e 20 72 |Normally|,.X.PN r|
|00001050| 77 68 6f 70 0a 6f 6d 69 | 74 73 20 75 73 65 72 73 |whop.omi|ts users|
|00001060| 20 77 68 6f 20 68 61 76 | 65 20 6e 6f 74 20 74 79 | who hav|e not ty|
|00001070| 70 65 64 20 74 6f 20 74 | 68 65 20 73 79 73 74 65 |ped to t|he syste|
|00001080| 6d 20 66 6f 72 20 61 6e | 20 68 6f 75 72 20 6f 72 |m for an| hour or|
|00001090| 0a 6d 6f 72 65 2e 20 20 | 49 66 20 74 68 65 0a 58 |.more. |If the.X|
|000010a0| 2e 42 20 5c 2d 61 0a 66 | 6c 61 67 20 69 73 20 73 |.B \-a.f|lag is s|
|000010b0| 70 65 63 69 66 69 65 64 | 2c 20 74 68 65 73 65 20 |pecified|, these |
|000010c0| 75 73 65 72 73 20 61 72 | 65 20 61 6c 73 6f 20 6c |users ar|e also l|
|000010d0| 69 73 74 65 64 2e 0a 58 | 2e 49 50 20 5c 66 42 5c |isted..X|.IP \fB\|
|000010e0| 2d 68 5c 66 52 20 32 30 | 0a 53 6f 72 74 73 20 75 |-h\fR 20|.Sorts u|
|000010f0| 73 65 72 73 20 62 79 20 | 68 6f 73 74 20 6e 61 6d |sers by |host nam|
|00001100| 65 2e 20 20 4e 6f 72 6d | 61 6c 6c 79 2c 0a 58 2e |e. Norm|ally,.X.|
|00001110| 50 4e 20 72 77 68 6f 70 | 0a 70 72 69 6e 74 73 20 |PN rwhop|.prints |
|00001120| 69 74 73 20 6f 75 74 70 | 75 74 20 73 6f 72 74 65 |its outp|ut sorte|
|00001130| 64 20 62 79 20 75 73 65 | 72 20 6e 61 6d 65 2e 20 |d by use|r name. |
|00001140| 20 49 66 20 74 68 65 0a | 58 2e 42 20 5c 2d 68 0a | If the.|X.B \-h.|
|00001150| 66 6c 61 67 20 69 73 20 | 73 70 65 63 69 66 69 65 |flag is |specifie|
|00001160| 64 2c 20 74 68 65 20 72 | 65 73 75 6c 74 73 20 61 |d, the r|esults a|
|00001170| 72 65 20 73 6f 72 74 65 | 64 20 62 79 20 68 6f 73 |re sorte|d by hos|
|00001180| 74 20 6e 61 6d 65 2e 0a | 58 2e 53 48 20 46 49 4c |t name..|X.SH FIL|
|00001190| 45 53 0a 58 2f 75 73 72 | 2f 73 70 6f 6f 6c 2f 72 |ES.X/usr|/spool/r|
|000011a0| 77 68 6f 2f 77 68 6f 64 | 2e 2a 09 49 6e 66 6f 72 |who/whod|.*.Infor|
|000011b0| 6d 61 74 69 6f 6e 20 61 | 62 6f 75 74 20 6f 74 68 |mation a|bout oth|
|000011c0| 65 72 20 6d 61 63 68 69 | 6e 65 73 0a 58 2e 53 48 |er machi|nes.X.SH|
|000011d0| 20 53 45 45 20 41 4c 53 | 4f 0a 72 75 70 74 69 6d | SEE ALS|O.ruptim|
|000011e0| 65 28 31 63 29 2c 20 72 | 77 68 6f 64 28 38 63 29 |e(1c), r|whod(8c)|
|000011f0| 0a 58 2e 53 48 20 41 55 | 54 48 4f 52 0a 52 6f 62 |.X.SH AU|THOR.Rob|
|00001200| 65 72 74 20 44 2e 20 54 | 68 6f 6d 70 73 6f 6e 20 |ert D. T|hompson |
|00001210| 2d 20 43 6f 6c 6f 72 61 | 64 6f 20 53 74 61 74 65 |- Colora|do State|
|00001220| 20 55 6e 69 76 65 72 73 | 69 74 79 20 20 44 65 63 | Univers|ity Dec|
|00001230| 65 6d 62 65 72 20 31 30 | 2c 20 31 39 38 39 0a 45 |ember 10|, 1989.E|
|00001240| 4e 44 5f 4f 46 5f 46 49 | 4c 45 0a 69 66 20 74 65 |ND_OF_FI|LE.if te|
|00001250| 73 74 20 31 30 38 33 20 | 2d 6e 65 20 60 77 63 20 |st 1083 |-ne `wc |
|00001260| 2d 63 20 3c 27 72 77 68 | 6f 70 2e 6e 27 60 3b 20 |-c <'rwh|op.n'`; |
|00001270| 74 68 65 6e 0a 20 20 20 | 20 65 63 68 6f 20 73 68 |then. | echo sh|
|00001280| 61 72 3a 20 5c 22 27 72 | 77 68 6f 70 2e 6e 27 5c |ar: \"'r|whop.n'\|
|00001290| 22 20 75 6e 70 61 63 6b | 65 64 20 77 69 74 68 20 |" unpack|ed with |
|000012a0| 77 72 6f 6e 67 20 73 69 | 7a 65 21 0a 66 69 0a 23 |wrong si|ze!.fi.#|
|000012b0| 20 65 6e 64 20 6f 66 20 | 27 72 77 68 6f 70 2e 6e | end of |'rwhop.n|
|000012c0| 27 0a 66 69 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |'.fi.if |test -f |
|000012d0| 27 72 77 68 6f 70 61 72 | 73 65 2e 63 27 20 2d 61 |'rwhopar|se.c' -a|
|000012e0| 20 22 24 7b 31 7d 22 20 | 21 3d 20 22 2d 63 22 20 | "${1}" |!= "-c" |
|000012f0| 3b 20 74 68 65 6e 20 0a | 20 20 65 63 68 6f 20 73 |; then .| echo s|
|00001300| 68 61 72 3a 20 57 69 6c | 6c 20 6e 6f 74 20 63 6c |har: Wil|l not cl|
|00001310| 6f 62 62 65 72 20 65 78 | 69 73 74 69 6e 67 20 66 |obber ex|isting f|
|00001320| 69 6c 65 20 5c 22 27 72 | 77 68 6f 70 61 72 73 65 |ile \"'r|whoparse|
|00001330| 2e 63 27 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |.c'\".el|se.echo |
|00001340| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00001350| 20 5c 22 27 72 77 68 6f | 70 61 72 73 65 2e 63 27 | \"'rwho|parse.c'|
|00001360| 5c 22 20 5c 28 31 30 32 | 34 20 63 68 61 72 61 63 |\" \(102|4 charac|
|00001370| 74 65 72 73 5c 29 0a 73 | 65 64 20 22 73 2f 5e 58 |ters\).s|ed "s/^X|
|00001380| 2f 2f 22 20 3e 27 72 77 | 68 6f 70 61 72 73 65 2e |//" >'rw|hoparse.|
|00001390| 63 27 20 3c 3c 27 45 4e | 44 5f 4f 46 5f 46 49 4c |c' <<'EN|D_OF_FIL|
|000013a0| 45 27 0a 58 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |E'.X#inc|lude <st|
|000013b0| 64 69 6f 2e 68 3e 0a 58 | 23 69 6e 63 6c 75 64 65 |dio.h>.X|#include|
|000013c0| 20 3c 70 77 64 2e 68 3e | 0a 58 23 64 65 66 69 6e | <pwd.h>|.X#defin|
|000013d0| 65 20 52 57 48 4f 20 22 | 2f 75 73 72 2f 75 63 62 |e RWHO "|/usr/ucb|
|000013e0| 2f 72 77 68 6f 20 22 0a | 58 0a 6d 61 69 6e 28 61 |/rwho ".|X.main(a|
|000013f0| 72 67 63 2c 61 72 67 76 | 29 0a 69 6e 74 09 61 72 |rgc,argv|).int.ar|
|00001400| 67 63 3b 0a 63 68 61 72 | 09 2a 61 72 67 76 5b 5d |gc;.char|.*argv[]|
|00001410| 3b 0a 58 7b 0a 58 09 46 | 49 4c 45 09 2a 70 69 70 |;.X{.X.F|ILE.*pip|
|00001420| 65 3b 0a 58 0a 58 09 63 | 68 61 72 09 72 65 61 6c |e;.X.X.c|har.real|
|00001430| 5f 6e 61 6d 65 5b 32 30 | 5d 2c 20 69 6e 6c 69 6e |_name[20|], inlin|
|00001440| 65 5b 38 30 5d 3b 0a 58 | 09 63 68 61 72 09 2a 75 |e[80];.X|.char.*u|
|00001450| 73 65 72 2c 20 2a 68 6f | 73 74 2c 20 2a 74 69 6d |ser, *ho|st, *tim|
|00001460| 65 2c 20 2a 67 65 63 6f | 73 2c 20 2a 74 74 79 2c |e, *geco|s, *tty,|
|00001470| 20 2a 73 74 72 74 6f 6b | 28 29 3b 0a 58 0a 58 09 | *strtok|();.X.X.|
|00001480| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 69 3b 0a |register| int i;.|
|00001490| 58 0a 58 09 73 74 72 75 | 63 74 09 70 61 73 73 77 |X.X.stru|ct.passw|
|000014a0| 64 09 2a 70 77 3b 0a 58 | 0a 58 09 61 72 67 76 2b |d.*pw;.X|.X.argv+|
|000014b0| 2b 3b 0a 58 09 73 74 72 | 63 70 79 28 69 6e 6c 69 |+;.X.str|cpy(inli|
|000014c0| 6e 65 2c 52 57 48 4f 29 | 3b 0a 58 09 73 74 72 63 |ne,RWHO)|;.X.strc|
|000014d0| 61 74 28 69 6e 6c 69 6e | 65 2c 2a 61 72 67 76 29 |at(inlin|e,*argv)|
|000014e0| 3b 0a 58 0a 58 09 69 66 | 20 28 28 70 69 70 65 20 |;.X.X.if| ((pipe |
|000014f0| 3d 20 70 6f 70 65 6e 28 | 69 6e 6c 69 6e 65 2c 22 |= popen(|inline,"|
|00001500| 72 22 29 29 20 3d 3d 20 | 4e 55 4c 4c 29 0a 58 09 |r")) == |NULL).X.|
|00001510| 09 7b 0a 58 09 09 66 70 | 72 69 6e 74 66 20 28 73 |.{.X..fp|rintf (s|
|00001520| 74 64 65 72 72 2c 22 42 | 72 6f 6b 65 6e 20 70 69 |tderr,"B|roken pi|
|00001530| 70 65 5c 6e 22 29 3b 0a | 58 09 09 65 78 69 74 28 |pe\n");.|X..exit(|
|00001540| 2d 31 29 3b 0a 58 09 09 | 7d 0a 58 09 0a 70 72 69 |-1);.X..|}.X..pri|
|00001550| 6e 74 66 20 28 22 55 73 | 65 72 20 20 20 20 20 20 |ntf ("Us|er |
|00001560| 20 20 20 20 20 20 20 20 | 20 20 20 52 65 61 6c 20 | | Real |
|00001570| 4e 61 6d 65 20 20 20 20 | 20 20 20 20 48 6f 73 74 |Name | Host|
|00001580| 20 20 20 54 54 59 20 20 | 20 20 57 68 65 6e 20 20 | TTY | When |
|00001590| 20 20 20 20 20 20 20 49 | 64 6c 65 5c 6e 22 29 3b | I|dle\n");|
|000015a0| 0a 58 09 66 6f 72 20 28 | 69 3d 30 3b 69 3c 38 30 |.X.for (|i=0;i<80|
|000015b0| 3b 69 2b 2b 29 20 70 72 | 69 6e 74 66 20 28 22 2d |;i++) pr|intf ("-|
|000015c0| 22 29 3b 0a 58 09 70 72 | 69 6e 74 66 20 28 22 5c |");.X.pr|intf ("\|
|000015d0| 6e 22 29 3b 0a 58 0a 58 | 09 77 68 69 6c 65 20 28 |n");.X.X|.while (|
|000015e0| 66 67 65 74 73 28 69 6e | 6c 69 6e 65 2c 38 30 2c |fgets(in|line,80,|
|000015f0| 70 69 70 65 29 20 21 3d | 20 4e 55 4c 4c 29 0a 58 |pipe) !=| NULL).X|
|00001600| 09 09 7b 0a 58 09 09 75 | 73 65 72 20 3d 20 73 74 |..{.X..u|ser = st|
|00001610| 72 74 6f 6b 28 69 6e 6c | 69 6e 65 2c 22 20 22 29 |rtok(inl|ine," ")|
|00001620| 3b 0a 58 09 09 68 6f 73 | 74 20 3d 20 73 74 72 74 |;.X..hos|t = strt|
|00001630| 6f 6b 28 4e 55 4c 4c 2c | 22 3a 22 29 3b 0a 58 09 |ok(NULL,|":");.X.|
|00001640| 09 74 74 79 20 3d 20 73 | 74 72 74 6f 6b 28 4e 55 |.tty = s|trtok(NU|
|00001650| 4c 4c 2c 22 20 22 29 3b | 0a 58 09 09 74 69 6d 65 |LL," ");|.X..time|
|00001660| 20 3d 20 73 74 72 74 6f | 6b 28 4e 55 4c 4c 2c 22 | = strto|k(NULL,"|
|00001670| 5c 6e 22 29 3b 0a 58 0a | 58 09 09 69 66 20 28 28 |\n");.X.|X..if ((|
|00001680| 70 77 20 3d 20 67 65 74 | 70 77 6e 61 6d 28 75 73 |pw = get|pwnam(us|
|00001690| 65 72 29 29 20 21 3d 20 | 4e 55 4c 4c 29 0a 58 09 |er)) != |NULL).X.|
|000016a0| 09 09 7b 0a 58 09 09 09 | 67 65 63 6f 73 20 3d 20 |..{.X...|gecos = |
|000016b0| 73 74 72 74 6f 6b 28 70 | 77 2d 3e 70 77 5f 67 65 |strtok(p|w->pw_ge|
|000016c0| 63 6f 73 2c 22 2c 22 29 | 3b 0a 58 09 09 09 0a 58 |cos,",")|;.X....X|
|000016d0| 09 09 09 73 74 72 6e 63 | 70 79 28 72 65 61 6c 5f |...strnc|py(real_|
|000016e0| 6e 61 6d 65 2c 67 65 63 | 6f 73 2c 32 30 29 3b 0a |name,gec|os,20);.|
|000016f0| 58 09 09 09 72 65 61 6c | 5f 6e 61 6d 65 5b 32 30 |X...real|_name[20|
|00001700| 5d 20 3d 20 4e 55 4c 4c | 3b 0a 58 09 09 09 0a 58 |] = NULL|;.X....X|
|00001710| 09 09 09 77 68 69 6c 65 | 28 74 69 6d 65 5b 30 5d |...while|(time[0]|
|00001720| 20 3d 3d 20 27 20 27 29 | 20 74 69 6d 65 2b 2b 3b | == ' ')| time++;|
|00001730| 0a 58 09 09 09 77 68 69 | 6c 65 28 68 6f 73 74 5b |.X...whi|le(host[|
|00001740| 30 5d 20 3d 3d 20 27 20 | 27 29 20 68 6f 73 74 2b |0] == ' |') host+|
|00001750| 2b 3b 0a 58 09 09 09 0a | 58 09 09 09 70 72 69 6e |+;.X....|X...prin|
|00001760| 74 66 20 28 22 25 38 73 | 20 20 25 32 30 73 20 20 |tf ("%8s| %20s |
|00001770| 25 31 30 73 20 20 25 36 | 73 20 20 25 73 5c 6e 22 |%10s %6|s %s\n"|
|00001780| 2c 0a 58 09 09 09 09 75 | 73 65 72 2c 0a 58 09 09 |,.X....u|ser,.X..|
|00001790| 09 09 72 65 61 6c 5f 6e | 61 6d 65 2c 0a 58 09 09 |..real_n|ame,.X..|
|000017a0| 09 09 73 74 72 74 6f 6b | 28 68 6f 73 74 2c 22 2e |..strtok|(host,".|
|000017b0| 22 29 2c 0a 58 09 09 09 | 09 74 74 79 2c 0a 58 09 |"),.X...|.tty,.X.|
|000017c0| 09 09 09 74 69 6d 65 29 | 3b 0a 58 09 09 09 7d 0a |...time)|;.X...}.|
|000017d0| 58 09 09 7d 0a 58 7d 0a | 45 4e 44 5f 4f 46 5f 46 |X..}.X}.|END_OF_F|
|000017e0| 49 4c 45 0a 69 66 20 74 | 65 73 74 20 31 30 32 34 |ILE.if t|est 1024|
|000017f0| 20 2d 6e 65 20 60 77 63 | 20 2d 63 20 3c 27 72 77 | -ne `wc| -c <'rw|
|00001800| 68 6f 70 61 72 73 65 2e | 63 27 60 3b 20 74 68 65 |hoparse.|c'`; the|
|00001810| 6e 0a 20 20 20 20 65 63 | 68 6f 20 73 68 61 72 3a |n. ec|ho shar:|
|00001820| 20 5c 22 27 72 77 68 6f | 70 61 72 73 65 2e 63 27 | \"'rwho|parse.c'|
|00001830| 5c 22 20 75 6e 70 61 63 | 6b 65 64 20 77 69 74 68 |\" unpac|ked with|
|00001840| 20 77 72 6f 6e 67 20 73 | 69 7a 65 21 0a 66 69 0a | wrong s|ize!.fi.|
|00001850| 23 20 65 6e 64 20 6f 66 | 20 27 72 77 68 6f 70 61 |# end of| 'rwhopa|
|00001860| 72 73 65 2e 63 27 0a 66 | 69 0a 65 63 68 6f 20 73 |rse.c'.f|i.echo s|
|00001870| 68 61 72 3a 20 45 6e 64 | 20 6f 66 20 73 68 65 6c |har: End| of shel|
|00001880| 6c 20 61 72 63 68 69 76 | 65 2e 0a 65 78 69 74 20 |l archiv|e..exit |
|00001890| 30 0a 0a 0a | |0... | |
+--------+-------------------------+-------------------------+--------+--------+