home *** CD-ROM | disk | FTP | other *** search
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: 7
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news or mail text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| makefile script text
| default
| |
97%
| file
| C source, 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
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 6a 61 | 63 6b 40 73 77 6c 61 62 |From: ja|ck@swlab|
|00000010| 73 2e 55 55 43 50 20 28 | 4a 61 63 6b 20 42 6f 6e |s.UUCP (|Jack Bon|
|00000020| 6e 29 0a 4e 65 77 73 67 | 72 6f 75 70 73 3a 20 63 |n).Newsg|roups: c|
|00000030| 6f 6d 70 2e 73 6f 75 72 | 63 65 73 2e 6d 69 73 63 |omp.sour|ces.misc|
|00000040| 0a 53 75 62 6a 65 63 74 | 3a 20 75 75 63 6f 73 74 |.Subject|: uucost|
|00000050| 20 2d 2d 20 44 69 73 70 | 6c 61 79 20 75 75 63 70 | -- Disp|lay uucp|
|00000060| 20 63 6f 73 74 73 20 6f | 6e 20 73 63 72 65 65 6e | costs o|n screen|
|00000070| 2e 0a 4d 65 73 73 61 67 | 65 2d 49 44 3a 20 3c 34 |..Messag|e-ID: <4|
|00000080| 30 38 37 40 6e 63 6f 61 | 73 74 2e 55 55 43 50 3e |087@ncoa|st.UUCP>|
|00000090| 0a 44 61 74 65 3a 20 38 | 20 41 75 67 20 38 37 20 |.Date: 8| Aug 87 |
|000000a0| 30 30 3a 32 31 3a 33 36 | 20 47 4d 54 0a 53 65 6e |00:21:36| GMT.Sen|
|000000b0| 64 65 72 3a 20 61 6c 6c | 62 65 72 79 40 6e 63 6f |der: all|bery@nco|
|000000c0| 61 73 74 2e 55 55 43 50 | 0a 4f 72 67 61 6e 69 7a |ast.UUCP|.Organiz|
|000000d0| 61 74 69 6f 6e 3a 20 53 | 6f 66 74 77 61 72 65 20 |ation: S|oftware |
|000000e0| 4c 61 62 73 2c 20 4c 74 | 64 2e 20 45 61 73 74 6f |Labs, Lt|d. Easto|
|000000f0| 6e 20 43 54 20 55 53 41 | 0a 4c 69 6e 65 73 3a 20 |n CT USA|.Lines: |
|00000100| 34 32 32 0a 41 70 70 72 | 6f 76 65 64 3a 20 61 6c |422.Appr|oved: al|
|00000110| 6c 62 65 72 79 40 6e 63 | 6f 61 73 74 2e 55 55 43 |lbery@nc|oast.UUC|
|00000120| 50 0a 58 2d 41 72 63 68 | 69 76 65 3a 20 63 6f 6d |P.X-Arch|ive: com|
|00000130| 70 2e 73 6f 75 72 63 65 | 73 2e 6d 69 73 63 2f 38 |p.source|s.misc/8|
|00000140| 37 30 38 2f 37 0a 0a 54 | 68 69 73 20 69 73 20 61 |708/7..T|his is a|
|00000150| 20 73 65 74 20 6f 66 20 | 72 6f 75 74 69 6e 65 73 | set of |routines|
|00000160| 20 66 6f 72 20 64 69 73 | 70 6c 61 79 69 6e 67 20 | for dis|playing |
|00000170| 74 68 65 20 63 6f 73 74 | 73 20 6f 66 20 61 6c 6c |the cost|s of all|
|00000180| 20 75 75 63 70 20 73 65 | 73 73 69 6f 6e 73 0a 73 | uucp se|ssions.s|
|00000190| 6f 20 66 61 72 20 74 68 | 69 73 20 6d 6f 6e 74 68 |o far th|is month|
|000001a0| 20 61 6e 64 20 73 6f 20 | 66 61 72 20 74 6f 64 61 | and so |far toda|
|000001b0| 79 2e 20 20 49 74 20 69 | 73 20 69 6e 74 65 6e 64 |y. It i|s intend|
|000001c0| 65 64 20 66 6f 72 20 75 | 73 65 20 77 69 74 68 20 |ed for u|se with |
|000001d0| 48 44 42 20 61 6e 64 0a | 72 75 6e 73 20 6f 6e 20 |HDB and.|runs on |
|000001e0| 53 79 73 74 65 6d 20 56 | 2e 20 20 54 68 65 72 65 |System V|. There|
|000001f0| 20 69 73 20 6e 6f 74 68 | 69 6e 67 20 66 61 6e 63 | is noth|ing fanc|
|00000200| 79 20 68 65 72 65 2c 20 | 6d 6f 64 69 66 69 63 61 |y here, |modifica|
|00000210| 74 69 6f 6e 20 74 6f 20 | 6f 74 68 65 72 0a 65 6e |tion to |other.en|
|00000220| 76 69 72 6f 6e 6d 65 6e | 74 73 20 73 68 6f 75 6c |vironmen|ts shoul|
|00000230| 64 20 62 65 20 65 61 73 | 79 2e 20 20 54 68 65 20 |d be eas|y. The |
|00000240| 6f 75 74 70 75 74 20 6f | 66 20 75 75 6c 6f 67 20 |output o|f uulog |
|00000250| 69 73 20 75 73 65 64 20 | 74 6f 20 64 65 74 65 72 |is used |to deter|
|00000260| 6d 69 6e 65 0a 74 68 65 | 20 64 75 72 61 74 69 6f |mine.the| duratio|
|00000270| 6e 20 6f 66 20 63 61 6c | 6c 73 20 74 6f 20 65 61 |n of cal|ls to ea|
|00000280| 63 68 20 73 69 74 65 3b | 20 6d 6f 64 69 66 69 63 |ch site;| modific|
|00000290| 61 74 69 6f 6e 20 77 6f | 75 6c 64 20 6f 6e 6c 79 |ation wo|uld only|
|000002a0| 20 65 6e 74 61 69 6c 20 | 63 68 61 6e 67 69 6e 67 | entail |changing|
|000002b0| 0a 74 68 65 20 72 6f 75 | 74 69 6e 65 20 28 73 63 |.the rou|tine (sc|
|000002c0| 61 6e 5f 63 6f 73 74 2e | 63 29 20 77 68 69 63 68 |an_cost.|c) which|
|000002d0| 20 73 63 61 6e 73 20 74 | 68 65 20 6f 75 74 70 75 | scans t|he outpu|
|000002e0| 74 20 6f 66 20 74 68 65 | 20 75 75 6c 6f 67 20 74 |t of the| uulog t|
|000002f0| 6f 20 68 61 6e 64 6c 65 | 0a 6f 74 68 65 72 20 66 |o handle|.other f|
|00000300| 6f 72 6d 61 74 73 2e 0a | 0a 23 21 20 2f 62 69 6e |ormats..|.#! /bin|
|00000310| 2f 73 68 0a 23 20 54 68 | 69 73 20 69 73 20 61 20 |/sh.# Th|is is a |
|00000320| 73 68 65 6c 6c 20 61 72 | 63 68 69 76 65 2c 20 6d |shell ar|chive, m|
|00000330| 65 61 6e 69 6e 67 3a 0a | 23 20 31 2e 20 52 65 6d |eaning:.|# 1. Rem|
|00000340| 6f 76 65 20 65 76 65 72 | 79 74 68 69 6e 67 20 61 |ove ever|ything a|
|00000350| 62 6f 76 65 20 74 68 65 | 20 23 21 20 2f 62 69 6e |bove the| #! /bin|
|00000360| 2f 73 68 20 6c 69 6e 65 | 2e 0a 23 20 32 2e 20 53 |/sh line|..# 2. S|
|00000370| 61 76 65 20 74 68 65 20 | 72 65 73 75 6c 74 69 6e |ave the |resultin|
|00000380| 67 20 74 65 78 74 20 69 | 6e 20 61 20 66 69 6c 65 |g text i|n a file|
|00000390| 2e 0a 23 20 33 2e 20 45 | 78 65 63 75 74 65 20 74 |..# 3. E|xecute t|
|000003a0| 68 65 20 66 69 6c 65 20 | 77 69 74 68 20 2f 62 69 |he file |with /bi|
|000003b0| 6e 2f 73 68 20 28 6e 6f | 74 20 63 73 68 29 20 74 |n/sh (no|t csh) t|
|000003c0| 6f 20 63 72 65 61 74 65 | 3a 0a 23 09 4d 61 6b 65 |o create|:.#.Make|
|000003d0| 66 69 6c 65 0a 23 09 66 | 6f 72 6d 5f 63 6f 73 74 |file.#.f|orm_cost|
|000003e0| 2e 63 0a 23 09 73 63 61 | 6e 5f 63 6f 73 74 2e 63 |.c.#.sca|n_cost.c|
|000003f0| 0a 23 09 63 6f 73 74 73 | 0a 23 09 52 45 41 44 4d |.#.costs|.#.READM|
|00000400| 45 0a 23 09 75 75 63 6f | 73 74 0a 23 09 75 75 63 |E.#.uuco|st.#.uuc|
|00000410| 6f 73 74 2e 64 61 0a 23 | 09 75 75 63 6f 73 74 2e |ost.da.#|.uucost.|
|00000420| 6d 6f 0a 23 20 54 68 69 | 73 20 61 72 63 68 69 76 |mo.# Thi|s archiv|
|00000430| 65 20 63 72 65 61 74 65 | 64 3a 20 46 72 69 20 41 |e create|d: Fri A|
|00000440| 75 67 20 20 37 20 31 33 | 3a 30 38 3a 31 39 20 31 |ug 7 13|:08:19 1|
|00000450| 39 38 37 0a 65 78 70 6f | 72 74 20 50 41 54 48 3b |987.expo|rt PATH;|
|00000460| 20 50 41 54 48 3d 2f 62 | 69 6e 3a 2f 75 73 72 2f | PATH=/b|in:/usr/|
|00000470| 62 69 6e 3a 24 50 41 54 | 48 0a 69 66 20 74 65 73 |bin:$PAT|H.if tes|
|00000480| 74 20 2d 66 20 27 4d 61 | 6b 65 66 69 6c 65 27 0a |t -f 'Ma|kefile'.|
|00000490| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|000004a0| 20 22 77 69 6c 6c 20 6e | 6f 74 20 6f 76 65 72 2d | "will n|ot over-|
|000004b0| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 20 66 |write ex|isting f|
|000004c0| 69 6c 65 20 27 4d 61 6b | 65 66 69 6c 65 27 22 0a |ile 'Mak|efile'".|
|000004d0| 65 6c 73 65 0a 63 61 74 | 20 3c 3c 20 5c 53 48 41 |else.cat| << \SHA|
|000004e0| 52 5f 45 4f 46 20 3e 20 | 27 4d 61 6b 65 66 69 6c |R_EOF > |'Makefil|
|000004f0| 65 27 0a 23 0a 23 20 6d | 61 6b 65 66 69 6c 65 20 |e'.#.# m|akefile |
|00000500| 66 6f 72 20 75 75 63 6f | 73 74 2e 0a 23 0a 23 0a |for uuco|st..#.#.|
|00000510| 61 6c 6c 3a 20 66 6f 72 | 6d 5f 63 6f 73 74 20 73 |all: for|m_cost s|
|00000520| 63 61 6e 5f 63 6f 73 74 | 0a 0a 73 68 61 72 3a 0a |can_cost|..shar:.|
|00000530| 09 73 68 61 72 20 4d 61 | 6b 65 66 69 6c 65 20 66 |.shar Ma|kefile f|
|00000540| 6f 72 6d 5f 63 6f 73 74 | 2e 63 20 73 63 61 6e 5f |orm_cost|.c scan_|
|00000550| 63 6f 73 74 2e 63 20 63 | 6f 73 74 73 20 52 45 41 |cost.c c|osts REA|
|00000560| 44 4d 45 20 5c 0a 09 75 | 75 63 6f 73 74 20 75 75 |DME \..u|ucost uu|
|00000570| 63 6f 73 74 2e 64 61 20 | 75 75 63 6f 73 74 2e 6d |cost.da |uucost.m|
|00000580| 6f 20 3e 75 75 63 6f 73 | 74 2e 73 68 61 72 0a 0a |o >uucos|t.shar..|
|00000590| 69 6e 73 74 61 6c 6c 3a | 0a 09 63 68 6d 6f 64 20 |install:|..chmod |
|000005a0| 75 2b 78 20 75 75 63 6f | 73 74 20 75 75 63 6f 73 |u+x uuco|st uucos|
|000005b0| 74 2e 64 61 20 75 75 63 | 6f 73 74 2e 6d 6f 0a 09 |t.da uuc|ost.mo..|
|000005c0| 63 68 6f 77 6e 20 75 75 | 63 70 20 2a 0a 09 3e 63 |chown uu|cp *..>c|
|000005d0| 6f 73 74 2e 6c 6f 67 0a | 0a 6c 69 6e 74 3a 0a 09 |ost.log.|.lint:..|
|000005e0| 6c 69 6e 74 20 73 63 61 | 6e 5f 63 6f 73 74 2e 63 |lint sca|n_cost.c|
|000005f0| 0a 09 6c 69 6e 74 20 66 | 6f 72 6d 5f 63 6f 73 74 |..lint f|orm_cost|
|00000600| 2e 63 0a 0a 63 6c 65 61 | 6e 3a 0a 09 3e 63 6f 73 |.c..clea|n:..>cos|
|00000610| 74 2e 6c 6f 67 0a 09 72 | 6d 20 73 63 61 6e 5f 63 |t.log..r|m scan_c|
|00000620| 6f 73 74 20 66 6f 72 6d | 5f 63 6f 73 74 0a 53 48 |ost form|_cost.SH|
|00000630| 41 52 5f 45 4f 46 0a 66 | 69 0a 69 66 20 74 65 73 |AR_EOF.f|i.if tes|
|00000640| 74 20 2d 66 20 27 66 6f | 72 6d 5f 63 6f 73 74 2e |t -f 'fo|rm_cost.|
|00000650| 63 27 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |c'.then.|.echo sh|
|00000660| 61 72 3a 20 22 77 69 6c | 6c 20 6e 6f 74 20 6f 76 |ar: "wil|l not ov|
|00000670| 65 72 2d 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |er-write| existin|
|00000680| 67 20 66 69 6c 65 20 27 | 66 6f 72 6d 5f 63 6f 73 |g file '|form_cos|
|00000690| 74 2e 63 27 22 0a 65 6c | 73 65 0a 63 61 74 20 3c |t.c'".el|se.cat <|
|000006a0| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 66 |< \SHAR_|EOF > 'f|
|000006b0| 6f 72 6d 5f 63 6f 73 74 | 2e 63 27 0a 23 69 6e 63 |orm_cost|.c'.#inc|
|000006c0| 6c 75 64 65 20 3c 73 74 | 64 69 6f 2e 68 3e 0a 23 |lude <st|dio.h>.#|
|000006d0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 72 69 6e 67 2e |include |<string.|
|000006e0| 68 3e 0a 0a 23 64 65 66 | 69 6e 65 20 53 59 53 54 |h>..#def|ine SYST|
|000006f0| 45 4d 53 20 31 30 30 09 | 2f 2a 20 4d 61 78 20 6e |EMS 100.|/* Max n|
|00000700| 75 6d 62 65 72 20 6f 66 | 20 73 79 73 74 65 6d 73 |umber of| systems|
|00000710| 20 74 6f 20 74 72 61 63 | 6b 20 2a 2f 0a 23 64 65 | to trac|k */.#de|
|00000720| 66 69 6e 65 20 53 59 53 | 5f 53 49 5a 45 20 31 31 |fine SYS|_SIZE 11|
|00000730| 09 2f 2a 20 4e 75 6d 62 | 65 72 20 6f 66 20 63 68 |./* Numb|er of ch|
|00000740| 61 72 73 20 69 6e 20 73 | 79 73 74 65 6d 20 6e 61 |ars in s|ystem na|
|00000750| 6d 65 20 28 69 6e 63 6c | 75 64 69 6e 67 20 6e 75 |me (incl|uding nu|
|00000760| 6c 6c 29 20 2a 2f 0a 23 | 64 65 66 69 6e 65 20 42 |ll) */.#|define B|
|00000770| 55 46 5f 53 49 5a 45 20 | 38 30 09 2f 2a 20 4d 61 |UF_SIZE |80./* Ma|
|00000780| 78 20 63 68 61 72 73 20 | 69 6e 20 6c 69 6e 65 20 |x chars |in line |
|00000790| 2a 2f 0a 0a 46 49 4c 45 | 20 2a 66 6f 70 65 6e 28 |*/..FILE| *fopen(|
|000007a0| 29 2c 20 2a 63 6f 73 74 | 73 5f 66 69 6c 65 3b 0a |), *cost|s_file;.|
|000007b0| 0a 73 74 72 75 63 74 20 | 63 6f 73 74 73 20 7b 0a |.struct |costs {.|
|000007c0| 20 20 20 20 63 68 61 72 | 20 73 79 73 74 65 6d 5b | char| system[|
|000007d0| 53 59 53 5f 53 49 5a 45 | 5d 3b 0a 20 20 20 20 69 |SYS_SIZE|];. i|
|000007e0| 6e 74 20 66 69 72 73 74 | 3b 0a 20 20 20 20 69 6e |nt first|;. in|
|000007f0| 74 20 63 6f 73 74 3b 0a | 20 20 20 20 69 6e 74 20 |t cost;.| int |
|00000800| 6d 69 6e 69 6d 75 6d 3b | 0a 20 20 20 20 6c 6f 6e |minimum;|. lon|
|00000810| 67 20 6d 69 6e 75 74 65 | 73 3b 0a 20 20 20 20 6c |g minute|s;. l|
|00000820| 6f 6e 67 20 74 6f 74 5f | 63 6f 73 74 3b 0a 20 20 |ong tot_|cost;. |
|00000830| 20 20 69 6e 74 20 75 73 | 65 64 3b 0a 7d 20 73 79 | int us|ed;.} sy|
|00000840| 73 74 65 6d 5f 63 6f 73 | 74 73 5b 53 59 53 54 45 |stem_cos|ts[SYSTE|
|00000850| 4d 53 5d 3b 0a 0a 73 74 | 72 75 63 74 20 63 6f 73 |MS];..st|ruct cos|
|00000860| 74 73 20 2a 63 5f 70 74 | 72 3b 0a 0a 23 64 65 66 |ts *c_pt|r;..#def|
|00000870| 69 6e 65 20 6d 61 78 28 | 61 2c 62 29 20 28 28 61 |ine max(|a,b) ((a|
|00000880| 29 3e 28 62 29 3f 28 61 | 29 3a 28 62 29 29 0a 0a |)>(b)?(a|):(b))..|
|00000890| 69 6e 74 20 73 79 73 74 | 65 6d 73 3b 0a 0a 69 6e |int syst|ems;..in|
|000008a0| 74 20 6c 6f 6f 6b 66 6f | 72 28 29 3b 0a 0a 69 6e |t lookfo|r();..in|
|000008b0| 74 20 6d 61 69 6e 28 29 | 20 7b 0a 20 20 20 20 69 |t main()| {. i|
|000008c0| 6e 74 20 6d 69 6e 73 3b | 0a 20 20 20 20 69 6e 74 |nt mins;|. int|
|000008d0| 20 69 3b 0a 20 20 20 20 | 63 68 61 72 20 73 79 73 | i;. |char sys|
|000008e0| 5b 53 59 53 5f 53 49 5a | 45 5d 3b 0a 20 20 20 20 |[SYS_SIZ|E];. |
|000008f0| 6c 6f 6e 67 20 74 68 69 | 73 5f 63 6f 73 74 3b 0a |long thi|s_cost;.|
|00000900| 20 20 20 20 69 6e 74 20 | 73 63 3b 0a 20 20 20 20 | int |sc;. |
|00000910| 63 68 61 72 20 62 75 66 | 66 65 72 5b 42 55 46 5f |char buf|fer[BUF_|
|00000920| 53 49 5a 45 5d 3b 0a 20 | 20 20 20 6c 6f 6e 67 20 |SIZE];. | long |
|00000930| 74 6f 74 61 6c 3b 0a 20 | 20 20 20 6c 6f 6e 67 20 |total;. | long |
|00000940| 74 6f 74 5f 6d 69 6e 73 | 3b 0a 0a 20 20 20 20 2f |tot_mins|;.. /|
|00000950| 2a 0a 09 52 65 61 64 20 | 74 68 65 20 63 6f 73 74 |*..Read |the cost|
|00000960| 73 20 66 69 6c 65 2c 20 | 6f 6e 65 20 72 65 63 6f |s file, |one reco|
|00000970| 72 64 20 70 65 72 20 73 | 79 73 74 65 6d 2e 0a 20 |rd per s|ystem.. |
|00000980| 20 20 20 2a 2f 0a 20 20 | 20 20 63 6f 73 74 73 5f | */. | costs_|
|00000990| 66 69 6c 65 20 3d 20 66 | 6f 70 65 6e 28 22 2f 75 |file = f|open("/u|
|000009a0| 73 72 2f 6c 69 62 2f 75 | 75 63 70 2f 75 75 63 6f |sr/lib/u|ucp/uuco|
|000009b0| 73 74 2f 63 6f 73 74 73 | 22 2c 22 72 22 29 3b 0a |st/costs|","r");.|
|000009c0| 20 20 20 20 63 5f 70 74 | 72 20 3d 20 73 79 73 74 | c_pt|r = syst|
|000009d0| 65 6d 5f 63 6f 73 74 73 | 3b 0a 0a 20 20 20 20 77 |em_costs|;.. w|
|000009e0| 68 69 6c 65 20 28 66 67 | 65 74 73 20 28 62 75 66 |hile (fg|ets (buf|
|000009f0| 66 65 72 2c 20 28 69 6e | 74 29 73 69 7a 65 6f 66 |fer, (in|t)sizeof|
|00000a00| 28 62 75 66 66 65 72 29 | 2c 20 63 6f 73 74 73 5f |(buffer)|, costs_|
|00000a10| 66 69 6c 65 29 29 20 7b | 0a 09 69 66 20 28 62 75 |file)) {|..if (bu|
|00000a20| 66 66 65 72 5b 30 5d 20 | 21 3d 20 27 23 27 29 20 |ffer[0] |!= '#') |
|00000a30| 7b 20 2f 2a 20 69 67 6e | 6f 72 65 20 63 6f 6d 6d |{ /* ign|ore comm|
|00000a40| 65 6e 74 73 20 2a 2f 0a | 09 20 20 20 20 73 63 20 |ents */.|. sc |
|00000a50| 3d 20 73 73 63 61 6e 66 | 28 62 75 66 66 65 72 2c |= sscanf|(buffer,|
|00000a60| 20 22 25 73 25 64 25 64 | 25 64 22 2c 20 63 5f 70 | "%s%d%d|%d", c_p|
|00000a70| 74 72 2d 3e 73 79 73 74 | 65 6d 2c 20 26 63 5f 70 |tr->syst|em, &c_p|
|00000a80| 74 72 2d 3e 66 69 72 73 | 74 2c 20 0a 09 09 26 63 |tr->firs|t, ...&c|
|00000a90| 5f 70 74 72 2d 3e 63 6f | 73 74 2c 20 26 63 5f 70 |_ptr->co|st, &c_p|
|00000aa0| 74 72 2d 3e 6d 69 6e 69 | 6d 75 6d 29 3b 0a 09 20 |tr->mini|mum);.. |
|00000ab0| 20 20 20 69 66 20 28 73 | 63 20 3d 3d 20 34 29 20 | if (s|c == 4) |
|00000ac0| 7b 0a 09 09 63 5f 70 74 | 72 2d 3e 6d 69 6e 75 74 |{...c_pt|r->minut|
|00000ad0| 65 73 20 3d 20 30 4c 3b | 0a 09 09 63 5f 70 74 72 |es = 0L;|...c_ptr|
|00000ae0| 2d 3e 74 6f 74 5f 63 6f | 73 74 20 3d 20 30 4c 3b |->tot_co|st = 0L;|
|00000af0| 0a 09 09 63 5f 70 74 72 | 2d 3e 75 73 65 64 20 3d |...c_ptr|->used =|
|00000b00| 20 30 3b 0a 09 09 63 5f | 70 74 72 2b 2b 3b 0a 09 | 0;...c_|ptr++;..|
|00000b10| 20 20 20 20 7d 20 65 6c | 73 65 20 7b 0a 09 09 28 | } el|se {...(|
|00000b20| 76 6f 69 64 29 66 70 72 | 69 6e 74 66 20 28 73 74 |void)fpr|intf (st|
|00000b30| 64 65 72 72 2c 20 22 46 | 6f 72 6d 61 74 20 65 72 |derr, "F|ormat er|
|00000b40| 72 6f 72 20 69 6e 20 63 | 6f 73 74 73 20 66 69 6c |ror in c|osts fil|
|00000b50| 65 2e 20 20 22 29 3b 0a | 09 09 28 76 6f 69 64 29 |e. ");.|..(void)|
|00000b60| 66 70 72 69 6e 74 66 20 | 28 73 74 64 65 72 72 2c |fprintf |(stderr,|
|00000b70| 20 22 49 6e 70 75 74 20 | 77 61 73 3a 20 25 73 5c | "Input |was: %s\|
|00000b80| 6e 22 2c 20 62 75 66 66 | 65 72 29 3b 0a 09 20 20 |n", buff|er);.. |
|00000b90| 20 20 7d 0a 09 7d 0a 20 | 20 20 20 7d 0a 0a 20 20 | }..}. | }.. |
|00000ba0| 20 20 73 79 73 74 65 6d | 73 20 3d 20 63 5f 70 74 | system|s = c_pt|
|00000bb0| 72 20 2d 20 73 79 73 74 | 65 6d 5f 63 6f 73 74 73 |r - syst|em_costs|
|00000bc0| 3b 20 20 2f 2a 20 6e 75 | 6d 62 65 72 20 6f 66 20 |; /* nu|mber of |
|00000bd0| 73 79 73 74 65 6d 5f 63 | 6f 73 74 73 20 65 6e 74 |system_c|osts ent|
|00000be0| 72 69 65 73 20 75 73 65 | 64 20 2a 2f 0a 0a 20 20 |ries use|d */.. |
|00000bf0| 20 20 2f 2a 0a 09 46 6f | 72 20 65 61 63 68 20 6c | /*..Fo|r each l|
|00000c00| 69 6e 65 20 6f 66 20 73 | 74 61 6e 64 61 72 64 20 |ine of s|tandard |
|00000c10| 69 6e 70 75 74 3a 0a 0a | 09 31 29 20 6c 6f 6f 6b |input:..|.1) look|
|00000c20| 20 75 70 20 73 79 73 74 | 65 6d 20 69 6e 20 73 79 | up syst|em in sy|
|00000c30| 73 74 65 6d 73 5f 63 6f | 73 74 73 20 73 74 72 75 |stems_co|sts stru|
|00000c40| 63 74 75 72 65 0a 09 32 | 29 20 61 64 64 20 74 68 |cture..2|) add th|
|00000c50| 65 20 74 69 6d 65 20 74 | 6f 20 74 68 65 20 72 75 |e time t|o the ru|
|00000c60| 6e 6e 69 6e 67 20 63 6f | 75 6e 74 20 66 6f 72 20 |nning co|unt for |
|00000c70| 74 68 69 73 20 73 79 73 | 74 65 6d 0a 09 33 29 20 |this sys|tem..3) |
|00000c80| 66 69 67 75 72 65 20 74 | 68 65 20 63 6f 73 74 20 |figure t|he cost |
|00000c90| 6f 66 20 74 68 65 20 73 | 65 73 73 69 6f 6e 20 61 |of the s|ession a|
|00000ca0| 6e 64 20 61 64 64 20 69 | 74 20 69 6e 0a 20 20 20 |nd add i|t in. |
|00000cb0| 20 2a 2f 0a 20 20 20 20 | 77 68 69 6c 65 20 28 73 | */. |while (s|
|00000cc0| 63 61 6e 66 28 22 25 73 | 25 73 25 64 22 2c 20 73 |canf("%s|%s%d", s|
|00000cd0| 79 73 2c 20 62 75 66 66 | 65 72 2c 20 26 6d 69 6e |ys, buff|er, &min|
|00000ce0| 73 29 20 21 3d 20 45 4f | 46 29 20 7b 0a 09 69 66 |s) != EO|F) {..if|
|00000cf0| 20 28 28 69 20 3d 20 6c | 6f 6f 6b 66 6f 72 28 73 | ((i = l|ookfor(s|
|00000d00| 79 73 29 29 20 3d 3d 20 | 2d 31 29 20 7b 0a 20 20 |ys)) == |-1) {. |
|00000d10| 20 20 09 20 20 20 20 28 | 76 6f 69 64 29 20 66 70 | . (|void) fp|
|00000d20| 72 69 6e 74 66 20 28 73 | 74 64 65 72 72 2c 22 53 |rintf (s|tderr,"S|
|00000d30| 79 73 74 65 6d 20 25 73 | 20 6e 6f 74 20 66 6f 75 |ystem %s| not fou|
|00000d40| 6e 64 20 69 6e 20 63 6f | 73 74 73 20 66 69 6c 65 |nd in co|sts file|
|00000d50| 2e 5c 6e 22 2c 20 73 79 | 73 29 3b 0a 09 7d 20 65 |.\n", sy|s);..} e|
|00000d60| 6c 73 65 20 7b 0a 09 20 | 20 20 20 63 5f 70 74 72 |lse {.. | c_ptr|
|00000d70| 20 3d 20 26 73 79 73 74 | 65 6d 5f 63 6f 73 74 73 | = &syst|em_costs|
|00000d80| 5b 69 5d 3b 0a 09 20 20 | 20 20 63 5f 70 74 72 2d |[i];.. | c_ptr-|
|00000d90| 3e 75 73 65 64 20 3d 20 | 31 3b 0a 09 20 20 20 20 |>used = |1;.. |
|00000da0| 63 5f 70 74 72 2d 3e 6d | 69 6e 75 74 65 73 20 2b |c_ptr->m|inutes +|
|00000db0| 3d 20 28 6c 6f 6e 67 29 | 6d 69 6e 73 3b 0a 09 20 |= (long)|mins;.. |
|00000dc0| 20 20 20 74 68 69 73 5f | 63 6f 73 74 20 3d 20 28 | this_|cost = (|
|00000dd0| 6c 6f 6e 67 29 63 5f 70 | 74 72 2d 3e 66 69 72 73 |long)c_p|tr->firs|
|00000de0| 74 3b 0a 09 20 20 20 20 | 74 68 69 73 5f 63 6f 73 |t;.. |this_cos|
|00000df0| 74 20 2b 3d 20 28 6c 6f | 6e 67 29 63 5f 70 74 72 |t += (lo|ng)c_ptr|
|00000e00| 2d 3e 63 6f 73 74 20 2a | 20 28 6c 6f 6e 67 29 28 |->cost *| (long)(|
|00000e10| 6d 69 6e 73 2d 31 29 3b | 0a 09 20 20 20 20 74 68 |mins-1);|.. th|
|00000e20| 69 73 5f 63 6f 73 74 20 | 3d 20 6d 61 78 28 74 68 |is_cost |= max(th|
|00000e30| 69 73 5f 63 6f 73 74 2c | 20 28 6c 6f 6e 67 29 63 |is_cost,| (long)c|
|00000e40| 5f 70 74 72 2d 3e 6d 69 | 6e 69 6d 75 6d 29 3b 0a |_ptr->mi|nimum);.|
|00000e50| 09 20 20 20 20 63 5f 70 | 74 72 2d 3e 74 6f 74 5f |. c_p|tr->tot_|
|00000e60| 63 6f 73 74 20 2b 3d 20 | 74 68 69 73 5f 63 6f 73 |cost += |this_cos|
|00000e70| 74 3b 0a 23 69 66 64 65 | 66 20 44 45 42 55 47 0a |t;.#ifde|f DEBUG.|
|00000e80| 09 20 20 20 20 28 76 6f | 69 64 29 20 70 72 69 6e |. (vo|id) prin|
|00000e90| 74 66 20 28 22 25 2d 31 | 30 73 20 25 2d 33 30 73 |tf ("%-1|0s %-30s|
|00000ea0| 20 25 33 64 20 6d 69 6e | 73 20 3d 20 24 25 33 6c | %3d min|s = $%3l|
|00000eb0| 64 2e 25 2e 32 6c 64 5c | 6e 22 2c 20 0a 09 09 73 |d.%.2ld\|n", ...s|
|00000ec0| 79 73 2c 20 62 75 66 66 | 65 72 2c 20 6d 69 6e 73 |ys, buff|er, mins|
|00000ed0| 2c 20 74 68 69 73 5f 63 | 6f 73 74 2f 31 30 30 4c |, this_c|ost/100L|
|00000ee0| 2c 20 74 68 69 73 5f 63 | 6f 73 74 25 31 30 30 4c |, this_c|ost%100L|
|00000ef0| 29 3b 0a 23 65 6e 64 69 | 66 20 2f 2a 20 44 45 42 |);.#endi|f /* DEB|
|00000f00| 55 47 20 2a 2f 0a 09 7d | 0a 20 20 20 20 7d 0a 0a |UG */..}|. }..|
|00000f10| 20 20 20 20 2f 2a 0a 09 | 46 6f 72 20 65 61 63 68 | /*..|For each|
|00000f20| 20 73 79 73 74 65 6d 20 | 74 68 61 74 20 68 61 64 | system |that had|
|00000f30| 20 61 63 74 69 76 69 74 | 79 3a 0a 09 31 29 20 70 | activit|y:..1) p|
|00000f40| 72 69 6e 74 20 74 68 65 | 20 6e 61 6d 65 20 61 6e |rint the| name an|
|00000f50| 64 20 6d 69 6e 75 74 65 | 73 20 61 6e 64 20 63 6f |d minute|s and co|
|00000f60| 73 74 0a 09 32 29 20 6b | 65 65 70 20 74 6f 74 61 |st..2) k|eep tota|
|00000f70| 6c 20 6f 66 20 6d 69 6e | 75 74 65 73 20 75 73 65 |l of min|utes use|
|00000f80| 64 0a 09 33 29 20 6b 65 | 65 70 20 74 6f 74 61 6c |d..3) ke|ep total|
|00000f90| 20 6f 66 20 63 65 6e 74 | 73 20 75 73 65 64 0a 20 | of cent|s used. |
|00000fa0| 20 20 20 2a 2f 0a 20 20 | 20 20 74 6f 74 61 6c 20 | */. | total |
|00000fb0| 3d 20 30 4c 3b 0a 20 20 | 20 20 74 6f 74 5f 6d 69 |= 0L;. | tot_mi|
|00000fc0| 6e 73 20 3d 20 30 4c 3b | 0a 20 20 20 20 28 76 6f |ns = 0L;|. (vo|
|00000fd0| 69 64 29 20 70 72 69 6e | 74 66 20 28 22 5c 6e 53 |id) prin|tf ("\nS|
|00000fe0| 79 73 74 65 6d 20 20 20 | 20 20 20 4d 69 6e 73 20 |ystem | Mins |
|00000ff0| 20 20 20 20 20 20 43 6f | 73 74 5c 6e 22 29 3b 0a | Co|st\n");.|
|00001000| 20 20 20 20 66 6f 72 20 | 28 63 5f 70 74 72 20 3d | for |(c_ptr =|
|00001010| 20 73 79 73 74 65 6d 5f | 63 6f 73 74 73 3b 20 63 | system_|costs; c|
|00001020| 5f 70 74 72 20 3c 20 26 | 73 79 73 74 65 6d 5f 63 |_ptr < &|system_c|
|00001030| 6f 73 74 73 5b 73 79 73 | 74 65 6d 73 5d 3b 20 63 |osts[sys|tems]; c|
|00001040| 5f 70 74 72 2b 2b 29 20 | 7b 0a 09 69 66 20 28 63 |_ptr++) |{..if (c|
|00001050| 5f 70 74 72 2d 3e 75 73 | 65 64 29 20 7b 0a 09 20 |_ptr->us|ed) {.. |
|00001060| 20 20 20 28 76 6f 69 64 | 29 20 70 72 69 6e 74 66 | (void|) printf|
|00001070| 20 28 22 25 2d 31 30 73 | 20 25 35 6c 64 20 20 20 | ("%-10s| %5ld |
|00001080| 20 24 25 33 6c 64 2e 25 | 2e 32 6c 64 5c 6e 22 2c | $%3ld.%|.2ld\n",|
|00001090| 20 63 5f 70 74 72 2d 3e | 73 79 73 74 65 6d 2c 20 | c_ptr->|system, |
|000010a0| 0a 09 09 63 5f 70 74 72 | 2d 3e 6d 69 6e 75 74 65 |...c_ptr|->minute|
|000010b0| 73 2c 20 63 5f 70 74 72 | 2d 3e 74 6f 74 5f 63 6f |s, c_ptr|->tot_co|
|000010c0| 73 74 2f 31 30 30 4c 2c | 20 63 5f 70 74 72 2d 3e |st/100L,| c_ptr->|
|000010d0| 74 6f 74 5f 63 6f 73 74 | 25 31 30 30 4c 29 3b 0a |tot_cost|%100L);.|
|000010e0| 09 20 20 20 20 74 6f 74 | 61 6c 20 2b 3d 20 63 5f |. tot|al += c_|
|000010f0| 70 74 72 2d 3e 74 6f 74 | 5f 63 6f 73 74 3b 0a 09 |ptr->tot|_cost;..|
|00001100| 20 20 20 20 74 6f 74 5f | 6d 69 6e 73 20 2b 3d 20 | tot_|mins += |
|00001110| 63 5f 70 74 72 2d 3e 6d | 69 6e 75 74 65 73 3b 0a |c_ptr->m|inutes;.|
|00001120| 09 7d 0a 20 20 20 20 7d | 0a 20 20 20 20 28 76 6f |.}. }|. (vo|
|00001130| 69 64 29 20 70 72 69 6e | 74 66 20 28 22 5c 6e 54 |id) prin|tf ("\nT|
|00001140| 4f 54 41 4c 20 20 20 20 | 20 20 25 35 6c 64 20 20 |OTAL | %5ld |
|00001150| 20 20 24 25 33 6c 64 2e | 25 2e 32 6c 64 5c 6e 22 | $%3ld.|%.2ld\n"|
|00001160| 2c 20 0a 09 74 6f 74 5f | 6d 69 6e 73 2c 20 74 6f |, ..tot_|mins, to|
|00001170| 74 61 6c 2f 31 30 30 4c | 2c 20 74 6f 74 61 6c 25 |tal/100L|, total%|
|00001180| 31 30 30 4c 29 3b 0a 20 | 20 20 20 72 65 74 75 72 |100L);. | retur|
|00001190| 6e 20 28 30 29 3b 0a 7d | 0a 09 0a 0a 69 6e 74 20 |n (0);.}|....int |
|000011a0| 6c 6f 6f 6b 66 6f 72 28 | 73 79 73 29 0a 20 20 20 |lookfor(|sys). |
|000011b0| 20 63 68 61 72 20 2a 73 | 79 73 3b 0a 7b 0a 20 20 | char *s|ys;.{. |
|000011c0| 20 20 69 6e 74 20 69 3b | 0a 0a 20 20 20 20 66 6f | int i;|.. fo|
|000011d0| 72 20 28 69 20 3d 20 30 | 3b 20 69 20 3c 20 73 79 |r (i = 0|; i < sy|
|000011e0| 73 74 65 6d 73 3b 20 69 | 2b 2b 29 20 7b 0a 09 69 |stems; i|++) {..i|
|000011f0| 66 20 28 21 73 74 72 63 | 6d 70 20 28 73 79 73 2c |f (!strc|mp (sys,|
|00001200| 20 73 79 73 74 65 6d 5f | 63 6f 73 74 73 5b 69 5d | system_|costs[i]|
|00001210| 2e 73 79 73 74 65 6d 29 | 29 0a 09 20 20 20 20 72 |.system)|).. r|
|00001220| 65 74 75 72 6e 28 69 29 | 3b 0a 20 20 20 20 7d 0a |eturn(i)|;. }.|
|00001230| 20 20 20 20 72 65 74 75 | 72 6e 20 28 2d 31 29 3b | retu|rn (-1);|
|00001240| 20 2f 2a 20 49 6e 64 69 | 63 61 74 65 20 73 79 73 | /* Indi|cate sys|
|00001250| 74 65 6d 20 6e 6f 74 20 | 66 6f 75 6e 64 20 2a 2f |tem not |found */|
|00001260| 0a 7d 0a 53 48 41 52 5f | 45 4f 46 0a 66 69 0a 69 |.}.SHAR_|EOF.fi.i|
|00001270| 66 20 74 65 73 74 20 2d | 66 20 27 73 63 61 6e 5f |f test -|f 'scan_|
|00001280| 63 6f 73 74 2e 63 27 0a | 74 68 65 6e 0a 09 65 63 |cost.c'.|then..ec|
|00001290| 68 6f 20 73 68 61 72 3a | 20 22 77 69 6c 6c 20 6e |ho shar:| "will n|
|000012a0| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|000012b0| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 27 73 63 61 |isting f|ile 'sca|
|000012c0| 6e 5f 63 6f 73 74 2e 63 | 27 22 0a 65 6c 73 65 0a |n_cost.c|'".else.|
|000012d0| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|000012e0| 20 3e 20 27 73 63 61 6e | 5f 63 6f 73 74 2e 63 27 | > 'scan|_cost.c'|
|000012f0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 69 6f |.#includ|e <stdio|
|00001300| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |.h>.#inc|lude <st|
|00001310| 72 69 6e 67 2e 68 3e 0a | 0a 23 64 65 66 69 6e 65 |ring.h>.|.#define|
|00001320| 20 50 41 52 4d 53 5a 20 | 32 30 30 0a 23 64 65 66 | PARMSZ |200.#def|
|00001330| 69 6e 65 20 44 41 59 5f | 54 49 4d 45 28 68 2c 6d |ine DAY_|TIME(h,m|
|00001340| 2c 73 29 09 28 28 28 6c | 6f 6e 67 29 68 2a 36 30 |,s).(((l|ong)h*60|
|00001350| 4c 2b 28 6c 6f 6e 67 29 | 6d 29 2a 36 30 4c 2b 28 |L+(long)|m)*60L+(|
|00001360| 6c 6f 6e 67 29 73 29 0a | 23 64 65 66 69 6e 65 20 |long)s).|#define |
|00001370| 4d 49 4e 53 5f 50 45 52 | 5f 44 41 59 09 28 32 34 |MINS_PER|_DAY.(24|
|00001380| 4c 2a 36 30 4c 29 0a 0a | 63 68 61 72 20 62 75 66 |L*60L)..|char buf|
|00001390| 66 65 72 5b 32 30 30 5d | 3b 0a 0a 46 49 4c 45 20 |fer[200]|;..FILE |
|000013a0| 2a 66 6f 70 65 6e 28 29 | 3b 0a 69 6e 74 20 73 63 |*fopen()|;.int sc|
|000013b0| 2c 20 73 73 63 61 6e 66 | 28 29 3b 0a 63 68 61 72 |, sscanf|();.char|
|000013c0| 20 2a 66 67 65 74 73 28 | 29 3b 0a 63 68 61 72 20 | *fgets(|);.char |
|000013d0| 70 61 72 6d 31 5b 50 41 | 52 4d 53 5a 5d 2c 20 70 |parm1[PA|RMSZ], p|
|000013e0| 61 72 6d 32 5b 50 41 52 | 4d 53 5a 5d 2c 20 70 61 |arm2[PAR|MSZ], pa|
|000013f0| 72 6d 33 5b 50 41 52 4d | 53 5a 5d 2c 0a 20 20 20 |rm3[PARM|SZ],. |
|00001400| 20 20 70 61 72 6d 34 5b | 50 41 52 4d 53 5a 5d 2c | parm4[|PARMSZ],|
|00001410| 20 70 61 72 6d 35 5b 50 | 41 52 4d 53 5a 5d 2c 20 | parm5[P|ARMSZ], |
|00001420| 70 61 72 6d 36 5b 50 41 | 52 4d 53 5a 5d 3b 0a 63 |parm6[PA|RMSZ];.c|
|00001430| 68 61 72 20 73 74 61 72 | 74 5f 74 69 6d 65 5b 50 |har star|t_time[P|
|00001440| 41 52 4d 53 5a 5d 3b 0a | 0a 0a 69 6e 74 20 6d 61 |ARMSZ];.|..int ma|
|00001450| 69 6e 28 29 20 7b 0a 0a | 20 20 20 20 69 6e 74 20 |in() {..| int |
|00001460| 72 75 6e 6e 69 6e 67 5f | 66 6c 61 67 20 3d 20 30 |running_|flag = 0|
|00001470| 3b 09 2f 2a 20 69 6e 64 | 69 63 61 74 65 73 20 77 |;./* ind|icates w|
|00001480| 68 65 74 68 65 72 20 61 | 20 73 65 73 73 69 6f 6e |hether a| session|
|00001490| 20 69 73 20 6f 70 65 6e | 20 2a 2f 0a 0a 20 20 20 | is open| */.. |
|000014a0| 20 2f 2a 0a 09 46 6f 72 | 20 65 61 63 68 20 72 65 | /*..For| each re|
|000014b0| 63 6f 72 64 20 6f 66 20 | 73 74 61 6e 64 61 72 64 |cord of |standard|
|000014c0| 20 69 6e 70 75 74 3a 0a | 0a 09 31 29 20 52 65 61 | input:.|..1) Rea|
|000014d0| 64 20 74 68 65 20 66 69 | 65 6c 64 73 0a 09 32 29 |d the fi|elds..2)|
|000014e0| 20 69 66 20 74 68 65 20 | 34 74 68 20 66 69 65 6c | if the |4th fiel|
|000014f0| 64 20 69 73 20 53 55 43 | 43 45 45 44 45 44 2c 20 |d is SUC|CEEDED, |
|00001500| 73 74 61 72 74 20 61 20 | 73 65 73 73 69 6f 6e 0a |start a |session.|
|00001510| 09 20 20 20 20 2d 20 72 | 65 6d 65 6d 62 65 72 20 |. - r|emember |
|00001520| 74 68 65 20 74 69 6d 65 | 20 66 6f 72 20 6c 61 74 |the time| for lat|
|00001530| 65 72 0a 09 33 29 20 69 | 66 20 74 68 65 20 34 74 |er..3) i|f the 4t|
|00001540| 68 20 66 69 6c 65 20 69 | 73 20 4f 4b 20 61 6e 64 |h file i|s OK and|
|00001550| 20 74 68 65 20 35 74 68 | 20 69 73 20 28 63 6f 6e | the 5th| is (con|
|00001560| 76 65 72 73 61 74 69 6f | 6e 2c 20 66 69 6e 69 73 |versatio|n, finis|
|00001570| 68 20 61 20 73 65 73 73 | 69 6f 6e 0a 09 34 29 20 |h a sess|ion..4) |
|00001580| 69 66 20 74 68 65 20 34 | 74 68 20 66 69 6c 65 20 |if the 4|th file |
|00001590| 69 73 20 4c 4f 47 49 4e | 20 61 6e 64 20 74 68 65 |is LOGIN| and the|
|000015a0| 20 35 74 68 20 69 73 20 | 46 41 49 4c 45 44 20 66 | 5th is |FAILED f|
|000015b0| 69 6e 69 73 68 20 61 20 | 73 65 73 73 69 6f 6e 0a |inish a |session.|
|000015c0| 20 20 20 20 2a 2f 0a 20 | 20 20 20 77 68 69 6c 65 | */. | while|
|000015d0| 20 28 66 67 65 74 73 28 | 62 75 66 66 65 72 2c 28 | (fgets(|buffer,(|
|000015e0| 69 6e 74 29 73 69 7a 65 | 6f 66 28 62 75 66 66 65 |int)size|of(buffe|
|000015f0| 72 29 2c 73 74 64 69 6e | 29 29 20 7b 0a 0a 09 73 |r),stdin|)) {...s|
|00001600| 63 20 3d 20 73 73 63 61 | 6e 66 28 62 75 66 66 65 |c = ssca|nf(buffe|
|00001610| 72 2c 22 25 73 25 73 25 | 73 25 73 25 73 25 73 22 |r,"%s%s%|s%s%s%s"|
|00001620| 2c 0a 09 20 20 20 20 70 | 61 72 6d 31 2c 20 70 61 |,.. p|arm1, pa|
|00001630| 72 6d 32 2c 20 70 61 72 | 6d 33 2c 20 70 61 72 6d |rm2, par|m3, parm|
|00001640| 34 2c 20 70 61 72 6d 35 | 2c 20 70 61 72 6d 36 29 |4, parm5|, parm6)|
|00001650| 3b 0a 0a 09 69 66 20 28 | 73 63 20 3e 3d 20 35 29 |;...if (|sc >= 5)|
|00001660| 20 7b 0a 0a 09 20 20 20 | 20 69 66 20 28 21 73 74 | {... | if (!st|
|00001670| 72 63 6d 70 28 70 61 72 | 6d 34 2c 22 53 55 43 43 |rcmp(par|m4,"SUCC|
|00001680| 45 45 44 45 44 22 29 29 | 20 7b 0a 09 09 69 66 20 |EEDED"))| {...if |
|00001690| 28 72 75 6e 6e 69 6e 67 | 5f 66 6c 61 67 29 0a 09 |(running|_flag)..|
|000016a0| 09 20 20 20 20 28 76 6f | 69 64 29 66 70 72 69 6e |. (vo|id)fprin|
|000016b0| 74 66 20 28 73 74 64 65 | 72 72 2c 20 22 44 61 6e |tf (stde|rr, "Dan|
|000016c0| 67 6c 69 6e 67 20 6f 70 | 65 6e 20 61 74 20 25 73 |gling op|en at %s|
|000016d0| 5c 6e 22 2c 20 73 74 61 | 72 74 5f 74 69 6d 65 29 |\n", sta|rt_time)|
|000016e0| 3b 0a 09 09 28 76 6f 69 | 64 29 73 74 72 63 70 79 |;...(voi|d)strcpy|
|000016f0| 20 28 73 74 61 72 74 5f | 74 69 6d 65 2c 20 70 61 | (start_|time, pa|
|00001700| 72 6d 33 29 3b 0a 09 09 | 72 75 6e 6e 69 6e 67 5f |rm3);...|running_|
|00001710| 66 6c 61 67 20 3d 20 31 | 3b 0a 09 20 20 20 20 7d |flag = 1|;.. }|
|00001720| 0a 0a 09 20 20 20 20 69 | 66 20 28 28 21 73 74 72 |... i|f ((!str|
|00001730| 63 6d 70 28 70 61 72 6d | 34 2c 22 4f 4b 22 29 20 |cmp(parm|4,"OK") |
|00001740| 26 26 20 21 73 74 72 63 | 6d 70 28 70 61 72 6d 35 |&& !strc|mp(parm5|
|00001750| 2c 22 28 63 6f 6e 76 65 | 72 73 61 74 69 6f 6e 22 |,"(conve|rsation"|
|00001760| 29 29 0a 09 20 20 20 20 | 7c 7c 20 28 21 73 74 72 |)).. ||| (!str|
|00001770| 63 6d 70 28 70 61 72 6d | 34 2c 22 4c 4f 47 49 4e |cmp(parm|4,"LOGIN|
|00001780| 22 29 20 26 26 20 21 73 | 74 72 63 6d 70 28 70 61 |") && !s|trcmp(pa|
|00001790| 72 6d 35 2c 22 46 41 49 | 4c 45 44 22 29 29 0a 09 |rm5,"FAI|LED"))..|
|000017a0| 20 20 20 20 7c 7c 20 28 | 21 73 74 72 63 6d 70 28 | || (|!strcmp(|
|000017b0| 70 61 72 6d 34 2c 22 46 | 41 49 4c 45 44 22 29 20 |parm4,"F|AILED") |
|000017c0| 26 26 20 21 73 74 72 63 | 6d 70 28 70 61 72 6d 35 |&& !strc|mp(parm5|
|000017d0| 2c 22 28 63 6f 6e 76 65 | 72 73 61 74 69 6f 6e 22 |,"(conve|rsation"|
|000017e0| 29 29 0a 09 20 20 20 20 | 7c 7c 20 28 21 73 74 72 |)).. ||| (!str|
|000017f0| 63 6d 70 28 70 61 72 6d | 34 2c 22 48 41 4e 44 53 |cmp(parm|4,"HANDS|
|00001800| 48 41 4b 45 22 29 20 26 | 26 20 21 73 74 72 63 6d |HAKE") &|& !strcm|
|00001810| 70 28 70 61 72 6d 35 2c | 22 46 41 49 4c 45 44 22 |p(parm5,|"FAILED"|
|00001820| 29 29 29 20 7b 0a 09 09 | 69 66 20 28 72 75 6e 6e |))) {...|if (runn|
|00001830| 69 6e 67 5f 66 6c 61 67 | 29 20 7b 0a 09 09 20 20 |ing_flag|) {... |
|00001840| 20 20 74 61 6c 6b 5f 65 | 6e 64 20 28 70 61 72 6d | talk_e|nd (parm|
|00001850| 32 2c 20 73 74 61 72 74 | 5f 74 69 6d 65 2c 20 70 |2, start|_time, p|
|00001860| 61 72 6d 33 29 3b 0a 09 | 09 20 20 20 20 72 75 6e |arm3);..|. run|
|00001870| 6e 69 6e 67 5f 66 6c 61 | 67 20 3d 20 30 3b 0a 09 |ning_fla|g = 0;..|
|00001880| 09 7d 0a 09 20 20 20 20 | 7d 0a 0a 09 20 20 20 20 |.}.. |}... |
|00001890| 69 66 20 28 28 21 73 74 | 72 63 6d 70 28 70 61 72 |if ((!st|rcmp(par|
|000018a0| 6d 35 2c 22 46 41 49 4c | 45 44 22 29 20 26 26 20 |m5,"FAIL|ED") && |
|000018b0| 21 73 74 72 63 6d 70 28 | 70 61 72 6d 36 2c 22 28 |!strcmp(|parm6,"(|
|000018c0| 63 6f 6e 76 65 72 73 61 | 74 69 6f 6e 22 29 29 29 |conversa|tion")))|
|000018d0| 20 7b 0a 09 09 69 66 20 | 28 72 75 6e 6e 69 6e 67 | {...if |(running|
|000018e0| 5f 66 6c 61 67 29 20 7b | 0a 09 09 20 20 20 20 74 |_flag) {|... t|
|000018f0| 61 6c 6b 5f 65 6e 64 20 | 28 70 61 72 6d 32 2c 20 |alk_end |(parm2, |
|00001900| 73 74 61 72 74 5f 74 69 | 6d 65 2c 20 70 61 72 6d |start_ti|me, parm|
|00001910| 34 29 3b 0a 09 09 20 20 | 20 20 72 75 6e 6e 69 6e |4);... | runnin|
|00001920| 67 5f 66 6c 61 67 20 3d | 20 30 3b 0a 09 09 7d 0a |g_flag =| 0;...}.|
|00001930| 09 20 20 20 20 7d 0a 09 | 7d 0a 20 20 20 20 7d 0a |. }..|}. }.|
|00001940| 20 20 20 20 72 65 74 75 | 72 6e 20 28 30 29 3b 0a | retu|rn (0);.|
|00001950| 7d 0a 0a 6c 6f 6e 67 20 | 74 69 6d 65 5f 73 65 63 |}..long |time_sec|
|00001960| 73 28 29 3b 0a 0a 2f 2a | 0a 20 20 20 20 74 61 6c |s();../*|. tal|
|00001970| 6b 5f 65 6e 64 20 2d 20 | 73 75 62 74 72 61 63 74 |k_end - |subtract|
|00001980| 20 74 69 6d 65 73 20 61 | 6e 64 20 6f 75 74 70 75 | times a|nd outpu|
|00001990| 74 20 72 65 63 6f 72 64 | 0a 2a 2f 0a 74 61 6c 6b |t record|.*/.talk|
|000019a0| 5f 65 6e 64 20 28 73 79 | 73 74 65 6d 2c 20 66 72 |_end (sy|stem, fr|
|000019b0| 6f 6d 2c 20 74 6f 29 0a | 20 20 20 20 63 68 61 72 |om, to).| char|
|000019c0| 20 2a 73 79 73 74 65 6d | 2c 20 2a 66 72 6f 6d 2c | *system|, *from,|
|000019d0| 20 2a 74 6f 3b 0a 7b 0a | 20 20 20 20 6c 6f 6e 67 | *to;.{.| long|
|000019e0| 20 66 72 6f 6d 5f 73 65 | 63 73 2c 20 74 6f 5f 73 | from_se|cs, to_s|
|000019f0| 65 63 73 2c 20 64 69 66 | 66 5f 73 65 63 73 3b 0a |ecs, dif|f_secs;.|
|00001a00| 20 20 20 20 6c 6f 6e 67 | 20 64 69 66 66 5f 6d 69 | long| diff_mi|
|00001a10| 6e 3b 0a 0a 20 20 20 20 | 66 72 6f 6d 5f 73 65 63 |n;.. |from_sec|
|00001a20| 73 20 3d 20 74 69 6d 65 | 5f 73 65 63 73 20 28 66 |s = time|_secs (f|
|00001a30| 72 6f 6d 29 3b 0a 20 20 | 20 20 69 66 20 28 66 72 |rom);. | if (fr|
|00001a40| 6f 6d 5f 73 65 63 73 20 | 3d 3d 20 2d 31 4c 29 0a |om_secs |== -1L).|
|00001a50| 09 72 65 74 75 72 6e 3b | 0a 20 20 20 20 74 6f 5f |.return;|. to_|
|00001a60| 73 65 63 73 20 3d 20 74 | 69 6d 65 5f 73 65 63 73 |secs = t|ime_secs|
|00001a70| 20 28 74 6f 29 3b 0a 20 | 20 20 20 69 66 20 28 74 | (to);. | if (t|
|00001a80| 6f 5f 73 65 63 73 20 3d | 3d 20 2d 31 4c 29 0a 09 |o_secs =|= -1L)..|
|00001a90| 72 65 74 75 72 6e 3b 0a | 20 20 20 20 64 69 66 66 |return;.| diff|
|00001aa0| 5f 73 65 63 73 20 3d 20 | 74 6f 5f 73 65 63 73 2d |_secs = |to_secs-|
|00001ab0| 66 72 6f 6d 5f 73 65 63 | 73 3b 0a 20 20 20 20 64 |from_sec|s;. d|
|00001ac0| 69 66 66 5f 6d 69 6e 20 | 3d 20 28 64 69 66 66 5f |iff_min |= (diff_|
|00001ad0| 73 65 63 73 20 2b 20 35 | 39 4c 29 20 2f 20 36 30 |secs + 5|9L) / 60|
|00001ae0| 4c 3b 0a 20 20 20 20 69 | 66 20 28 64 69 66 66 5f |L;. i|f (diff_|
|00001af0| 6d 69 6e 20 3c 20 30 29 | 0a 09 64 69 66 66 5f 6d |min < 0)|..diff_m|
|00001b00| 69 6e 20 2b 3d 20 4d 49 | 4e 53 5f 50 45 52 5f 44 |in += MI|NS_PER_D|
|00001b10| 41 59 3b 0a 20 20 20 20 | 28 76 6f 69 64 29 70 72 |AY;. |(void)pr|
|00001b20| 69 6e 74 66 20 28 22 25 | 73 20 25 73 20 25 6c 64 |intf ("%|s %s %ld|
|00001b30| 5c 6e 22 2c 20 73 79 73 | 74 65 6d 2c 20 66 72 6f |\n", sys|tem, fro|
|00001b40| 6d 2c 20 64 69 66 66 5f | 6d 69 6e 29 3b 0a 7d 0a |m, diff_|min);.}.|
|00001b50| 20 20 20 20 0a 0a 2f 2a | 0a 20 20 20 20 74 69 6d | ../*|. tim|
|00001b60| 65 5f 73 65 63 73 20 2d | 20 63 6f 6e 76 65 72 74 |e_secs -| convert|
|00001b70| 20 61 20 73 74 72 69 6e | 67 20 74 6f 20 73 65 63 | a strin|g to sec|
|00001b80| 6f 6e 64 73 20 73 69 6e | 63 65 20 6d 69 64 6e 69 |onds sin|ce midni|
|00001b90| 67 68 74 0a 2a 2f 0a 6c | 6f 6e 67 20 74 69 6d 65 |ght.*/.l|ong time|
|00001ba0| 5f 73 65 63 73 20 28 74 | 69 6d 65 5f 73 74 72 69 |_secs (t|ime_stri|
|00001bb0| 6e 67 29 0a 20 20 20 20 | 63 68 61 72 20 2a 74 69 |ng). |char *ti|
|00001bc0| 6d 65 5f 73 74 72 69 6e | 67 3b 0a 7b 0a 20 20 20 |me_strin|g;.{. |
|00001bd0| 20 69 6e 74 20 68 2c 6d | 2c 73 3b 0a 0a 20 20 20 | int h,m|,s;.. |
|00001be0| 20 69 66 20 28 73 73 63 | 61 6e 66 28 74 69 6d 65 | if (ssc|anf(time|
|00001bf0| 5f 73 74 72 69 6e 67 2c | 20 22 28 25 2a 64 2f 25 |_string,| "(%*d/%|
|00001c00| 2a 64 2d 25 64 3a 25 64 | 3a 25 64 22 2c 20 26 68 |*d-%d:%d|:%d", &h|
|00001c10| 2c 20 26 6d 2c 20 26 73 | 29 20 3d 3d 20 33 29 20 |, &m, &s|) == 3) |
|00001c20| 7b 0a 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e |{. | return|
|00001c30| 20 28 44 41 59 5f 54 49 | 4d 45 20 28 68 2c 6d 2c | (DAY_TI|ME (h,m,|
|00001c40| 73 29 29 3b 0a 20 20 20 | 20 7d 20 65 6c 73 65 20 |s));. | } else |
|00001c50| 7b 0a 09 28 76 6f 69 64 | 29 66 70 72 69 6e 74 66 |{..(void|)fprintf|
|00001c60| 28 73 74 64 65 72 72 2c | 20 22 45 72 72 6f 72 20 |(stderr,| "Error |
|00001c70| 63 6f 6e 76 65 72 74 69 | 6e 67 20 74 69 6d 65 20 |converti|ng time |
|00001c80| 73 74 72 69 6e 67 20 25 | 73 2f 6e 22 2c 20 74 69 |string %|s/n", ti|
|00001c90| 6d 65 5f 73 74 72 69 6e | 67 29 3b 0a 09 72 65 74 |me_strin|g);..ret|
|00001ca0| 75 72 6e 20 28 2d 31 4c | 29 3b 0a 20 20 20 20 7d |urn (-1L|);. }|
|00001cb0| 0a 7d 0a 53 48 41 52 5f | 45 4f 46 0a 66 69 0a 69 |.}.SHAR_|EOF.fi.i|
|00001cc0| 66 20 74 65 73 74 20 2d | 66 20 27 63 6f 73 74 73 |f test -|f 'costs|
|00001cd0| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|00001ce0| 72 3a 20 22 77 69 6c 6c | 20 6e 6f 74 20 6f 76 65 |r: "will| not ove|
|00001cf0| 72 2d 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |r-write |existing|
|00001d00| 20 66 69 6c 65 20 27 63 | 6f 73 74 73 27 22 0a 65 | file 'c|osts'".e|
|00001d10| 6c 73 65 0a 63 61 74 20 | 3c 3c 20 5c 53 48 41 52 |lse.cat |<< \SHAR|
|00001d20| 5f 45 4f 46 20 3e 20 27 | 63 6f 73 74 73 27 0a 23 |_EOF > '|costs'.#|
|00001d30| 20 63 6f 73 74 73 0a 23 | 0a 23 20 54 68 69 73 20 | costs.#|.# This |
|00001d40| 66 69 6c 65 20 68 61 73 | 20 63 6f 73 74 73 20 66 |file has| costs f|
|00001d50| 6f 72 20 65 61 63 68 20 | 75 75 63 70 20 64 65 73 |or each |uucp des|
|00001d60| 74 69 6e 61 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |tination| of the |
|00001d70| 66 6f 72 6d 0a 23 0a 23 | 09 73 79 73 74 65 6d 09 |form.#.#|.system.|
|00001d80| 66 69 72 73 74 09 61 64 | 64 74 6c 09 6d 69 6e 69 |first.ad|dtl.mini|
|00001d90| 6d 75 6d 0a 23 0a 23 20 | 77 68 65 72 65 0a 23 09 |mum.#.# |where.#.|
|00001da0| 73 79 73 74 65 6d 09 75 | 75 63 70 20 6e 6f 64 65 |system.u|ucp node|
|00001db0| 20 6e 61 6d 65 20 66 6f | 72 20 74 68 65 20 73 79 | name fo|r the sy|
|00001dc0| 73 74 65 6d 2c 0a 23 09 | 66 69 72 73 74 09 63 6f |stem,.#.|first.co|
|00001dd0| 73 74 20 6f 66 20 74 68 | 65 20 66 69 72 73 74 20 |st of th|e first |
|00001de0| 6d 69 6e 75 74 65 20 28 | 69 6e 20 63 65 6e 74 73 |minute (|in cents|
|00001df0| 29 2c 0a 23 09 61 64 64 | 74 6c 09 63 6f 73 74 20 |),.#.add|tl.cost |
|00001e00| 66 6f 72 20 61 64 64 69 | 74 69 6f 6e 61 6c 20 6d |for addi|tional m|
|00001e10| 69 6e 75 74 65 73 20 28 | 69 6e 20 63 65 6e 74 73 |inutes (|in cents|
|00001e20| 29 2c 20 61 6e 64 0a 23 | 09 6d 69 6e 69 6d 75 6d |), and.#|.minimum|
|00001e30| 09 6d 69 6e 69 6d 75 6d | 20 63 6f 73 74 20 28 69 |.minimum| cost (i|
|00001e40| 6e 20 63 65 6e 74 73 29 | 2e 0a 23 0a 23 20 73 79 |n cents)|..#.# sy|
|00001e50| 73 74 65 6d 09 66 69 72 | 73 74 09 61 64 64 74 6c |stem.fir|st.addtl|
|00001e60| 09 6d 69 6e 69 6d 75 6d | 0a 23 0a 63 73 64 5f 76 |.minimum|.#.csd_v|
|00001e70| 09 09 31 31 09 35 09 30 | 0a 67 6f 64 66 72 65 09 |..11.5.0|.godfre.|
|00001e80| 09 30 09 30 09 30 0a 69 | 6e 74 65 6c 09 09 30 09 |.0.0.0.i|ntel..0.|
|00001e90| 30 09 30 0a 6a 63 61 09 | 09 30 09 30 09 30 0a 6f |0.0.jca.|.0.0.0.o|
|00001ea0| 6d 65 6e 09 09 30 09 30 | 09 30 0a 50 63 72 61 74 |men..0.0|.0.Pcrat|
|00001eb0| 09 09 31 35 09 31 31 09 | 30 0a 70 63 72 61 74 09 |..15.11.|0.pcrat.|
|00001ec0| 09 30 09 30 09 30 0a 72 | 69 76 65 72 61 09 09 30 |.0.0.0.r|ivera..0|
|00001ed0| 09 30 09 30 0a 75 75 6e | 65 74 09 09 35 09 35 09 |.0.0.uun|et..5.5.|
|00001ee0| 31 35 0a 7a 65 75 73 09 | 09 31 35 09 31 31 09 30 |15.zeus.|.15.11.0|
|00001ef0| 0a 53 48 41 52 5f 45 4f | 46 0a 66 69 0a 69 66 20 |.SHAR_EO|F.fi.if |
|00001f00| 74 65 73 74 20 2d 66 20 | 27 52 45 41 44 4d 45 27 |test -f |'README'|
|00001f10| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00001f20| 3a 20 22 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |: "will |not over|
|00001f30| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00001f40| 66 69 6c 65 20 27 52 45 | 41 44 4d 45 27 22 0a 65 |file 'RE|ADME'".e|
|00001f50| 6c 73 65 0a 63 61 74 20 | 3c 3c 20 5c 53 48 41 52 |lse.cat |<< \SHAR|
|00001f60| 5f 45 4f 46 20 3e 20 27 | 52 45 41 44 4d 45 27 0a |_EOF > '|README'.|
|00001f70| 54 68 69 73 20 69 73 20 | 61 20 70 61 63 6b 61 67 |This is |a packag|
|00001f80| 65 20 77 68 69 63 68 20 | 6c 65 74 73 20 79 6f 75 |e which |lets you|
|00001f90| 20 6b 65 65 70 20 6b 65 | 65 70 20 74 72 61 63 6b | keep ke|ep track|
|00001fa0| 20 6f 66 20 74 68 65 20 | 63 6f 73 74 73 20 69 6e | of the |costs in|
|00001fb0| 63 75 72 72 65 64 20 62 | 79 0a 75 75 63 70 2e 20 |curred b|y.uucp. |
|00001fc0| 20 49 74 20 70 72 6f 76 | 69 64 65 73 20 61 20 63 | It prov|ides a c|
|00001fd0| 6f 6d 6d 61 6e 64 20 28 | 75 75 63 6f 73 74 29 20 |ommand (|uucost) |
|00001fe0| 77 68 69 63 68 20 67 69 | 76 65 73 20 61 20 73 63 |which gi|ves a sc|
|00001ff0| 72 65 65 6e 20 64 69 73 | 70 6c 61 79 20 6f 66 20 |reen dis|play of |
|00002000| 74 68 65 0a 63 6f 73 74 | 73 20 69 6e 63 75 72 72 |the.cost|s incurr|
|00002010| 65 64 20 73 6f 20 66 61 | 72 20 74 68 69 73 20 6d |ed so fa|r this m|
|00002020| 6f 6e 74 68 20 61 6e 64 | 20 73 6f 20 66 61 72 20 |onth and| so far |
|00002030| 74 6f 64 61 79 2e 20 20 | 41 64 64 69 74 69 6f 6e |today. |Addition|
|00002040| 61 6c 6c 79 2c 20 74 68 | 65 72 65 20 69 73 0a 61 |ally, th|ere is.a|
|00002050| 20 73 63 72 69 70 74 20 | 77 68 69 63 68 20 69 73 | script |which is|
|00002060| 20 72 75 6e 20 65 76 65 | 72 79 20 6e 69 67 68 74 | run eve|ry night|
|00002070| 20 74 6f 20 63 61 70 74 | 75 72 65 20 74 6f 64 61 | to capt|ure toda|
|00002080| 79 27 73 20 64 61 74 61 | 2e 20 20 54 68 65 72 65 |y's data|. There|
|00002090| 20 69 73 20 61 6c 73 6f | 0a 61 20 73 63 72 69 70 | is also|.a scrip|
|000020a0| 74 20 74 6f 20 62 65 20 | 72 75 6e 20 65 76 65 72 |t to be |run ever|
|000020b0| 79 20 6d 6f 6e 74 68 20 | 77 68 69 63 68 20 73 65 |y month |which se|
|000020c0| 6e 64 73 20 6d 61 69 6c | 20 74 6f 20 74 68 65 20 |nds mail| to the |
|000020d0| 75 75 63 70 20 61 63 63 | 6f 75 6e 74 20 67 69 76 |uucp acc|ount giv|
|000020e0| 69 6e 67 20 0a 61 20 73 | 75 6d 6d 61 72 79 20 6f |ing .a s|ummary o|
|000020f0| 66 20 74 68 69 73 20 6d | 6f 6e 74 68 27 73 20 75 |f this m|onth's u|
|00002100| 73 61 67 65 2e 0a 0a 54 | 68 69 73 20 69 73 20 69 |sage...T|his is i|
|00002110| 6e 74 65 6e 64 65 64 20 | 66 6f 72 20 75 73 65 20 |ntended |for use |
|00002120| 77 69 74 68 20 48 44 42 | 20 75 75 63 70 2c 20 62 |with HDB| uucp, b|
|00002130| 75 74 20 63 6f 75 6c 64 | 20 62 65 20 61 6c 74 65 |ut could| be alte|
|00002140| 72 65 64 20 66 6f 72 20 | 6f 74 68 65 72 73 2e 20 |red for |others. |
|00002150| 20 0a 4d 6f 64 69 66 69 | 63 61 74 69 6f 6e 73 20 | .Modifi|cations |
|00002160| 66 6f 72 20 6c 69 6e 6b | 73 20 77 68 6f 73 65 20 |for link|s whose |
|00002170| 63 6f 73 74 73 20 76 61 | 72 79 20 64 65 70 65 6e |costs va|ry depen|
|00002180| 64 69 6e 67 20 6f 6e 20 | 74 68 65 20 74 69 6d 65 |ding on |the time|
|00002190| 20 6f 66 20 74 68 65 20 | 0a 63 6f 6e 6e 65 63 74 | of the |.connect|
|000021a0| 69 6f 6e 20 77 69 6c 6c | 20 70 72 6f 62 61 62 6c |ion will| probabl|
|000021b0| 79 20 62 65 20 6d 61 64 | 65 20 62 79 20 74 68 65 |y be mad|e by the|
|000021c0| 20 61 75 74 68 6f 72 20 | 69 6e 20 74 68 65 20 66 | author |in the f|
|000021d0| 75 74 75 72 65 2e 20 20 | 0a 0a 54 68 65 20 66 69 |uture. |..The fi|
|000021e0| 6c 65 73 20 61 6e 64 20 | 74 68 65 69 72 20 63 6f |les and |their co|
|000021f0| 6e 74 65 6e 74 73 20 61 | 72 65 20 61 73 20 66 6f |ntents a|re as fo|
|00002200| 6c 6c 6f 77 73 3a 0a 0a | 52 45 41 44 4d 45 09 09 |llows:..|README..|
|00002210| 54 68 69 73 20 66 69 6c | 65 2e 0a 4d 61 6b 65 66 |This fil|e..Makef|
|00002220| 69 6c 65 09 54 68 65 20 | 66 69 6c 65 20 75 73 65 |ile.The |file use|
|00002230| 64 20 74 6f 20 62 75 69 | 6c 64 20 74 68 65 20 70 |d to bui|ld the p|
|00002240| 61 63 6b 61 67 65 2e 0a | 63 6f 73 74 2e 6c 6f 67 |ackage..|cost.log|
|00002250| 09 41 20 6c 6f 67 20 66 | 69 6c 65 20 74 68 61 74 |.A log f|ile that|
|00002260| 20 77 69 6c 6c 20 62 65 | 20 63 72 65 61 74 65 64 | will be| created|
|00002270| 20 28 61 73 20 6e 75 6c | 6c 29 20 61 74 20 69 6e | (as nul|l) at in|
|00002280| 73 74 61 6c 6c 61 74 69 | 6f 6e 2e 0a 63 6f 73 74 |stallati|on..cost|
|00002290| 73 09 09 41 20 66 69 6c | 65 20 63 6f 6e 74 61 69 |s..A fil|e contai|
|000022a0| 6e 69 6e 67 20 74 68 65 | 20 63 6f 73 74 20 74 6f |ning the| cost to|
|000022b0| 20 6f 72 69 67 69 6e 61 | 74 65 20 61 20 63 6f 6e | origina|te a con|
|000022c0| 6e 65 63 74 69 6f 6e 20 | 74 6f 20 0a 09 09 65 61 |nection |to ...ea|
|000022d0| 63 68 20 73 69 74 65 20 | 79 6f 75 20 63 61 6c 6c |ch site |you call|
|000022e0| 2e 20 20 44 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |. Docum|entation|
|000022f0| 20 77 69 74 68 69 6e 20 | 74 68 65 20 66 69 6c 65 | within |the file|
|00002300| 20 64 65 73 63 72 69 62 | 65 0a 09 09 74 68 65 20 | describ|e...the |
|00002310| 66 6f 72 6d 61 74 2e 0a | 66 6f 72 6d 5f 63 6f 73 |format..|form_cos|
|00002320| 74 2e 63 09 46 6f 72 6d | 61 74 73 20 74 68 65 20 |t.c.Form|ats the |
|00002330| 6f 75 74 70 75 74 20 6f | 66 20 73 63 61 6e 5f 63 |output o|f scan_c|
|00002340| 6f 73 74 20 66 6f 72 20 | 68 75 6d 61 6e 20 72 65 |ost for |human re|
|00002350| 61 64 69 6e 67 2e 0a 73 | 63 61 6e 5f 63 6f 73 74 |ading..s|can_cost|
|00002360| 2e 63 09 53 63 61 6e 73 | 20 74 68 65 20 6f 75 74 |.c.Scans| the out|
|00002370| 70 75 74 20 6f 66 20 61 | 20 75 75 6c 6f 67 20 74 |put of a| uulog t|
|00002380| 6f 20 65 78 74 72 61 63 | 74 20 72 65 6c 65 76 61 |o extrac|t releva|
|00002390| 6e 74 20 69 6e 66 6f 2e | 0a 75 75 63 6f 73 74 09 |nt info.|.uucost.|
|000023a0| 09 41 20 73 63 72 69 70 | 74 20 66 69 6c 65 20 66 |.A scrip|t file f|
|000023b0| 6f 72 20 74 65 72 6d 69 | 6e 61 6c 20 64 69 73 70 |or termi|nal disp|
|000023c0| 6c 61 79 20 6f 66 20 63 | 75 72 72 65 6e 74 20 63 |lay of c|urrent c|
|000023d0| 6f 73 74 20 64 61 74 61 | 2e 0a 75 75 63 6f 73 74 |ost data|..uucost|
|000023e0| 2e 64 61 09 41 20 64 61 | 69 6c 79 20 73 63 72 69 |.da.A da|ily scri|
|000023f0| 70 74 20 74 6f 20 75 70 | 64 61 74 65 20 63 6f 73 |pt to up|date cos|
|00002400| 74 2e 6c 6f 67 2e 0a 75 | 75 63 6f 73 74 2e 6d 6f |t.log..u|ucost.mo|
|00002410| 09 41 20 6d 6f 6e 74 68 | 6c 79 20 73 63 72 69 70 |.A month|ly scrip|
|00002420| 74 20 74 6f 20 73 65 6e | 64 20 6d 61 69 6c 20 6f |t to sen|d mail o|
|00002430| 6e 20 70 72 65 76 69 6f | 75 73 20 6d 6f 6e 74 68 |n previo|us month|
|00002440| 27 73 20 75 73 61 67 65 | 2e 0a 0a 54 68 65 20 70 |'s usage|...The p|
|00002450| 61 63 6b 61 67 65 20 69 | 73 20 73 65 74 20 75 70 |ackage i|s set up|
|00002460| 20 74 6f 20 72 75 6e 20 | 69 6e 20 74 68 65 20 64 | to run |in the d|
|00002470| 69 72 65 63 74 6f 72 79 | 20 2f 75 73 72 2f 6c 69 |irectory| /usr/li|
|00002480| 62 2f 75 75 63 70 2f 75 | 75 63 6f 73 74 2e 0a 41 |b/uucp/u|ucost..A|
|00002490| 66 74 65 72 20 65 78 74 | 72 61 63 74 69 6e 67 20 |fter ext|racting |
|000024a0| 74 68 65 20 70 61 63 6b | 61 67 65 3a 0a 0a 31 29 |the pack|age:..1)|
|000024b0| 20 6d 61 6b 65 0a 32 29 | 20 6d 61 6b 65 20 69 6e | make.2)| make in|
|000024c0| 73 74 61 6c 6c 0a 33 29 | 20 65 64 69 74 20 63 6f |stall.3)| edit co|
|000024d0| 73 74 73 20 66 69 6c 65 | 2c 20 61 64 64 69 6e 67 |sts file|, adding|
|000024e0| 20 63 6f 73 74 73 20 66 | 6f 72 20 6d 61 63 68 69 | costs f|or machi|
|000024f0| 6e 65 73 20 79 6f 75 20 | 63 61 6c 6c 0a 34 29 20 |nes you |call.4) |
|00002500| 74 79 70 65 20 22 75 75 | 63 6f 73 74 22 2c 20 74 |type "uu|cost", t|
|00002510| 6f 20 76 65 72 69 66 79 | 20 70 72 6f 70 65 72 20 |o verify| proper |
|00002520| 6f 70 65 72 61 74 69 6f | 6e 0a 35 29 20 70 75 74 |operatio|n.5) put|
|00002530| 20 61 20 63 61 6c 6c 20 | 74 6f 20 74 68 65 20 73 | a call |to the s|
|00002540| 68 65 6c 6c 20 73 63 72 | 69 70 74 20 75 75 63 6f |hell scr|ipt uuco|
|00002550| 73 74 2e 64 61 20 61 74 | 20 74 68 65 20 62 65 67 |st.da at| the beg|
|00002560| 69 6e 6e 69 6e 67 20 6f | 66 20 75 75 64 65 6d 6f |inning o|f uudemo|
|00002570| 6e 2e 63 6c 65 61 6e 75 | 0a 36 29 20 61 64 64 20 |n.cleanu|.6) add |
|00002580| 61 20 63 72 6f 6e 20 65 | 6e 74 72 79 20 74 6f 20 |a cron e|ntry to |
|00002590| 72 75 6e 20 75 75 63 6f | 73 74 2e 6d 6f 20 6f 6e |run uuco|st.mo on|
|000025a0| 20 74 68 65 20 31 73 74 | 20 6f 66 20 74 68 65 20 | the 1st| of the |
|000025b0| 6d 6f 6e 74 68 2c 20 61 | 66 74 65 72 20 74 68 65 |month, a|fter the|
|000025c0| 20 0a 20 20 20 70 72 65 | 76 69 6f 75 73 20 6e 69 | . pre|vious ni|
|000025d0| 67 68 74 27 73 20 75 75 | 63 6c 65 61 6e 75 70 20 |ght's uu|cleanup |
|000025e0| 68 61 73 20 63 6f 6d 70 | 6c 65 74 65 64 0a 0a 49 |has comp|leted..I|
|000025f0| 66 20 79 6f 75 20 68 61 | 76 65 20 61 6e 79 20 70 |f you ha|ve any p|
|00002600| 72 6f 62 6c 65 6d 73 2c | 20 73 65 6e 64 20 6d 65 |roblems,| send me|
|00002610| 20 65 2d 6d 61 69 6c 2e | 0a 0a 0a 4a 61 63 6b 20 | e-mail.|...Jack |
|00002620| 42 6f 6e 6e 0a 53 6f 66 | 74 77 61 72 65 20 4c 61 |Bonn.Sof|tware La|
|00002630| 62 73 2c 20 4c 74 64 2e | 0a 73 65 69 73 6d 6f 21 |bs, Ltd.|.seismo!|
|00002640| 75 75 6e 65 74 21 73 77 | 6c 61 62 73 21 6a 61 63 |uunet!sw|labs!jac|
|00002650| 6b 0a 53 48 41 52 5f 45 | 4f 46 0a 66 69 0a 69 66 |k.SHAR_E|OF.fi.if|
|00002660| 20 74 65 73 74 20 2d 66 | 20 27 75 75 63 6f 73 74 | test -f| 'uucost|
|00002670| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|00002680| 72 3a 20 22 77 69 6c 6c | 20 6e 6f 74 20 6f 76 65 |r: "will| not ove|
|00002690| 72 2d 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |r-write |existing|
|000026a0| 20 66 69 6c 65 20 27 75 | 75 63 6f 73 74 27 22 0a | file 'u|ucost'".|
|000026b0| 65 6c 73 65 0a 63 61 74 | 20 3c 3c 20 5c 53 48 41 |else.cat| << \SHA|
|000026c0| 52 5f 45 4f 46 20 3e 20 | 27 75 75 63 6f 73 74 27 |R_EOF > |'uucost'|
|000026d0| 0a 23 21 20 2f 62 69 6e | 2f 73 68 0a 65 63 68 6f |.#! /bin|/sh.echo|
|000026e0| 0a 65 63 68 6f 20 46 6f | 72 20 4d 6f 6e 74 68 3a |.echo Fo|r Month:|
|000026f0| 0a 2f 75 73 72 2f 6c 69 | 62 2f 75 75 63 70 2f 75 |./usr/li|b/uucp/u|
|00002700| 75 63 6f 73 74 2f 66 6f | 72 6d 5f 63 6f 73 74 20 |ucost/fo|rm_cost |
|00002710| 3c 2f 75 73 72 2f 6c 69 | 62 2f 75 75 63 70 2f 75 |</usr/li|b/uucp/u|
|00002720| 75 63 6f 73 74 2f 63 6f | 73 74 2e 6c 6f 67 0a 65 |ucost/co|st.log.e|
|00002730| 63 68 6f 0a 65 63 68 6f | 20 54 6f 64 61 79 3a 0a |cho.echo| Today:.|
|00002740| 75 75 6c 6f 67 20 7c 20 | 2f 75 73 72 2f 6c 69 62 |uulog | |/usr/lib|
|00002750| 2f 75 75 63 70 2f 75 75 | 63 6f 73 74 2f 73 63 61 |/uucp/uu|cost/sca|
|00002760| 6e 5f 63 6f 73 74 20 7c | 20 2f 75 73 72 2f 6c 69 |n_cost || /usr/li|
|00002770| 62 2f 75 75 63 70 2f 75 | 75 63 6f 73 74 2f 66 6f |b/uucp/u|ucost/fo|
|00002780| 72 6d 5f 63 6f 73 74 0a | 65 63 68 6f 0a 53 48 41 |rm_cost.|echo.SHA|
|00002790| 52 5f 45 4f 46 0a 66 69 | 0a 69 66 20 74 65 73 74 |R_EOF.fi|.if test|
|000027a0| 20 2d 66 20 27 75 75 63 | 6f 73 74 2e 64 61 27 0a | -f 'uuc|ost.da'.|
|000027b0| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|000027c0| 20 22 77 69 6c 6c 20 6e | 6f 74 20 6f 76 65 72 2d | "will n|ot over-|
|000027d0| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 20 66 |write ex|isting f|
|000027e0| 69 6c 65 20 27 75 75 63 | 6f 73 74 2e 64 61 27 22 |ile 'uuc|ost.da'"|
|000027f0| 0a 65 6c 73 65 0a 63 61 | 74 20 3c 3c 20 5c 53 48 |.else.ca|t << \SH|
|00002800| 41 52 5f 45 4f 46 20 3e | 20 27 75 75 63 6f 73 74 |AR_EOF >| 'uucost|
|00002810| 2e 64 61 27 0a 23 21 20 | 2f 62 69 6e 2f 73 68 0a |.da'.#! |/bin/sh.|
|00002820| 23 0a 23 20 75 75 63 6f | 73 74 2e 64 61 20 2d 09 |#.# uuco|st.da -.|
|00002830| 44 6f 20 74 68 65 20 64 | 61 69 6c 79 20 63 6c 65 |Do the d|aily cle|
|00002840| 61 6e 75 70 2e 20 20 54 | 68 69 73 20 69 73 20 69 |anup. T|his is i|
|00002850| 6e 74 65 6e 64 65 64 20 | 74 6f 20 62 65 20 69 6e |ntended |to be in|
|00002860| 63 6c 75 64 65 64 0a 23 | 09 09 69 6e 20 74 68 65 |cluded.#|..in the|
|00002870| 20 75 75 64 65 6d 6f 6e | 2e 63 6c 65 61 6e 75 20 | uudemon|.cleanu |
|00002880| 73 63 72 69 70 74 2c 20 | 42 45 46 4f 52 45 20 74 |script, |BEFORE t|
|00002890| 68 65 20 6c 6f 67 73 20 | 61 72 65 20 63 6f 70 69 |he logs |are copi|
|000028a0| 65 64 0a 23 09 09 61 6e | 64 20 7a 65 72 6f 65 64 |ed.#..an|d zeroed|
|000028b0| 2e 0a 23 0a 75 75 6c 6f | 67 20 7c 20 2f 75 73 72 |..#.uulo|g | /usr|
|000028c0| 2f 6c 69 62 2f 75 75 63 | 70 2f 75 75 63 6f 73 74 |/lib/uuc|p/uucost|
|000028d0| 2f 73 63 61 6e 5f 63 6f | 73 74 20 3e 3e 2f 75 73 |/scan_co|st >>/us|
|000028e0| 72 2f 6c 69 62 2f 75 75 | 63 70 2f 75 75 63 6f 73 |r/lib/uu|cp/uucos|
|000028f0| 74 2f 63 6f 73 74 2e 6c | 6f 67 0a 53 48 41 52 5f |t/cost.l|og.SHAR_|
|00002900| 45 4f 46 0a 66 69 0a 69 | 66 20 74 65 73 74 20 2d |EOF.fi.i|f test -|
|00002910| 66 20 27 75 75 63 6f 73 | 74 2e 6d 6f 27 0a 74 68 |f 'uucos|t.mo'.th|
|00002920| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 22 |en..echo| shar: "|
|00002930| 77 69 6c 6c 20 6e 6f 74 | 20 6f 76 65 72 2d 77 72 |will not| over-wr|
|00002940| 69 74 65 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ite exis|ting fil|
|00002950| 65 20 27 75 75 63 6f 73 | 74 2e 6d 6f 27 22 0a 65 |e 'uucos|t.mo'".e|
|00002960| 6c 73 65 0a 63 61 74 20 | 3c 3c 20 5c 53 48 41 52 |lse.cat |<< \SHAR|
|00002970| 5f 45 4f 46 20 3e 20 27 | 75 75 63 6f 73 74 2e 6d |_EOF > '|uucost.m|
|00002980| 6f 27 0a 23 21 20 2f 62 | 69 6e 2f 73 68 0a 23 0a |o'.#! /b|in/sh.#.|
|00002990| 23 20 75 75 63 6f 73 74 | 2e 6d 6f 20 2d 09 44 6f |# uucost|.mo -.Do|
|000029a0| 20 74 68 65 20 6d 6f 6e | 74 68 6c 79 20 63 6c 65 | the mon|thly cle|
|000029b0| 61 6e 75 70 2e 20 20 54 | 68 69 73 20 69 73 20 69 |anup. T|his is i|
|000029c0| 6e 74 65 6e 64 65 64 20 | 74 6f 20 62 65 20 69 6e |ntended |to be in|
|000029d0| 63 6c 75 64 65 64 0a 23 | 09 09 69 6e 20 61 20 63 |cluded.#|..in a c|
|000029e0| 72 6f 6e 74 61 62 20 65 | 6e 74 72 79 20 74 68 61 |rontab e|ntry tha|
|000029f0| 74 20 69 73 20 72 75 6e | 20 69 6e 20 74 68 65 20 |t is run| in the |
|00002a00| 77 65 65 20 68 6f 75 72 | 73 20 6f 66 20 61 20 6e |wee hour|s of a n|
|00002a10| 65 77 0a 23 09 09 6d 6f | 6e 74 68 2c 20 41 46 54 |ew.#..mo|nth, AFT|
|00002a20| 45 52 20 75 75 64 65 6d | 6f 6e 2e 63 6c 65 61 6e |ER uudem|on.clean|
|00002a30| 75 20 73 63 72 69 70 74 | 20 68 61 73 20 62 65 65 |u script| has bee|
|00002a40| 6e 20 72 75 6e 2e 0a 23 | 0a 65 63 68 6f 20 55 75 |n run..#|.echo Uu|
|00002a50| 63 70 20 63 6f 73 74 20 | 73 75 6d 6d 61 72 79 20 |cp cost |summary |
|00002a60| 66 6f 72 20 74 68 65 20 | 6d 6f 6e 74 68 0a 65 63 |for the |month.ec|
|00002a70| 68 6f 0a 2f 75 73 72 2f | 6c 69 62 2f 75 75 63 70 |ho./usr/|lib/uucp|
|00002a80| 2f 75 75 63 6f 73 74 2f | 66 6f 72 6d 5f 63 6f 73 |/uucost/|form_cos|
|00002a90| 74 20 3c 2f 75 73 72 2f | 6c 69 62 2f 75 75 63 70 |t </usr/|lib/uucp|
|00002aa0| 2f 75 75 63 6f 73 74 2f | 63 6f 73 74 2e 6c 6f 67 |/uucost/|cost.log|
|00002ab0| 0a 3e 2f 75 73 72 2f 6c | 69 62 2f 75 75 63 70 2f |.>/usr/l|ib/uucp/|
|00002ac0| 75 75 63 6f 73 74 2f 63 | 6f 73 74 2e 6c 6f 67 0a |uucost/c|ost.log.|
|00002ad0| 53 48 41 52 5f 45 4f 46 | 0a 66 69 0a 65 78 69 74 |SHAR_EOF|.fi.exit|
|00002ae0| 20 30 0a 23 09 45 6e 64 | 20 6f 66 20 73 68 65 6c | 0.#.End| of shel|
|00002af0| 6c 20 61 72 63 68 69 76 | 65 0a 2d 2d 20 0a 4a 61 |l archiv|e.-- .Ja|
|00002b00| 63 6b 20 42 6f 6e 6e 2c | 20 3c 3e 20 53 6f 66 74 |ck Bonn,| <> Soft|
|00002b10| 77 61 72 65 20 4c 61 62 | 73 2c 20 4c 74 64 2c 20 |ware Lab|s, Ltd, |
|00002b20| 42 6f 78 20 34 35 31 2c | 20 45 61 73 74 6f 6e 20 |Box 451,| Easton |
|00002b30| 43 54 20 20 30 36 36 31 | 32 0a 73 65 69 73 6d 6f |CT 0661|2.seismo|
|00002b40| 21 75 75 6e 65 74 21 73 | 77 6c 61 62 73 21 6a 61 |!uunet!s|wlabs!ja|
|00002b50| 63 6b 0a | |ck. | |
+--------+-------------------------+-------------------------+--------+--------+