home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1361 < prev    next >
SHell self-extracting ARchive  |  1990-12-28  |  18.0 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: 1361

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail, ASCII text default
100% 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 64 64 | 73 40 63 63 2e 69 63 2e |From: dd|s@cc.ic.|
|00000010| 61 63 2e 75 6b 20 28 44 | 69 6f 6d 69 64 69 73 20 |ac.uk (D|iomidis |
|00000020| 53 70 69 6e 65 6c 6c 69 | 73 29 0a 4e 65 77 73 67 |Spinelli|s).Newsg|
|00000030| 72 6f 75 70 73 3a 20 63 | 6f 6d 70 2e 6c 61 6e 67 |roups: c|omp.lang|
|00000040| 2e 70 65 72 6c 2c 61 6c | 74 2e 73 6f 75 72 63 65 |.perl,al|t.source|
|00000050| 73 0a 53 75 62 6a 65 63 | 74 3a 20 74 61 72 66 69 |s.Subjec|t: tarfi|
|00000060| 78 20 2d 2d 20 66 69 78 | 20 61 6e 64 20 63 6f 6e |x -- fix| and con|
|00000070| 76 65 72 74 20 74 61 70 | 65 20 61 72 63 68 69 76 |vert tap|e archiv|
|00000080| 65 73 0a 4d 65 73 73 61 | 67 65 2d 49 44 3a 20 3c |es.Messa|ge-ID: <|
|00000090| 31 39 39 30 4d 61 79 32 | 31 2e 31 33 34 38 30 37 |1990May2|1.134807|
|000000a0| 2e 31 37 35 33 37 40 63 | 63 2e 69 63 2e 61 63 2e |.17537@c|c.ic.ac.|
|000000b0| 75 6b 3e 0a 44 61 74 65 | 3a 20 32 31 20 4d 61 79 |uk>.Date|: 21 May|
|000000c0| 20 39 30 20 31 33 3a 34 | 38 3a 30 37 20 47 4d 54 | 90 13:4|8:07 GMT|
|000000d0| 0a 0a 54 61 72 66 69 78 | 20 69 73 20 61 20 66 69 |..Tarfix| is a fi|
|000000e0| 6c 74 65 72 20 75 73 65 | 64 20 74 6f 20 66 69 78 |lter use|d to fix|
|000000f0| 20 61 6e 64 20 63 6f 6e | 76 65 72 74 20 74 61 72 | and con|vert tar|
|00000100| 28 35 29 20 61 72 63 68 | 69 76 65 73 2e 0a 49 74 |(5) arch|ives..It|
|00000110| 20 63 61 6e 20 63 6f 6e | 76 65 72 74 20 74 6f 20 | can con|vert to |
|00000120| 53 65 76 65 6e 74 68 20 | 45 64 69 74 69 6f 6e 20 |Seventh |Edition |
|00000130| 31 34 20 63 68 61 72 61 | 63 74 65 72 20 66 69 6c |14 chara|cter fil|
|00000140| 65 6e 61 6d 65 73 20 61 | 6e 64 0a 68 61 6e 64 6c |enames a|nd.handl|
|00000150| 65 20 4d 53 2d 44 4f 53 | 20 66 69 6c 65 20 6e 61 |e MS-DOS| file na|
|00000160| 6d 69 6e 67 20 63 6f 6e | 76 65 6e 74 69 6f 6e 73 |ming con|ventions|
|00000170| 2e 20 20 49 74 20 75 73 | 65 73 20 70 68 6f 6e 65 |. It us|es phone|
|00000180| 74 69 63 20 73 70 65 6c | 6c 69 6e 67 0a 68 65 75 |tic spel|ling.heu|
|00000190| 72 69 73 74 69 63 73 20 | 74 6f 20 72 65 74 61 69 |ristics |to retai|
|000001a0| 6e 20 6d 65 61 6e 69 6e | 67 66 75 6c 20 66 69 6c |n meanin|gful fil|
|000001b0| 65 6e 61 6d 65 73 2e 0a | 0a 54 61 72 66 69 78 20 |enames..|.Tarfix |
|000001c0| 63 61 6e 20 61 6c 73 6f | 20 62 65 20 75 73 65 64 |can also| be used|
|000001d0| 20 74 6f 20 63 6f 6e 76 | 65 72 74 20 6c 69 73 74 | to conv|ert list|
|000001e0| 73 20 6f 66 20 66 69 6c | 65 6e 61 6d 65 73 2c 20 |s of fil|enames, |
|000001f0| 74 6f 20 72 65 6d 6f 76 | 65 20 0a 61 62 73 6f 6c |to remov|e .absol|
|00000200| 75 74 65 20 66 69 6c 65 | 20 70 61 74 68 73 2c 20 |ute file| paths, |
|00000210| 72 65 6d 6f 76 65 20 61 | 62 73 6f 6c 75 74 65 20 |remove a|bsolute |
|00000220| 72 65 66 65 72 65 6e 63 | 65 73 20 61 6e 64 20 66 |referenc|es and f|
|00000230| 69 78 20 63 68 65 63 6b | 73 75 6d 73 20 0a 69 6e |ix check|sums .in|
|00000240| 20 6d 61 6e 75 61 6c 79 | 20 65 64 69 74 65 64 20 | manualy| edited |
|00000250| 66 69 6c 65 73 2e 0a 0a | 50 65 72 6c 20 73 6f 75 |files...|Perl sou|
|00000260| 72 63 65 20 61 6e 64 20 | 6d 61 6e 75 61 6c 20 70 |rce and |manual p|
|00000270| 61 67 65 20 69 6e 63 6c | 75 64 65 64 2e 20 20 54 |age incl|uded. T|
|00000280| 68 69 73 20 69 73 20 61 | 20 62 65 74 61 20 72 65 |his is a| beta re|
|00000290| 6c 65 61 73 65 2e 20 20 | 49 74 20 68 61 73 0a 62 |lease. |It has.b|
|000002a0| 65 65 6e 20 74 65 73 74 | 65 64 20 75 6e 64 65 72 |een test|ed under|
|000002b0| 20 53 75 6e 4f 53 20 61 | 6e 64 20 4d 53 2d 44 4f | SunOS a|nd MS-DO|
|000002c0| 53 20 75 73 69 6e 67 20 | 55 6e 69 78 20 74 61 72 |S using |Unix tar|
|000002d0| 20 61 6e 64 20 70 64 74 | 61 72 2e 0a 0a 23 21 20 | and pdt|ar...#! |
|000002e0| 2f 62 69 6e 2f 73 68 0a | 23 20 54 68 69 73 20 69 |/bin/sh.|# This i|
|000002f0| 73 20 61 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 |s a shel|l archiv|
|00000300| 65 2e 20 20 52 65 6d 6f | 76 65 20 61 6e 79 74 68 |e. Remo|ve anyth|
|00000310| 69 6e 67 20 62 65 66 6f | 72 65 20 74 68 69 73 20 |ing befo|re this |
|00000320| 6c 69 6e 65 2c 20 74 68 | 65 6e 20 75 6e 70 61 63 |line, th|en unpac|
|00000330| 6b 0a 23 20 69 74 20 62 | 79 20 73 61 76 69 6e 67 |k.# it b|y saving|
|00000340| 20 69 74 20 69 6e 74 6f | 20 61 20 66 69 6c 65 20 | it into| a file |
|00000350| 61 6e 64 20 74 79 70 69 | 6e 67 20 22 73 68 20 66 |and typi|ng "sh f|
|00000360| 69 6c 65 22 2e 20 20 54 | 6f 20 6f 76 65 72 77 72 |ile". T|o overwr|
|00000370| 69 74 65 20 65 78 69 73 | 74 69 6e 67 0a 23 20 66 |ite exis|ting.# f|
|00000380| 69 6c 65 73 2c 20 74 79 | 70 65 20 22 73 68 20 66 |iles, ty|pe "sh f|
|00000390| 69 6c 65 20 2d 63 22 2e | 20 20 59 6f 75 20 63 61 |ile -c".| You ca|
|000003a0| 6e 20 61 6c 73 6f 20 66 | 65 65 64 20 74 68 69 73 |n also f|eed this|
|000003b0| 20 61 73 20 73 74 61 6e | 64 61 72 64 20 69 6e 70 | as stan|dard inp|
|000003c0| 75 74 20 76 69 61 0a 23 | 20 75 6e 73 68 61 72 2c |ut via.#| unshar,|
|000003d0| 20 6f 72 20 62 79 20 74 | 79 70 69 6e 67 20 22 73 | or by t|yping "s|
|000003e0| 68 20 3c 66 69 6c 65 22 | 2c 20 65 2e 67 2e 2e 20 |h <file"|, e.g.. |
|000003f0| 20 49 66 20 74 68 69 73 | 20 61 72 63 68 69 76 65 | If this| archive|
|00000400| 20 69 73 20 63 6f 6d 70 | 6c 65 74 65 2c 20 79 6f | is comp|lete, yo|
|00000410| 75 0a 23 20 77 69 6c 6c | 20 73 65 65 20 74 68 65 |u.# will| see the|
|00000420| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 6d 65 73 73 61 | followi|ng messa|
|00000430| 67 65 20 61 74 20 74 68 | 65 20 65 6e 64 3a 0a 23 |ge at th|e end:.#|
|00000440| 09 09 22 45 6e 64 20 6f | 66 20 73 68 65 6c 6c 20 |.."End o|f shell |
|00000450| 61 72 63 68 69 76 65 2e | 22 0a 23 20 43 6f 6e 74 |archive.|".# Cont|
|00000460| 65 6e 74 73 3a 20 20 74 | 61 72 66 69 78 2e 31 20 |ents: t|arfix.1 |
|00000470| 74 61 72 66 69 78 0a 23 | 20 57 72 61 70 70 65 64 |tarfix.#| Wrapped|
|00000480| 20 62 79 20 64 64 73 40 | 73 75 6e 61 20 6f 6e 20 | by dds@|suna on |
|00000490| 4d 6f 6e 20 4d 61 79 20 | 32 31 20 31 32 3a 31 39 |Mon May |21 12:19|
|000004a0| 3a 31 39 20 31 39 39 30 | 0a 50 41 54 48 3d 2f 62 |:19 1990|.PATH=/b|
|000004b0| 69 6e 3a 2f 75 73 72 2f | 62 69 6e 3a 2f 75 73 72 |in:/usr/|bin:/usr|
|000004c0| 2f 75 63 62 20 3b 20 65 | 78 70 6f 72 74 20 50 41 |/ucb ; e|xport PA|
|000004d0| 54 48 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 74 |TH.if te|st -f 't|
|000004e0| 61 72 66 69 78 2e 31 27 | 20 2d 61 20 22 24 7b 31 |arfix.1'| -a "${1|
|000004f0| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00000500| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|00000510| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|00000520| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|00000530| 22 27 74 61 72 66 69 78 | 2e 31 27 5c 22 0a 65 6c |"'tarfix|.1'\".el|
|00000540| 73 65 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 45 78 |se.echo |shar: Ex|
|00000550| 74 72 61 63 74 69 6e 67 | 20 5c 22 27 74 61 72 66 |tracting| \"'tarf|
|00000560| 69 78 2e 31 27 5c 22 20 | 5c 28 35 34 30 36 20 63 |ix.1'\" |\(5406 c|
|00000570| 68 61 72 61 63 74 65 72 | 73 5c 29 0a 73 65 64 20 |haracter|s\).sed |
|00000580| 22 73 2f 5e 58 2f 2f 22 | 20 3e 27 74 61 72 66 69 |"s/^X//"| >'tarfi|
|00000590| 78 2e 31 27 20 3c 3c 27 | 45 4e 44 5f 4f 46 5f 46 |x.1' <<'|END_OF_F|
|000005a0| 49 4c 45 27 0a 58 2e 5c | 22 20 28 43 29 20 43 6f |ILE'.X.\|" (C) Co|
|000005b0| 70 79 72 69 67 68 74 20 | 31 39 39 30 20 44 69 6f |pyright |1990 Dio|
|000005c0| 6d 69 64 69 73 20 53 70 | 69 6e 65 6c 6c 69 73 2e |midis Sp|inellis.|
|000005d0| 20 20 0a 58 2e 5c 22 20 | 43 61 6e 20 62 65 20 63 | .X.\" |Can be c|
|000005e0| 6f 70 69 65 64 20 61 6e | 64 20 75 73 65 64 20 61 |opied an|d used a|
|000005f0| 73 20 6c 6f 6e 67 20 61 | 73 20 74 68 65 20 63 6f |s long a|s the co|
|00000600| 70 79 72 69 67 68 74 20 | 6e 6f 74 69 63 65 20 69 |pyright |notice i|
|00000610| 73 20 72 65 74 61 69 6e | 65 64 2e 0a 58 2e 5c 22 |s retain|ed..X.\"|
|00000620| 20 4d 6f 64 69 66 69 65 | 64 20 63 6f 70 69 65 73 | Modifie|d copies|
|00000630| 20 6d 75 73 74 20 62 65 | 20 6d 61 72 6b 65 64 20 | must be| marked |
|00000640| 61 73 20 73 75 63 68 2e | 0a 58 2e 54 48 20 54 41 |as such.|.X.TH TA|
|00000650| 52 46 49 58 20 31 20 22 | 31 37 20 4d 61 79 20 31 |RFIX 1 "|17 May 1|
|00000660| 39 39 30 22 0a 58 2e 44 | 41 20 31 37 20 4d 61 79 |990".X.D|A 17 May|
|00000670| 20 31 39 39 30 0a 58 2e | 53 48 20 4e 41 4d 45 0a | 1990.X.|SH NAME.|
|00000680| 58 74 61 72 66 69 78 20 | 5c 2d 20 66 69 78 20 61 |Xtarfix |\- fix a|
|00000690| 6e 64 20 63 6f 6e 76 65 | 72 74 20 74 61 70 65 20 |nd conve|rt tape |
|000006a0| 61 72 63 68 69 76 65 73 | 0a 58 2e 53 48 20 53 59 |archives|.X.SH SY|
|000006b0| 4e 4f 50 53 49 53 0a 58 | 5c 66 42 74 61 72 66 69 |NOPSIS.X|\fBtarfi|
|000006c0| 78 5c 66 50 20 5c 2d 5b | 5c 66 42 61 63 6e 6d 5c |x\fP \-[|\fBacnm\|
|000006d0| 66 50 5d 20 0a 58 5b 5c | 66 42 5c 2d 73 5c 66 50 |fP] .X[\|fB\-s\fP|
|000006e0| 20 5c 66 49 4e 5c 66 50 | 5d 0a 58 5b 5c 66 42 5c | \fIN\fP|].X[\fB\|
|000006f0| 2d 66 5c 66 50 20 5c 66 | 49 6d 73 64 6f 73 5c 66 |-f\fP \f|Imsdos\f|
|00000700| 50 20 6f 72 20 5c 66 49 | 76 6d 73 5c 66 50 5d 0a |P or \fI|vms\fP].|
|00000710| 58 5b 5c 66 42 5c 2d 74 | 5c 66 50 20 5c 66 49 6d |X[\fB\-t|\fP \fIm|
|00000720| 73 64 6f 73 5c 66 50 20 | 6f 72 20 5c 66 49 76 37 |sdos\fP |or \fIv7|
|00000730| 5c 66 50 5d 0a 58 2e 53 | 48 20 44 45 53 43 52 49 |\fP].X.S|H DESCRI|
|00000740| 50 54 49 4f 4e 0a 58 5c | 66 49 54 61 72 66 69 78 |PTION.X\|fITarfix|
|00000750| 5c 66 50 20 69 73 20 61 | 20 66 69 6c 74 65 72 20 |\fP is a| filter |
|00000760| 75 73 65 64 20 74 6f 20 | 66 69 78 20 61 6e 64 20 |used to |fix and |
|00000770| 63 6f 6e 76 65 72 74 20 | 5c 66 49 74 61 72 5c 66 |convert |\fItar\f|
|00000780| 50 28 35 29 20 61 72 63 | 68 69 76 65 73 2e 0a 58 |P(5) arc|hives..X|
|00000790| 57 69 74 68 6f 75 74 20 | 61 6e 79 20 6f 70 74 69 |Without |any opti|
|000007a0| 6f 6e 73 20 5c 66 49 74 | 61 72 66 69 78 5c 66 50 |ons \fIt|arfix\fP|
|000007b0| 20 72 65 61 64 73 20 61 | 20 74 61 70 65 20 61 72 | reads a| tape ar|
|000007c0| 63 68 69 76 65 20 66 72 | 6f 6d 20 73 74 61 6e 64 |chive fr|om stand|
|000007d0| 61 72 64 20 69 6e 70 75 | 74 0a 58 61 6e 64 20 70 |ard inpu|t.Xand p|
|000007e0| 72 69 6e 74 73 20 69 74 | 20 6f 6e 20 73 74 61 6e |rints it| on stan|
|000007f0| 64 61 72 64 20 6f 75 74 | 70 75 74 20 66 69 78 69 |dard out|put fixi|
|00000800| 6e 67 20 61 6e 79 20 77 | 72 6f 6e 67 20 63 68 65 |ng any w|rong che|
|00000810| 63 6b 73 75 6d 73 20 66 | 6f 75 6e 64 2e 20 20 54 |cksums f|ound. T|
|00000820| 68 69 73 0a 58 69 73 20 | 75 73 65 66 75 6c 20 61 |his.Xis |useful a|
|00000830| 66 74 65 72 20 65 64 69 | 74 69 6e 67 20 61 20 74 |fter edi|ting a t|
|00000840| 61 70 65 20 61 72 63 68 | 69 76 65 20 75 73 69 6e |ape arch|ive usin|
|00000850| 67 20 61 20 62 69 6e 61 | 72 79 20 65 64 69 74 6f |g a bina|ry edito|
|00000860| 72 2e 0a 58 2e 53 48 20 | 4f 50 54 49 4f 4e 53 0a |r..X.SH |OPTIONS.|
|00000870| 58 2e 49 50 20 22 5c 66 | 42 5c 2d 61 5c 66 50 22 |X.IP "\f|B\-a\fP"|
|00000880| 0a 58 46 69 78 20 61 6e | 20 61 72 63 68 69 76 65 |.XFix an| archive|
|00000890| 20 63 6f 6e 74 61 69 6e | 69 6e 67 20 61 62 73 6f | contain|ing abso|
|000008a0| 6c 75 74 65 20 66 69 6c | 65 6e 61 6d 65 73 2e 20 |lute fil|enames. |
|000008b0| 20 54 68 65 20 6c 65 61 | 64 69 6e 67 20 5c 66 42 | The lea|ding \fB|
|000008c0| 2f 5c 66 50 20 66 72 6f | 6d 0a 58 65 76 65 72 79 |/\fP fro|m.Xevery|
|000008d0| 20 66 69 6c 65 6e 61 6d | 65 20 69 73 20 72 65 6d | filenam|e is rem|
|000008e0| 6f 76 65 64 2e 0a 58 2e | 49 50 20 22 5c 66 42 5c |oved..X.|IP "\fB\|
|000008f0| 2d 63 5c 66 50 22 0a 58 | 43 72 65 61 74 65 20 63 |-c\fP".X|Create c|
|00000900| 61 6e 6f 6e 69 63 61 6c | 20 66 69 6c 65 6e 61 6d |anonical| filenam|
|00000910| 65 73 2e 20 20 41 6e 79 | 20 72 65 6c 61 74 69 76 |es. Any| relativ|
|00000920| 65 20 70 61 72 74 73 20 | 69 6e 20 61 20 66 69 6c |e parts |in a fil|
|00000930| 65 20 6e 61 6d 65 20 6c | 69 6b 65 20 5c 66 42 2f |e name l|ike \fB/|
|00000940| 2e 2e 2f 5c 66 50 2c 0a | 58 5c 66 42 2f 2e 2f 5c |../\fP,.|X\fB/./\|
|00000950| 66 50 20 61 6e 64 20 5c | 66 42 2f 2f 5c 66 50 20 |fP and \|fB//\fP |
|00000960| 61 72 65 20 72 65 6d 6f | 76 65 64 2e 20 20 4e 6f |are remo|ved. No|
|00000970| 74 65 20 74 68 61 74 20 | 5c 66 42 2f 2f 5c 66 42 |te that |\fB//\fB|
|00000980| 20 69 73 20 69 6e 74 65 | 72 70 72 65 74 65 64 20 | is inte|rpreted |
|00000990| 61 73 20 74 68 65 0a 58 | 72 6f 6f 74 20 64 69 72 |as the.X|root dir|
|000009a0| 65 63 74 6f 72 79 2e 0a | 58 2e 49 50 20 22 5c 66 |ectory..|X.IP "\f|
|000009b0| 42 5c 2d 6e 5c 66 50 22 | 0a 58 44 6f 20 6e 6f 74 |B\-n\fP"|.XDo not|
|000009c0| 20 70 65 72 66 6f 72 6d | 20 74 68 65 20 63 6f 6e | perform| the con|
|000009d0| 76 65 72 73 69 6f 6e 20 | 6f 6e 20 61 20 74 61 70 |version |on a tap|
|000009e0| 65 20 61 72 63 68 69 76 | 65 2e 20 20 41 20 6c 69 |e archiv|e. A li|
|000009f0| 73 74 20 6f 66 20 66 69 | 6c 65 6e 61 6d 65 73 20 |st of fi|lenames |
|00000a00| 77 69 6c 6c 20 62 65 0a | 58 72 65 61 64 20 66 72 |will be.|Xread fr|
|00000a10| 6f 6d 20 74 68 65 20 73 | 74 61 6e 64 61 72 64 20 |om the s|tandard |
|00000a20| 69 6e 70 75 74 2c 20 77 | 69 6c 6c 20 62 65 20 63 |input, w|ill be c|
|00000a30| 6f 6e 76 65 72 74 65 64 | 20 61 73 20 73 70 65 63 |onverted| as spec|
|00000a40| 69 66 69 65 64 20 62 79 | 20 6f 74 68 65 72 20 6f |ified by| other o|
|00000a50| 70 74 69 6f 6e 73 0a 58 | 61 6e 64 20 77 69 6c 6c |ptions.X|and will|
|00000a60| 20 62 65 20 70 72 69 6e | 74 65 64 20 6f 6e 20 73 | be prin|ted on s|
|00000a70| 74 61 6e 64 61 72 64 20 | 6f 75 74 70 75 74 2e 20 |tandard |output. |
|00000a80| 20 54 68 69 73 20 69 73 | 20 75 73 65 66 75 6c 20 | This is| useful |
|00000a90| 66 6f 72 20 63 72 65 61 | 74 69 6e 67 0a 58 73 68 |for crea|ting.Xsh|
|00000aa0| 65 6c 6c 20 73 63 72 69 | 70 74 73 20 74 6f 20 70 |ell scri|pts to p|
|00000ab0| 65 72 66 6f 72 6d 20 74 | 68 65 20 63 6f 6e 76 65 |erform t|he conve|
|00000ac0| 72 73 69 6f 6e 20 6f 72 | 20 66 6f 72 20 64 65 61 |rsion or| for dea|
|00000ad0| 6c 69 6e 67 20 77 69 74 | 68 0a 58 6f 74 68 65 72 |ling wit|h.Xother|
|00000ae0| 20 61 72 63 68 69 76 69 | 6e 67 20 70 72 6f 67 72 | archivi|ng progr|
|00000af0| 61 6d 73 2e 0a 58 2e 49 | 50 20 22 5c 66 42 5c 2d |ams..X.I|P "\fB\-|
|00000b00| 6d 5c 66 50 22 0a 58 50 | 72 69 6e 74 20 61 20 6d |m\fP".XP|rint a m|
|00000b10| 61 70 20 6f 66 20 61 6c | 6c 20 66 69 6c 65 6e 61 |ap of al|l filena|
|00000b20| 6d 65 73 20 63 6f 6e 76 | 65 72 74 65 64 20 6f 6e |mes conv|erted on|
|00000b30| 20 73 74 61 6e 64 61 72 | 64 20 65 72 72 6f 72 2e | standar|d error.|
|00000b40| 20 20 53 75 63 68 20 61 | 20 6d 61 70 0a 58 69 73 | Such a| map.Xis|
|00000b50| 20 6e 65 65 64 65 64 20 | 77 68 65 6e 20 74 72 79 | needed |when try|
|00000b60| 69 6e 67 20 74 6f 20 64 | 65 63 69 70 68 65 72 20 |ing to d|ecipher |
|00000b70| 77 68 61 74 20 65 61 63 | 68 20 66 69 6c 65 6e 61 |what eac|h filena|
|00000b80| 6d 65 20 75 73 65 64 20 | 74 6f 20 62 65 20 63 61 |me used |to be ca|
|00000b90| 6c 6c 65 64 2c 0a 58 69 | 6e 20 6f 72 64 65 72 20 |lled,.Xi|n order |
|00000ba0| 74 6f 20 66 69 78 20 6d | 61 6b 65 66 69 6c 65 73 |to fix m|akefiles|
|00000bb0| 20 65 74 63 2e 0a 58 2e | 49 50 20 22 5c 66 42 5c | etc..X.|IP "\fB\|
|00000bc0| 2d 73 5c 66 50 20 5c 66 | 49 4e 5c 66 50 22 0a 58 |-s\fP \f|IN\fP".X|
|00000bd0| 53 68 6f 72 74 65 6e 20 | 61 6c 6c 20 66 69 6c 65 |Shorten |all file|
|00000be0| 6e 61 6d 65 20 63 6f 6d | 70 6f 6e 65 6e 74 73 20 |name com|ponents |
|00000bf0| 69 6e 20 74 68 65 20 61 | 72 63 68 69 76 65 20 74 |in the a|rchive t|
|00000c00| 6f 20 6c 65 6e 67 74 68 | 20 5c 66 49 4e 5c 66 50 |o length| \fIN\fP|
|00000c10| 2e 20 20 54 68 65 20 0a | 58 73 68 6f 72 74 65 6e |. The .|Xshorten|
|00000c20| 69 6e 67 20 61 6c 67 6f | 72 69 74 68 6d 20 69 73 |ing algo|rithm is|
|00000c30| 20 64 69 73 63 75 73 73 | 65 64 20 6c 61 74 65 72 | discuss|ed later|
|00000c40| 2e 0a 58 2e 49 50 20 22 | 5c 66 42 5c 2d 66 5c 66 |..X.IP "|\fB\-f\f|
|00000c50| 50 20 5c 66 49 6d 73 64 | 6f 73 5c 66 50 22 0a 58 |P \fImsd|os\fP".X|
|00000c60| 41 73 73 75 6d 65 20 74 | 68 61 74 20 74 68 65 20 |Assume t|hat the |
|00000c70| 61 72 63 68 69 76 65 20 | 74 6f 20 62 65 20 63 6f |archive |to be co|
|00000c80| 6e 76 65 72 74 65 64 20 | 63 6f 6d 65 73 20 66 72 |nverted |comes fr|
|00000c90| 6f 6d 20 61 6e 20 5c 66 | 49 4d 53 2d 44 4f 53 5c |om an \f|IMS-DOS\|
|00000ca0| 66 50 20 73 79 73 74 65 | 6d 2e 0a 58 54 68 65 20 |fP syste|m..XThe |
|00000cb0| 66 6f 6c 6c 6f 77 69 6e | 67 20 63 6f 6e 76 65 72 |followin|g conver|
|00000cc0| 73 69 6f 6e 73 20 77 69 | 6c 6c 20 62 65 20 70 65 |sions wi|ll be pe|
|00000cd0| 72 66 6f 72 6d 65 64 3a | 0a 58 2e 49 50 0a 58 5c |rformed:|.X.IP.X\|
|00000ce0| 28 62 75 20 41 6c 6c 20 | 62 61 63 6b 73 6c 61 73 |(bu All |backslas|
|00000cf0| 68 65 73 20 77 69 6c 6c | 20 62 65 20 63 6f 6e 76 |hes will| be conv|
|00000d00| 65 72 74 65 64 20 74 6f | 20 73 6c 61 73 68 65 73 |erted to| slashes|
|00000d10| 2e 0a 58 2e 49 50 0a 58 | 5c 28 62 75 20 55 70 70 |..X.IP.X|\(bu Upp|
|00000d20| 65 72 63 61 73 65 20 63 | 68 61 72 61 63 74 65 72 |ercase c|haracter|
|00000d30| 73 20 77 69 6c 6c 20 62 | 65 20 63 6f 6e 76 65 72 |s will b|e conver|
|00000d40| 74 65 64 20 74 6f 20 6c | 6f 77 65 72 63 61 73 65 |ted to l|owercase|
|00000d50| 2e 0a 58 2e 49 50 0a 58 | 5c 28 62 75 20 41 20 6c |..X.IP.X|\(bu A l|
|00000d60| 65 61 64 69 6e 67 20 64 | 72 69 76 65 20 6e 61 6d |eading d|rive nam|
|00000d70| 65 20 66 6f 6c 6c 6f 77 | 65 64 20 62 79 20 61 20 |e follow|ed by a |
|00000d80| 63 6f 6c 6f 6e 20 77 69 | 6c 6c 20 62 65 20 72 65 |colon wi|ll be re|
|00000d90| 6d 6f 76 65 64 2e 0a 58 | 2e 49 50 20 22 5c 66 42 |moved..X|.IP "\fB|
|00000da0| 5c 2d 66 5c 66 50 20 5c | 66 49 76 6d 73 5c 66 50 |\-f\fP \|fIvms\fP|
|00000db0| 22 0a 58 41 73 73 75 6d | 65 20 74 68 61 74 20 74 |".XAssum|e that t|
|00000dc0| 68 65 20 61 72 63 68 69 | 76 65 20 74 6f 20 62 65 |he archi|ve to be|
|00000dd0| 20 63 6f 6e 76 65 72 74 | 65 64 20 63 6f 6d 65 73 | convert|ed comes|
|00000de0| 20 66 72 6f 6d 20 61 20 | 5c 66 49 56 4d 53 5c 66 | from a |\fIVMS\f|
|00000df0| 50 20 73 79 73 74 65 6d | 2e 0a 58 54 68 65 20 66 |P system|..XThe f|
|00000e00| 6f 6c 6c 6f 77 69 6e 67 | 20 63 6f 6e 76 65 72 73 |ollowing| convers|
|00000e10| 69 6f 6e 73 20 77 69 6c | 6c 20 62 65 20 70 65 72 |ions wil|l be per|
|00000e20| 66 6f 72 6d 65 64 3a 0a | 58 2e 49 50 0a 58 5c 28 |formed:.|X.IP.X\(|
|00000e30| 62 75 20 55 70 70 65 72 | 63 61 73 65 20 63 68 61 |bu Upper|case cha|
|00000e40| 72 61 63 74 65 72 73 20 | 77 69 6c 6c 20 62 65 20 |racters |will be |
|00000e50| 63 6f 6e 76 65 72 74 65 | 64 20 74 6f 20 6c 6f 77 |converte|d to low|
|00000e60| 65 72 63 61 73 65 2e 0a | 58 2e 49 50 0a 58 5c 28 |ercase..|X.IP.X\(|
|00000e70| 62 75 20 41 20 6c 65 61 | 64 69 6e 67 20 64 72 69 |bu A lea|ding dri|
|00000e80| 76 65 20 6e 61 6d 65 20 | 66 6f 6c 6c 6f 77 65 64 |ve name |followed|
|00000e90| 20 62 79 20 61 20 63 6f | 6c 6f 6e 20 6f 72 20 6e | by a co|lon or n|
|00000ea0| 6f 64 65 20 6e 61 6d 65 | 20 66 6f 6c 6c 6f 77 65 |ode name| followe|
|00000eb0| 64 20 62 79 0a 58 61 20 | 64 6f 75 62 6c 65 20 63 |d by.Xa |double c|
|00000ec0| 6f 6c 6f 6e 20 77 69 6c | 6c 20 62 65 20 72 65 6d |olon wil|l be rem|
|00000ed0| 6f 76 65 64 2e 0a 58 2e | 49 50 0a 58 5c 28 62 75 |oved..X.|IP.X\(bu|
|00000ee0| 20 41 20 64 69 72 65 63 | 74 6f 72 79 20 6e 61 6d | A direc|tory nam|
|00000ef0| 65 20 6f 66 20 74 68 65 | 20 66 6f 72 6d 20 5c 66 |e of the| form \f|
|00000f00| 49 5b 78 78 78 78 5d 5c | 66 50 20 77 69 6c 6c 20 |I[xxxx]\|fP will |
|00000f10| 62 65 20 63 6f 6e 76 65 | 72 74 65 64 20 0a 58 74 |be conve|rted .Xt|
|00000f20| 6f 20 5c 66 49 78 78 78 | 78 2f 5c 66 50 2e 0a 58 |o \fIxxx|x/\fP..X|
|00000f30| 2e 49 50 0a 58 5c 28 62 | 75 20 41 20 74 72 61 69 |.IP.X\(b|u A trai|
|00000f40| 6c 69 6e 67 20 73 65 6d | 69 63 6f 6c 6f 6e 20 66 |ling sem|icolon f|
|00000f50| 6f 6c 6c 6f 77 65 64 20 | 62 79 20 61 20 67 65 6e |ollowed |by a gen|
|00000f60| 65 72 61 74 69 6f 6e 20 | 6e 75 6d 62 65 72 20 77 |eration |number w|
|00000f70| 69 6c 6c 20 62 65 20 72 | 65 6d 6f 76 65 64 2e 0a |ill be r|emoved..|
|00000f80| 58 2e 49 50 0a 58 5c 28 | 62 75 20 44 6f 75 62 6c |X.IP.X\(|bu Doubl|
|00000f90| 65 20 71 75 6f 74 65 73 | 20 61 6e 64 20 5c 66 49 |e quotes| and \fI|
|00000fa0| 5e 56 5c 66 50 20 63 68 | 61 72 61 63 74 65 72 73 |^V\fP ch|aracters|
|00000fb0| 20 77 69 6c 6c 20 62 65 | 20 72 65 6d 6f 76 65 64 | will be| removed|
|00000fc0| 2e 0a 58 2e 49 50 20 22 | 5c 66 42 5c 2d 74 5c 66 |..X.IP "|\fB\-t\f|
|00000fd0| 50 20 5c 66 49 6d 73 64 | 6f 73 5c 66 50 22 0a 58 |P \fImsd|os\fP".X|
|00000fe0| 43 6f 6e 76 65 72 74 20 | 74 68 65 20 61 72 63 68 |Convert |the arch|
|00000ff0| 69 76 65 20 74 6f 20 5c | 66 49 4d 53 2d 44 4f 53 |ive to \|fIMS-DOS|
|00001000| 5c 66 50 20 63 6f 6e 76 | 65 6e 74 69 6f 6e 73 2e |\fP conv|entions.|
|00001010| 0a 58 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |.XThe fo|llowing |
|00001020| 63 6f 6e 76 65 72 73 69 | 6f 6e 73 20 77 69 6c 6c |conversi|ons will|
|00001030| 20 62 65 20 70 65 72 66 | 6f 72 6d 65 64 3a 0a 58 | be perf|ormed:.X|
|00001040| 2e 49 50 0a 58 5c 28 62 | 75 20 45 61 63 68 20 66 |.IP.X\(b|u Each f|
|00001050| 69 6c 65 6e 61 6d 65 20 | 63 6f 6d 70 6f 6e 65 6e |ilename |componen|
|00001060| 74 20 77 69 6c 6c 20 68 | 61 76 65 20 61 6c 6c 20 |t will h|ave all |
|00001070| 74 68 65 20 64 6f 74 73 | 2c 20 62 75 74 20 6f 6e |the dots|, but on|
|00001080| 65 20 72 65 6d 6f 76 65 | 64 20 74 6f 0a 58 63 6f |e remove|d to.Xco|
|00001090| 6e 76 65 72 74 20 69 74 | 20 74 6f 20 61 20 6e 61 |nvert it| to a na|
|000010a0| 6d 65 20 66 6f 6c 6c 6f | 77 65 64 20 62 79 20 61 |me follo|wed by a|
|000010b0| 6e 20 6f 70 74 69 6f 6e | 61 6c 20 65 78 74 65 6e |n option|al exten|
|000010c0| 73 69 6f 6e 2e 0a 58 2e | 49 50 0a 58 5c 28 62 75 |sion..X.|IP.X\(bu|
|000010d0| 20 54 68 65 20 6e 61 6d | 65 20 77 69 6c 6c 20 62 | The nam|e will b|
|000010e0| 65 20 73 68 6f 72 74 65 | 6e 65 64 20 74 6f 20 38 |e shorte|ned to 8|
|000010f0| 20 63 68 61 72 61 63 74 | 65 72 73 2e 0a 58 2e 49 | charact|ers..X.I|
|00001100| 50 0a 58 5c 28 62 75 20 | 54 68 65 20 65 78 74 65 |P.X\(bu |The exte|
|00001110| 6e 73 69 6f 6e 20 77 69 | 6c 6c 20 62 65 20 73 68 |nsion wi|ll be sh|
|00001120| 6f 72 74 65 6e 65 64 20 | 74 6f 20 74 68 72 65 65 |ortened |to three|
|00001130| 20 63 68 61 72 61 63 74 | 65 72 73 2e 0a 58 2e 49 | charact|ers..X.I|
|00001140| 50 0a 58 5c 28 62 75 20 | 41 6e 79 20 6f 6e 65 20 |P.X\(bu |Any one |
|00001150| 6f 66 20 74 68 65 20 60 | 60 5c 66 42 2c 3d 2b 3c |of the `|`\fB,=+<|
|00001160| 3e 7c 3b 20 2a 3f 3a 5b | 5d 5c 5c 22 5c 66 50 27 |>|; *?:[|]\\"\fP'|
|00001170| 27 20 63 68 61 72 61 63 | 74 65 72 73 20 77 69 6c |' charac|ters wil|
|00001180| 6c 20 62 65 20 63 6f 6e | 76 65 72 74 65 64 20 74 |l be con|verted t|
|00001190| 6f 0a 58 61 20 60 60 5c | 66 42 5e 5c 66 50 27 27 |o.Xa ``\|fB^\fP''|
|000011a0| 2e 0a 58 2e 49 50 0a 58 | 5c 28 62 75 20 49 66 20 |..X.IP.X|\(bu If |
|000011b0| 61 20 6e 61 6d 65 20 69 | 73 20 61 6e 79 20 6f 66 |a name i|s any of|
|000011c0| 20 74 68 65 20 64 65 76 | 69 63 65 20 6e 61 6d 65 | the dev|ice name|
|000011d0| 73 20 5c 66 49 63 6f 6e | 2c 20 61 75 78 31 2c 20 |s \fIcon|, aux1, |
|000011e0| 61 75 78 32 2c 20 61 75 | 78 33 2c 20 61 75 78 34 |aux2, au|x3, aux4|
|000011f0| 2c 20 0a 58 70 72 6e 2c | 20 63 6c 6f 63 6b 24 2c |, .Xprn,| clock$,|
|00001200| 20 6c 70 74 31 2c 20 6c | 70 74 32 5c 66 50 20 6f | lpt1, l|pt2\fP o|
|00001210| 72 20 5c 66 49 6c 70 74 | 33 5c 66 50 20 69 74 20 |r \fIlpt|3\fP it |
|00001220| 77 69 6c 6c 20 68 61 76 | 65 20 61 6e 20 75 6e 64 |will hav|e an und|
|00001230| 65 72 6c 69 6e 65 20 70 | 72 65 70 65 6e 64 65 64 |erline p|repended|
|00001240| 0a 58 74 6f 20 69 74 2e | 0a 58 2e 49 50 20 22 5c |.Xto it.|.X.IP "\|
|00001250| 66 42 5c 2d 74 5c 66 50 | 20 5c 66 49 76 37 5c 66 |fB\-t\fP| \fIv7\f|
|00001260| 50 22 0a 58 43 6f 6e 76 | 65 72 74 20 74 68 65 20 |P".XConv|ert the |
|00001270| 61 72 63 68 69 76 65 20 | 74 6f 20 74 68 65 20 5c |archive |to the \|
|00001280| 66 49 73 65 76 65 6e 74 | 68 20 65 64 69 74 69 6f |fIsevent|h editio|
|00001290| 6e 20 55 6e 69 78 5c 66 | 50 20 6e 61 6d 69 6e 67 |n Unix\f|P naming|
|000012a0| 20 63 6f 6e 76 65 6e 74 | 69 6f 6e 73 2e 0a 58 41 | convent|ions..XA|
|000012b0| 6c 6c 20 63 6f 6d 70 6f | 6e 65 6e 74 73 20 6f 66 |ll compo|nents of|
|000012c0| 20 61 20 66 69 6c 65 6e | 61 6d 65 20 77 69 6c 6c | a filen|ame will|
|000012d0| 20 62 65 20 73 68 6f 72 | 74 65 6e 65 64 20 74 6f | be shor|tened to|
|000012e0| 20 31 34 20 63 68 61 72 | 61 63 74 65 72 73 2e 0a | 14 char|acters..|
|000012f0| 58 2e 4c 50 0a 58 4f 6e | 6c 79 20 6f 6e 65 20 6f |X.LP.XOn|ly one o|
|00001300| 66 20 74 68 65 20 63 6f | 6e 76 65 72 73 69 6f 6e |f the co|nversion|
|00001310| 20 6f 70 74 69 6f 6e 73 | 20 73 68 6f 75 6c 64 20 | options| should |
|00001320| 62 65 20 67 69 76 65 6e | 2e 20 20 41 6c 6c 20 63 |be given|. All c|
|00001330| 6f 6e 76 65 72 73 69 6f | 6e 73 0a 58 63 72 65 61 |onversio|ns.Xcrea|
|00001340| 74 65 20 63 61 6e 6f 6e | 69 63 61 6c 20 66 69 6c |te canon|ical fil|
|00001350| 65 20 6e 61 6d 65 73 2e | 0a 58 2e 4c 50 0a 58 5c |e names.|.X.LP.X\|
|00001360| 66 49 54 61 72 66 69 78 | 5c 66 50 20 74 72 69 65 |fITarfix|\fP trie|
|00001370| 73 20 71 75 69 74 65 20 | 68 61 72 64 20 74 6f 20 |s quite |hard to |
|00001380| 72 65 74 61 69 6e 20 6d | 65 61 6e 69 6e 67 66 75 |retain m|eaningfu|
|00001390| 6c 20 66 69 6c 65 6e 61 | 6d 65 73 20 77 68 65 6e |l filena|mes when|
|000013a0| 20 69 74 0a 58 73 68 6f | 72 74 65 6e 73 20 74 68 | it.Xsho|rtens th|
|000013b0| 65 6d 2e 20 20 54 68 65 | 20 73 68 6f 72 74 65 6e |em. The| shorten|
|000013c0| 69 6e 67 20 61 6c 67 6f | 72 69 74 68 6d 20 69 73 |ing algo|rithm is|
|000013d0| 20 61 20 6d 61 6e 79 20 | 70 61 73 73 20 6f 6e 65 | a many |pass one|
|000013e0| 2c 20 6f 6e 20 65 61 63 | 68 0a 58 70 61 73 73 20 |, on eac|h.Xpass |
|000013f0| 6c 65 73 73 20 6d 65 61 | 6e 69 6e 67 20 66 72 6f |less mea|ning fro|
|00001400| 6d 20 74 68 65 20 66 69 | 6c 65 6e 61 6d 65 20 69 |m the fi|lename i|
|00001410| 73 20 70 72 65 73 65 72 | 76 65 64 2e 20 20 0a 58 |s preser|ved. .X|
|00001420| 41 6c 6c 20 74 72 61 6e | 73 66 6f 72 6d 61 74 69 |All tran|sformati|
|00001430| 6f 6e 73 20 61 72 65 20 | 64 6f 6e 65 20 73 74 61 |ons are |done sta|
|00001440| 72 74 69 6e 67 20 66 72 | 6f 6d 20 74 68 65 20 65 |rting fr|om the e|
|00001450| 6e 64 20 6f 66 20 74 68 | 65 20 6e 61 6d 65 20 61 |nd of th|e name a|
|00001460| 6e 64 0a 58 6d 6f 76 69 | 6e 67 20 74 6f 77 61 72 |nd.Xmovi|ng towar|
|00001470| 64 73 20 74 68 65 20 62 | 65 67 69 6e 6e 69 6e 67 |ds the b|eginning|
|00001480| 2e 0a 58 46 69 72 73 74 | 20 61 20 73 65 72 69 65 |..XFirst| a serie|
|00001490| 73 20 6f 66 0a 58 70 68 | 6f 6e 65 74 69 63 20 74 |s of.Xph|onetic t|
|000014a0| 72 61 6e 73 66 6f 72 6d | 61 74 69 6f 6e 73 20 61 |ransform|ations a|
|000014b0| 72 65 20 70 72 65 72 66 | 6f 72 6d 65 64 2e 20 20 |re prerf|ormed. |
|000014c0| 44 6f 75 62 6c 65 20 6c | 65 74 74 65 72 73 20 61 |Double l|etters a|
|000014d0| 72 65 20 72 65 6d 6f 76 | 65 64 0a 58 61 6e 64 20 |re remov|ed.Xand |
|000014e0| 74 68 65 20 70 61 69 72 | 73 20 5c 66 49 6f 75 2c |the pair|s \fIou,|
|000014f0| 20 63 6b 2c 20 6b 73 2c | 20 73 68 2c 20 70 68 5c | ck, ks,| sh, ph\|
|00001500| 66 50 20 61 6e 64 20 5c | 66 49 6f 6f 5c 66 50 20 |fP and \|fIoo\fP |
|00001510| 61 72 65 20 73 75 62 73 | 74 69 74 75 74 65 64 0a |are subs|tituted.|
|00001520| 58 77 69 74 68 20 5c 66 | 49 75 2c 20 6b 2c 20 78 |Xwith \f|Iu, k, x|
|00001530| 2c 20 73 2c 20 66 5c 66 | 50 20 61 6e 64 20 5c 66 |, s, f\f|P and \f|
|00001540| 49 75 5c 66 50 20 72 65 | 73 70 65 63 74 69 76 65 |Iu\fP re|spective|
|00001550| 6c 79 2e 20 20 49 66 20 | 74 68 69 73 20 70 72 6f |ly. If |this pro|
|00001560| 63 65 64 75 72 65 0a 58 | 64 6f 65 73 20 6e 6f 74 |cedure.X|does not|
|00001570| 20 70 72 6f 64 75 63 65 | 20 61 20 73 68 6f 72 74 | produce| a short|
|00001580| 20 65 6e 6f 75 67 68 20 | 66 69 6c 65 6e 61 6d 65 | enough |filename|
|00001590| 20 74 68 65 6e 20 76 6f | 77 65 6c 73 20 77 69 6c | then vo|wels wil|
|000015a0| 6c 20 73 74 61 72 74 0a | 58 67 65 74 74 69 6e 67 |l start.|Xgetting|
|000015b0| 20 72 65 6d 6f 76 65 64 | 2c 20 66 69 72 73 74 20 | removed|, first |
|000015c0| 6c 6f 77 65 72 63 61 73 | 65 2c 20 74 68 65 6e 20 |lowercas|e, then |
|000015d0| 75 70 70 65 72 63 61 73 | 65 2e 20 20 46 69 6e 61 |uppercas|e. Fina|
|000015e0| 6c 6c 79 20 74 68 65 20 | 73 74 72 69 6e 67 20 0a |lly the |string .|
|000015f0| 58 69 73 20 74 72 69 6d | 6d 65 64 20 62 79 20 72 |Xis trim|med by r|
|00001600| 65 6d 6f 76 69 6e 67 20 | 65 78 74 72 61 6e 65 6f |emoving |extraneo|
|00001610| 75 73 20 63 68 61 72 61 | 63 74 65 72 73 20 66 72 |us chara|cters fr|
|00001620| 6f 6d 20 69 74 73 20 65 | 6e 64 2e 0a 58 2e 4c 50 |om its e|nd..X.LP|
|00001630| 0a 58 5c 66 49 54 61 72 | 66 69 78 5c 66 50 20 72 |.X\fITar|fix\fP r|
|00001640| 65 6d 65 6d 62 65 72 73 | 20 61 6c 6c 20 74 68 65 |emembers| all the|
|00001650| 20 66 69 6c 65 6e 61 6d | 65 73 20 63 6f 6e 76 65 | filenam|es conve|
|00001660| 72 74 65 64 20 61 6e 64 | 20 77 69 6c 6c 20 6e 6f |rted and| will no|
|00001670| 74 20 6d 61 70 0a 58 74 | 77 6f 20 64 69 66 66 65 |t map.Xt|wo diffe|
|00001680| 72 65 6e 74 20 66 69 6c | 65 6e 61 6d 65 73 20 74 |rent fil|enames t|
|00001690| 6f 20 74 68 65 20 73 61 | 6d 65 20 6f 6e 65 2e 20 |o the sa|me one. |
|000016a0| 20 54 68 65 20 6c 65 74 | 74 65 72 73 20 5c 66 49 | The let|ters \fI|
|000016b0| 41 41 5c 66 50 20 77 69 | 6c 6c 0a 58 62 65 20 61 |AA\fP wi|ll.Xbe a|
|000016c0| 70 70 65 6e 64 65 64 20 | 74 6f 20 64 75 62 6c 69 |ppended |to dubli|
|000016d0| 63 61 74 65 20 66 69 6c | 65 6e 61 6d 65 20 63 6f |cate fil|ename co|
|000016e0| 6d 70 6f 6e 65 6e 74 73 | 20 63 72 65 61 74 65 64 |mponents| created|
|000016f0| 20 61 6e 64 20 74 68 65 | 73 65 20 77 69 6c 6c 0a | and the|se will.|
|00001700| 58 62 65 20 69 6e 73 63 | 72 65 6d 65 6e 74 65 64 |Xbe insc|remented|
|00001710| 20 77 69 74 68 20 65 76 | 65 72 79 20 6e 61 6d 65 | with ev|ery name|
|00001720| 20 63 6c 61 73 68 2e 0a | 58 2e 53 48 20 45 58 41 | clash..|X.SH EXA|
|00001730| 4d 50 4c 45 53 0a 58 60 | 60 74 61 72 66 69 78 20 |MPLES.X`|`tarfix |
|00001740| 2d 6d 20 2d 74 20 76 37 | 20 32 3e 20 6d 61 70 20 |-m -t v7| 2> map |
|00001750| 3c 20 2f 64 65 76 2f 72 | 6d 74 38 20 7c 20 74 61 |< /dev/r|mt8 | ta|
|00001760| 72 20 78 66 20 2d 27 27 | 20 77 69 6c 6c 20 72 65 |r xf -''| will re|
|00001770| 61 64 20 61 6e 20 61 72 | 63 68 69 76 65 0a 58 63 |ad an ar|chive.Xc|
|00001780| 6f 6e 74 61 69 6e 69 6e | 67 20 6c 6f 6e 67 20 66 |ontainin|g long f|
|00001790| 69 6c 65 6e 61 6d 65 73 | 20 6f 6e 20 61 20 73 68 |ilenames| on a sh|
|000017a0| 6f 72 74 20 66 69 6c 65 | 6e 61 6d 65 20 66 69 6c |ort file|name fil|
|000017b0| 65 20 73 79 73 74 65 6d | 20 28 65 2e 67 2e 20 4d |e system| (e.g. M|
|000017c0| 69 6e 69 78 29 2e 20 20 | 41 74 0a 58 74 68 65 20 |inix). |At.Xthe |
|000017d0| 65 6e 64 2c 20 74 68 65 | 20 66 69 6c 65 20 5c 66 |end, the| file \f|
|000017e0| 49 6d 61 70 5c 66 50 20 | 77 69 6c 6c 20 63 6f 6e |Imap\fP |will con|
|000017f0| 74 61 69 6e 20 61 20 6c | 69 73 74 20 6f 66 20 66 |tain a l|ist of f|
|00001800| 69 6c 65 6e 61 6d 65 73 | 20 61 73 20 74 68 65 79 |ilenames| as they|
|00001810| 20 77 65 72 65 0a 58 69 | 6e 20 74 68 65 20 61 72 | were.Xi|n the ar|
|00001820| 63 68 69 76 65 20 61 6e | 64 20 74 68 65 20 6e 61 |chive an|d the na|
|00001830| 6d 65 20 77 69 74 68 20 | 77 68 69 63 68 20 65 61 |me with |which ea|
|00001840| 63 68 20 77 61 73 20 65 | 78 74 72 61 63 74 65 64 |ch was e|xtracted|
|00001850| 2e 0a 58 2e 4c 50 0a 58 | 60 60 66 69 6e 64 20 2e |..X.LP.X|``find .|
|00001860| 20 2d 70 72 69 6e 74 20 | 7c 20 74 61 72 66 69 78 | -print || tarfix|
|00001870| 20 2d 73 20 31 32 20 2d | 6e 20 7c 20 73 65 64 20 | -s 12 -|n | sed |
|00001880| 2d 65 20 27 73 2f 5e 2f | 6d 76 20 2f 27 20 7c 20 |-e 's/^/|mv /' | |
|00001890| 73 68 27 27 20 63 6f 6e | 76 65 72 74 73 0a 58 61 |sh'' con|verts.Xa|
|000018a0| 6c 6c 20 66 69 6c 65 6e | 61 6d 65 73 20 69 6e 20 |ll filen|ames in |
|000018b0| 61 20 64 69 72 65 63 74 | 6f 72 79 20 68 69 65 72 |a direct|ory hier|
|000018c0| 61 72 63 68 79 20 74 6f | 20 75 73 65 20 75 70 20 |archy to| use up |
|000018d0| 74 6f 20 31 32 20 63 68 | 61 72 61 63 74 65 72 73 |to 12 ch|aracters|
|000018e0| 2e 0a 58 2e 4c 50 0a 58 | 60 60 74 61 72 20 63 66 |..X.LP.X|``tar cf|
|000018f0| 20 75 75 70 63 20 7c 20 | 74 61 72 66 69 78 20 2d | uupc | |tarfix -|
|00001900| 74 20 6d 73 64 6f 73 20 | 3e 2f 64 65 76 2f 72 6d |t msdos |>/dev/rm|
|00001910| 74 38 27 27 20 77 69 6c | 6c 20 63 72 65 61 74 65 |t8'' wil|l create|
|00001920| 20 61 20 74 61 70 65 20 | 61 72 63 68 69 76 65 0a | a tape |archive.|
|00001930| 58 74 68 61 74 20 63 61 | 6e 20 62 65 20 65 61 73 |Xthat ca|n be eas|
|00001940| 69 6c 79 20 65 78 74 72 | 61 63 74 65 64 20 6f 6e |ily extr|acted on|
|00001950| 20 61 6e 20 5c 66 49 4d | 53 2d 44 4f 53 5c 66 50 | an \fIM|S-DOS\fP|
|00001960| 20 73 79 73 74 65 6d 2e | 0a 58 2e 53 48 20 41 55 | system.|.X.SH AU|
|00001970| 54 48 4f 52 0a 58 44 69 | 6f 6d 69 64 69 73 20 53 |THOR.XDi|omidis S|
|00001980| 70 69 6e 65 6c 6c 69 73 | 20 3c 64 64 73 40 63 63 |pinellis| <dds@cc|
|00001990| 2e 69 63 2e 61 63 2e 75 | 6b 3e 0a 58 2e 53 48 20 |.ic.ac.u|k>.X.SH |
|000019a0| 22 53 45 45 20 41 4c 53 | 4f 22 0a 58 74 61 72 28 |"SEE ALS|O".Xtar(|
|000019b0| 31 29 2c 20 74 61 72 28 | 35 29 2c 20 64 64 28 31 |1), tar(|5), dd(1|
|000019c0| 29 2c 20 66 69 6e 64 28 | 31 29 2c 20 63 70 69 6f |), find(|1), cpio|
|000019d0| 28 31 29 0a 58 2e 53 48 | 20 44 49 41 47 4e 4f 53 |(1).X.SH| DIAGNOS|
|000019e0| 54 49 43 53 0a 58 57 69 | 6c 6c 20 63 6f 6d 70 6c |TICS.XWi|ll compl|
|000019f0| 61 69 6e 20 69 66 20 69 | 74 20 63 61 6e 20 6e 6f |ain if i|t can no|
|00001a00| 74 20 72 65 61 64 20 74 | 68 65 20 61 20 68 65 61 |t read t|he a hea|
|00001a10| 64 65 72 20 6f 72 20 64 | 61 74 61 20 62 6c 6f 63 |der or d|ata bloc|
|00001a20| 6b 20 6f 66 20 61 6e 20 | 61 72 63 68 69 76 65 2e |k of an |archive.|
|00001a30| 0a 58 2e 53 48 20 42 55 | 47 53 0a 58 2e 4c 50 0a |.X.SH BU|GS.X.LP.|
|00001a40| 58 54 68 69 73 20 69 73 | 20 61 20 62 65 74 61 20 |XThis is| a beta |
|00001a50| 72 65 6c 65 61 73 65 2e | 20 20 4d 6f 72 65 20 65 |release.| More e|
|00001a60| 78 74 65 6e 73 69 76 65 | 20 74 65 73 74 69 6e 67 |xtensive| testing|
|00001a70| 20 69 73 20 6e 65 65 64 | 65 64 2e 0a 58 2e 4c 50 | is need|ed..X.LP|
|00001a80| 0a 58 49 74 20 69 73 20 | 61 73 73 75 6d 65 64 20 |.XIt is |assumed |
|00001a90| 74 68 61 74 20 74 68 65 | 20 66 69 6c 65 6e 61 6d |that the| filenam|
|00001aa0| 65 73 20 61 72 65 20 77 | 72 69 74 74 65 6e 20 69 |es are w|ritten i|
|00001ab0| 6e 20 45 6e 67 6c 69 73 | 68 2e 0a 58 2e 4c 50 0a |n Englis|h..X.LP.|
|00001ac0| 58 54 68 65 20 61 75 74 | 68 6f 72 20 68 61 73 20 |XThe aut|hor has |
|00001ad0| 6e 65 76 65 72 20 69 6e | 20 68 69 73 20 6c 69 66 |never in| his lif|
|00001ae0| 65 20 73 65 65 6e 20 61 | 20 74 61 70 65 20 61 72 |e seen a| tape ar|
|00001af0| 63 68 69 76 65 20 63 72 | 65 61 74 65 64 20 6f 6e |chive cr|eated on|
|00001b00| 20 56 4d 53 2e 0a 58 2e | 4c 50 0a 58 4e 6f 74 20 | VMS..X.|LP.XNot |
|00001b10| 74 68 65 20 66 61 73 74 | 65 73 74 20 70 72 6f 67 |the fast|est prog|
|00001b20| 72 61 6d 20 61 72 6f 75 | 6e 64 2c 20 62 75 74 20 |ram arou|nd, but |
|00001b30| 74 68 65 20 70 72 69 63 | 65 20 69 73 20 72 69 67 |the pric|e is rig|
|00001b40| 68 74 2e 0a 45 4e 44 5f | 4f 46 5f 46 49 4c 45 0a |ht..END_|OF_FILE.|
|00001b50| 69 66 20 74 65 73 74 20 | 35 34 30 36 20 2d 6e 65 |if test |5406 -ne|
|00001b60| 20 60 77 63 20 2d 63 20 | 3c 27 74 61 72 66 69 78 | `wc -c |<'tarfix|
|00001b70| 2e 31 27 60 3b 20 74 68 | 65 6e 0a 20 20 20 20 65 |.1'`; th|en. e|
|00001b80| 63 68 6f 20 73 68 61 72 | 3a 20 5c 22 27 74 61 72 |cho shar|: \"'tar|
|00001b90| 66 69 78 2e 31 27 5c 22 | 20 75 6e 70 61 63 6b 65 |fix.1'\"| unpacke|
|00001ba0| 64 20 77 69 74 68 20 77 | 72 6f 6e 67 20 73 69 7a |d with w|rong siz|
|00001bb0| 65 21 0a 66 69 0a 23 20 | 65 6e 64 20 6f 66 20 27 |e!.fi.# |end of '|
|00001bc0| 74 61 72 66 69 78 2e 31 | 27 0a 66 69 0a 69 66 20 |tarfix.1|'.fi.if |
|00001bd0| 74 65 73 74 20 2d 66 20 | 27 74 61 72 66 69 78 27 |test -f |'tarfix'|
|00001be0| 20 2d 61 20 22 24 7b 31 | 7d 22 20 21 3d 20 22 2d | -a "${1|}" != "-|
|00001bf0| 63 22 20 3b 20 74 68 65 | 6e 20 0a 20 20 65 63 68 |c" ; the|n . ech|
|00001c00| 6f 20 73 68 61 72 3a 20 | 57 69 6c 6c 20 6e 6f 74 |o shar: |Will not|
|00001c10| 20 63 6c 6f 62 62 65 72 | 20 65 78 69 73 74 69 6e | clobber| existin|
|00001c20| 67 20 66 69 6c 65 20 5c | 22 27 74 61 72 66 69 78 |g file \|"'tarfix|
|00001c30| 27 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |'\".else|.echo sh|
|00001c40| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|00001c50| 22 27 74 61 72 66 69 78 | 27 5c 22 20 5c 28 31 30 |"'tarfix|'\" \(10|
|00001c60| 31 39 32 20 63 68 61 72 | 61 63 74 65 72 73 5c 29 |192 char|acters\)|
|00001c70| 0a 73 65 64 20 22 73 2f | 5e 58 2f 2f 22 20 3e 27 |.sed "s/|^X//" >'|
|00001c80| 74 61 72 66 69 78 27 20 | 3c 3c 27 45 4e 44 5f 4f |tarfix' |<<'END_O|
|00001c90| 46 5f 46 49 4c 45 27 0a | 58 23 21 2f 62 69 6e 2f |F_FILE'.|X#!/bin/|
|00001ca0| 70 65 72 6c 0a 58 40 52 | 45 4d 3d 28 22 0a 58 40 |perl.X@R|EM=(".X@|
|00001cb0| 70 65 72 6c 20 2d 53 20 | 25 30 2e 62 61 74 20 25 |perl -S |%0.bat %|
|00001cc0| 31 20 25 32 20 25 33 20 | 25 34 20 25 35 20 25 36 |1 %2 %3 |%4 %5 %6|
|00001cd0| 20 25 37 20 25 38 20 25 | 39 0a 58 40 67 6f 74 6f | %7 %8 %|9.X@goto|
|00001ce0| 20 65 6e 64 20 22 29 20 | 69 66 20 30 20 3b 0a 58 | end ") |if 0 ;.X|
|00001cf0| 23 0a 58 23 20 46 69 78 | 20 61 6e 64 20 63 6f 6e |#.X# Fix| and con|
|00001d00| 76 65 72 74 20 74 61 70 | 65 20 61 72 63 68 69 76 |vert tap|e archiv|
|00001d10| 65 73 0a 58 23 0a 58 23 | 20 28 43 29 20 43 6f 70 |es.X#.X#| (C) Cop|
|00001d20| 79 72 69 67 68 74 20 31 | 39 39 30 20 44 69 6f 6d |yright 1|990 Diom|
|00001d30| 69 64 69 73 20 53 70 69 | 6e 65 6c 6c 69 73 2e 20 |idis Spi|nellis. |
|00001d40| 20 41 6c 6c 20 72 69 67 | 68 74 73 20 72 65 73 65 | All rig|hts rese|
|00001d50| 72 76 65 64 2e 0a 58 23 | 0a 58 23 20 43 61 6e 20 |rved..X#|.X# Can |
|00001d60| 62 65 20 63 6f 70 69 65 | 64 20 61 6e 64 20 75 73 |be copie|d and us|
|00001d70| 65 64 20 61 73 20 6c 6f | 6e 67 20 61 73 20 74 68 |ed as lo|ng as th|
|00001d80| 65 20 63 6f 70 79 72 69 | 67 68 74 20 6e 6f 74 69 |e copyri|ght noti|
|00001d90| 63 65 20 69 73 20 72 65 | 74 61 69 6e 65 64 2e 0a |ce is re|tained..|
|00001da0| 58 23 20 4d 6f 64 69 66 | 69 65 64 20 63 6f 70 69 |X# Modif|ied copi|
|00001db0| 65 73 20 6d 75 73 74 20 | 62 65 20 6d 61 72 6b 65 |es must |be marke|
|00001dc0| 64 20 61 73 20 73 75 63 | 68 2e 0a 58 23 20 54 68 |d as suc|h..X# Th|
|00001dd0| 69 73 20 69 73 20 61 20 | 62 65 74 61 20 72 65 6c |is is a |beta rel|
|00001de0| 65 61 73 65 2e 20 20 55 | 73 65 20 74 68 69 73 20 |ease. U|se this |
|00001df0| 61 74 20 79 6f 75 72 20 | 6f 77 6e 20 72 69 73 6b |at your |own risk|
|00001e00| 2e 0a 58 23 20 49 20 77 | 6f 75 6c 64 20 61 70 70 |..X# I w|ould app|
|00001e10| 72 65 63 69 61 74 65 20 | 66 65 65 64 62 61 63 6b |reciate |feedback|
|00001e20| 20 6f 6e 20 62 75 67 73 | 2c 20 69 6d 70 72 6f 76 | on bugs|, improv|
|00001e30| 65 6d 65 6e 74 73 20 65 | 74 63 2e 0a 58 23 0a 58 |ements e|tc..X#.X|
|00001e40| 23 20 64 64 73 40 63 63 | 2e 69 63 2e 61 63 2e 75 |# dds@cc|.ic.ac.u|
|00001e50| 6b 0a 58 23 0a 58 23 20 | 54 68 69 73 20 70 72 6f |k.X#.X# |This pro|
|00001e60| 67 72 61 6d 20 49 53 20 | 4e 4f 54 20 45 46 46 49 |gram IS |NOT EFFI|
|00001e70| 43 49 45 4e 54 2e 0a 58 | 23 20 41 20 68 61 76 65 |CIENT..X|# A have|
|00001e80| 20 74 72 69 65 64 20 69 | 6e 73 74 65 61 64 20 74 | tried i|nstead t|
|00001e90| 6f 20 6d 61 6b 65 20 69 | 74 20 72 65 61 64 61 62 |o make i|t readab|
|00001ea0| 6c 65 2c 20 66 6c 65 78 | 69 62 6c 65 20 61 6e 64 |le, flex|ible and|
|00001eb0| 20 65 61 73 79 20 74 6f | 20 75 73 65 2e 0a 58 23 | easy to| use..X#|
|00001ec0| 20 46 6f 72 20 74 68 69 | 73 20 49 20 75 73 65 20 | For thi|s I use |
|00001ed0| 6c 6f 74 73 20 6f 66 20 | 73 75 62 72 6f 75 74 69 |lots of |subrouti|
|00001ee0| 6e 65 73 2c 20 6c 6f 63 | 61 6c 20 76 61 72 69 61 |nes, loc|al varia|
|00001ef0| 62 6c 65 73 20 61 6e 64 | 20 68 69 67 68 65 72 20 |bles and| higher |
|00001f00| 6f 72 64 65 72 20 0a 58 | 23 20 66 75 6e 63 74 69 |order .X|# functi|
|00001f10| 6f 6e 73 2e 20 20 49 66 | 20 79 6f 75 20 77 61 6e |ons. If| you wan|
|00001f20| 74 20 73 6f 6d 65 74 68 | 69 6e 67 20 65 66 66 69 |t someth|ing effi|
|00001f30| 63 69 65 6e 74 20 72 65 | 77 72 69 74 65 20 69 74 |cient re|write it|
|00001f40| 20 69 6e 20 43 2e 0a 58 | 23 0a 58 23 20 59 6f 75 | in C..X|#.X# You|
|00001f50| 20 63 61 6e 20 76 65 72 | 79 20 65 61 73 69 6c 79 | can ver|y easily|
|00001f60| 20 61 64 64 20 61 20 6e | 65 77 20 63 6f 6e 76 65 | add a n|ew conve|
|00001f70| 72 73 69 6f 6e 20 6d 6f | 64 65 2e 20 20 4a 75 73 |rsion mo|de. Jus|
|00001f80| 74 20 61 64 64 20 74 68 | 65 20 63 6f 6e 76 65 72 |t add th|e conver|
|00001f90| 73 69 6f 6e 0a 58 23 20 | 66 75 6e 63 74 69 6f 6e |sion.X# |function|
|00001fa0| 2e 20 20 49 66 20 74 68 | 65 20 63 6f 6e 76 65 72 |. If th|e conver|
|00001fb0| 73 69 6f 6e 20 66 75 6e | 63 74 69 6f 6e 20 6e 65 |sion fun|ction ne|
|00001fc0| 65 64 73 20 74 6f 20 62 | 65 20 61 70 70 6c 69 65 |eds to b|e applie|
|00001fd0| 64 20 74 6f 20 65 76 65 | 72 79 0a 58 23 20 66 69 |d to eve|ry.X# fi|
|00001fe0| 6c 65 6e 61 6d 65 20 63 | 6f 6d 70 6f 6e 65 6e 74 |lename c|omponent|
|00001ff0| 20 61 64 64 20 61 20 6d | 61 70 20 66 75 6e 63 74 | add a m|ap funct|
|00002000| 69 6f 6e 20 61 6e 64 20 | 61 20 66 75 6e 63 74 69 |ion and |a functi|
|00002010| 6f 6e 20 74 6f 20 70 72 | 65 70 61 72 65 20 61 20 |on to pr|epare a |
|00002020| 63 6f 6d 70 6f 6e 65 6e | 74 0a 58 23 20 74 6f 20 |componen|t.X# to |
|00002030| 68 61 76 65 20 61 63 6f | 75 6e 74 65 72 20 61 64 |have aco|unter ad|
|00002040| 64 65 64 20 74 6f 20 69 | 74 2e 0a 58 23 20 49 66 |ded to i|t..X# If|
|00002050| 20 79 6f 75 20 6e 65 65 | 64 20 74 6f 20 63 6f 6e | you nee|d to con|
|00002060| 76 65 72 74 20 61 6e 6f | 74 68 65 72 20 70 61 72 |vert ano|ther par|
|00002070| 74 20 6f 66 20 74 68 65 | 20 68 65 61 64 65 72 20 |t of the| header |
|00002080| 28 65 2e 67 2e 20 75 69 | 64 29 20 73 65 61 72 63 |(e.g. ui|d) searc|
|00002090| 68 20 66 6f 72 20 74 68 | 65 0a 58 23 20 73 74 72 |h for th|e.X# str|
|000020a0| 69 6e 67 20 48 45 41 44 | 45 52 4d 4f 44 20 69 6e |ing HEAD|ERMOD in|
|000020b0| 20 74 68 69 73 20 66 69 | 6c 65 2e 0a 58 0a 58 64 | this fi|le..X.Xd|
|000020c0| 6f 20 27 67 65 74 6f 70 | 74 73 2e 70 6c 27 20 7c |o 'getop|ts.pl' ||
|000020d0| 7c 20 64 69 65 20 22 24 | 30 3a 20 55 6e 61 62 6c || die "$|0: Unabl|
|000020e0| 65 20 74 6f 20 66 69 6e | 64 20 67 65 74 6f 70 74 |e to fin|d getopt|
|000020f0| 73 20 6c 69 62 72 61 72 | 79 3a 20 24 21 5c 6e 22 |s librar|y: $!\n"|
|00002100| 3b 0a 58 26 47 65 74 6f | 70 74 73 28 27 6d 6e 63 |;.X&Geto|pts('mnc|
|00002110| 61 66 3a 74 3a 73 3a 27 | 29 20 7c 7c 20 24 75 73 |af:t:s:'|) || $us|
|00002120| 61 67 65 2b 2b 3b 0a 58 | 0a 58 24 63 6f 75 6e 74 |age++;.X|.X$count|
|00002130| 20 3d 20 30 3b 0a 58 24 | 70 72 6f 63 20 3d 20 27 | = 0;.X$|proc = '|
|00002140| 63 6f 70 79 27 3b 0a 58 | 0a 58 69 66 20 28 24 6f |copy';.X|.Xif ($o|
|00002150| 70 74 5f 63 29 20 7b 0a | 58 09 24 70 72 6f 63 20 |pt_c) {.|X.$proc |
|00002160| 3d 20 27 63 61 6e 6f 6e | 69 63 27 3b 0a 58 09 24 |= 'canon|ic';.X.$|
|00002170| 63 6f 75 6e 74 2b 2b 3b | 0a 58 7d 0a 58 69 66 20 |count++;|.X}.Xif |
|00002180| 28 24 6f 70 74 5f 61 29 | 20 7b 0a 58 09 24 70 72 |($opt_a)| {.X.$pr|
|00002190| 6f 63 20 3d 20 27 6e 6f | 61 62 73 27 3b 0a 58 09 |oc = 'no|abs';.X.|
|000021a0| 24 63 6f 75 6e 74 2b 2b | 3b 0a 58 7d 0a 58 69 66 |$count++|;.X}.Xif|
|000021b0| 20 28 24 6f 70 74 5f 66 | 29 20 7b 0a 58 09 24 70 | ($opt_f|) {.X.$p|
|000021c0| 72 6f 63 20 3d 20 27 66 | 72 6f 6d 5f 27 20 2e 20 |roc = 'f|rom_' . |
|000021d0| 24 6f 70 74 5f 66 3b 0a | 58 09 24 63 6f 75 6e 74 |$opt_f;.|X.$count|
|000021e0| 2b 2b 3b 0a 58 7d 0a 58 | 69 66 20 28 24 6f 70 74 |++;.X}.X|if ($opt|
|000021f0| 5f 74 29 20 7b 0a 58 09 | 24 70 72 6f 63 20 3d 20 |_t) {.X.|$proc = |
|00002200| 27 74 6f 5f 27 20 2e 20 | 24 6f 70 74 5f 74 3b 0a |'to_' . |$opt_t;.|
|00002210| 58 09 24 63 6f 75 6e 74 | 2b 2b 3b 0a 58 7d 0a 58 |X.$count|++;.X}.X|
|00002220| 69 66 20 28 24 6f 70 74 | 5f 73 29 20 7b 0a 58 09 |if ($opt|_s) {.X.|
|00002230| 24 70 72 6f 63 20 3d 20 | 27 75 73 65 72 73 68 6f |$proc = |'usersho|
|00002240| 72 74 27 3b 0a 58 09 24 | 75 73 65 72 73 68 6f 72 |rt';.X.$|usershor|
|00002250| 74 6c 65 6e 20 3d 20 24 | 6f 70 74 5f 73 3b 0a 58 |tlen = $|opt_s;.X|
|00002260| 09 24 63 6f 75 6e 74 2b | 2b 3b 0a 58 7d 0a 58 0a |.$count+|+;.X}.X.|
|00002270| 58 69 66 20 28 24 63 6f | 75 6e 74 20 3e 20 31 29 |Xif ($co|unt > 1)|
|00002280| 20 7b 0a 58 09 70 72 69 | 6e 74 20 53 54 44 45 52 | {.X.pri|nt STDER|
|00002290| 52 20 22 24 30 3a 20 4f | 6e 6c 79 20 6f 6e 65 20 |R "$0: O|nly one |
|000022a0| 6f 66 20 2d 63 20 2d 61 | 20 2d 66 20 2d 74 20 2d |of -c -a| -f -t -|
|000022b0| 73 20 63 61 6e 20 62 65 | 20 73 70 65 63 69 66 69 |s can be| specifi|
|000022c0| 65 64 5c 6e 22 3b 0a 58 | 09 24 75 73 61 67 65 2b |ed\n";.X|.$usage+|
|000022d0| 2b 3b 0a 58 7d 0a 58 0a | 58 69 66 20 28 21 20 65 |+;.X}.X.|Xif (! e|
|000022e0| 76 61 6c 28 27 26 27 20 | 2e 20 24 70 72 6f 63 20 |val('&' |. $proc |
|000022f0| 2e 20 27 28 22 66 6f 6f | 22 29 3b 27 29 29 20 7b |. '("foo|");')) {|
|00002300| 0a 58 09 70 72 69 6e 74 | 20 53 54 44 45 52 52 20 |.X.print| STDERR |
|00002310| 22 24 30 3a 20 42 61 64 | 20 6f 70 74 69 6f 6e 20 |"$0: Bad| option |
|00002320| 73 70 65 63 69 66 69 65 | 64 20 24 70 72 6f 63 5c |specifie|d $proc\|
|00002330| 6e 22 3b 0a 58 09 24 75 | 73 61 67 65 2b 2b 3b 0a |n";.X.$u|sage++;.|
|00002340| 58 7d 0a 58 64 65 6c 65 | 74 65 20 24 6d 61 70 7b |X}.Xdele|te $map{|
|00002350| 27 66 6f 6f 27 7d 3b 0a | 58 0a 58 0a 58 69 66 20 |'foo'};.|X.X.Xif |
|00002360| 28 24 75 73 61 67 65 29 | 20 7b 0a 58 09 70 72 69 |($usage)| {.X.pri|
|00002370| 6e 74 20 53 54 44 45 52 | 52 20 22 55 73 61 67 65 |nt STDER|R "Usage|
|00002380| 3a 20 24 30 20 2d 6e 20 | 2d 63 20 2d 61 20 2d 73 |: $0 -n |-c -a -s|
|00002390| 20 4e 20 2d 66 20 6d 73 | 64 6f 73 7c 76 6d 73 20 | N -f ms|dos|vms |
|000023a0| 2d 74 20 6d 73 64 6f 73 | 7c 76 37 22 3b 0a 58 09 |-t msdos||v7";.X.|
|000023b0| 70 72 69 6e 74 20 53 54 | 44 45 52 52 20 22 0a 58 |print ST|DERR ".X|
|000023c0| 09 2d 6e 20 44 6f 20 6e | 6f 74 20 77 6f 72 6b 20 |.-n Do n|ot work |
|000023d0| 6f 6e 20 74 61 72 20 66 | 69 6c 65 73 2e 20 20 52 |on tar f|iles. R|
|000023e0| 65 61 64 20 61 6e 64 20 | 70 72 69 6e 74 20 61 20 |ead and |print a |
|000023f0| 6c 69 73 74 20 6f 66 20 | 66 69 6c 65 20 6e 61 6d |list of |file nam|
|00002400| 65 73 2e 0a 58 09 2d 63 | 20 43 61 6e 6f 6e 69 63 |es..X.-c| Canonic|
|00002410| 61 6c 69 73 65 20 66 69 | 6c 65 6e 61 6d 65 73 20 |alise fi|lenames |
|00002420| 62 79 20 72 65 6d 6f 76 | 69 6e 67 20 2f 2e 2e 2f |by remov|ing /../|
|00002430| 2c 20 2f 2e 2f 20 61 6e | 64 20 2f 2f 2e 0a 58 09 |, /./ an|d //..X.|
|00002440| 2d 61 20 46 69 78 20 61 | 62 73 6f 6c 75 74 65 20 |-a Fix a|bsolute |
|00002450| 66 69 6c 65 6e 61 6d 65 | 73 20 62 79 20 72 65 6d |filename|s by rem|
|00002460| 6f 76 69 6e 67 20 6c 65 | 61 64 69 6e 67 20 2f 2e |oving le|ading /.|
|00002470| 0a 58 09 2d 73 20 43 6f | 6e 76 65 72 74 20 66 69 |.X.-s Co|nvert fi|
|00002480| 6c 65 6e 61 6d 65 73 20 | 74 6f 20 74 68 65 20 73 |lenames |to the s|
|00002490| 70 65 63 69 66 69 65 64 | 20 6c 65 6e 67 74 68 20 |pecified| length |
|000024a0| 4e 2e 0a 58 09 2d 66 20 | 43 6f 6e 76 65 72 74 20 |N..X.-f |Convert |
|000024b0| 66 72 6f 6d 20 66 6f 72 | 6d 61 74 2e 20 20 46 6f |from for|mat. Fo|
|000024c0| 72 6d 61 74 20 63 61 6e | 20 62 65 20 6d 73 64 6f |rmat can| be msdo|
|000024d0| 73 20 6f 72 20 76 6d 73 | 2e 0a 58 09 2d 74 20 43 |s or vms|..X.-t C|
|000024e0| 6f 6e 76 65 72 74 20 74 | 6f 20 66 6f 72 6d 61 74 |onvert t|o format|
|000024f0| 2e 20 20 46 6f 72 6d 61 | 74 20 63 61 6e 20 62 65 |. Forma|t can be|
|00002500| 20 76 37 20 28 37 74 68 | 20 45 64 69 74 69 6f 6e | v7 (7th| Edition|
|00002510| 29 20 6f 72 20 6d 73 64 | 6f 73 2e 0a 58 09 2d 6d |) or msd|os..X.-m|
|00002520| 20 50 72 69 6e 74 20 61 | 20 6d 61 70 20 74 61 62 | Print a| map tab|
|00002530| 6c 65 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 69 6e |le conta|ining in|
|00002540| 69 74 69 61 6c 20 61 6e | 64 20 66 69 6e 61 6c 20 |itial an|d final |
|00002550| 6e 61 6d 65 20 6f 6e 20 | 73 74 64 65 72 72 2e 0a |name on |stderr..|
|00002560| 58 0a 58 09 4f 6e 6c 79 | 20 6f 6e 65 20 6f 66 20 |X.X.Only| one of |
|00002570| 2d 63 20 2d 61 20 2d 66 | 20 2d 74 20 2d 73 20 63 |-c -a -f| -t -s c|
|00002580| 61 6e 20 62 65 20 73 70 | 65 63 69 66 69 65 64 2e |an be sp|ecified.|
|00002590| 5c 6e 22 3b 0a 58 09 65 | 78 69 74 20 31 3b 0a 58 |\n";.X.e|xit 1;.X|
|000025a0| 7d 0a 58 0a 58 69 66 20 | 28 24 6f 70 74 5f 6e 29 |}.X.Xif |($opt_n)|
|000025b0| 20 7b 0a 58 09 77 68 69 | 6c 65 20 28 3c 3e 29 20 | {.X.whi|le (<>) |
|000025c0| 7b 0a 58 09 09 73 2f 5c | 6e 24 2f 2f 3b 0a 58 09 |{.X..s/\|n$//;.X.|
|000025d0| 09 70 72 69 6e 74 20 26 | 24 70 72 6f 63 28 24 5f |.print &|$proc($_|
|000025e0| 29 2c 20 22 5c 6e 22 3b | 0a 58 09 7d 0a 58 7d 20 |), "\n";|.X.}.X} |
|000025f0| 65 6c 73 65 20 7b 0a 58 | 09 26 63 6f 70 79 74 61 |else {.X|.&copyta|
|00002600| 72 28 29 3b 0a 58 7d 0a | 58 0a 58 69 66 20 28 24 |r();.X}.|X.Xif ($|
|00002610| 6f 70 74 5f 6d 29 20 7b | 0a 58 09 77 68 69 6c 65 |opt_m) {|.X.while|
|00002620| 20 28 28 24 66 72 6f 6d | 2c 20 24 74 6f 29 20 3d | (($from|, $to) =|
|00002630| 20 65 61 63 68 28 25 6d | 61 70 29 29 20 7b 0a 58 | each(%m|ap)) {.X|
|00002640| 09 09 70 72 69 6e 74 20 | 53 54 44 45 52 52 20 22 |..print |STDERR "|
|00002650| 24 66 72 6f 6d 20 24 74 | 6f 5c 6e 22 3b 0a 58 09 |$from $t|o\n";.X.|
|00002660| 7d 0a 58 7d 0a 58 0a 58 | 65 78 69 74 20 30 3b 0a |}.X}.X.X|exit 0;.|
|00002670| 58 0a 58 23 20 52 65 6d | 6f 76 65 20 61 62 73 6f |X.X# Rem|ove abso|
|00002680| 6c 75 74 65 20 66 69 6c | 65 20 6e 61 6d 65 73 2e |lute fil|e names.|
|00002690| 0a 58 23 20 57 65 20 63 | 61 6e 6f 6e 69 63 61 6c |.X# We c|anonical|
|000026a0| 69 73 65 20 73 69 6e 63 | 65 20 66 6f 6f 2f 2f 62 |ise sinc|e foo//b|
|000026b0| 61 72 20 69 73 20 2f 62 | 61 72 20 6f 6e 20 6d 61 |ar is /b|ar on ma|
|000026c0| 6e 79 20 55 6e 69 78 65 | 73 0a 58 73 75 62 20 6e |ny Unixe|s.Xsub n|
|000026d0| 6f 61 62 73 20 7b 0a 58 | 09 6c 6f 63 61 6c 28 24 |oabs {.X|.local($|
|000026e0| 6e 61 6d 65 29 20 3d 20 | 24 5f 5b 30 5d 3b 0a 58 |name) = |$_[0];.X|
|000026f0| 0a 58 09 20 24 6e 61 6d | 65 20 3d 20 26 63 61 6e |.X. $nam|e = &can|
|00002700| 6f 6e 69 63 28 24 6e 61 | 6d 65 29 3b 0a 58 09 20 |onic($na|me);.X. |
|00002710| 24 6e 61 6d 65 20 3d 7e | 20 73 2f 5e 5c 2f 2f 2f |$name =~| s/^\///|
|00002720| 3b 0a 58 09 20 72 65 74 | 75 72 6e 20 24 6e 61 6d |;.X. ret|urn $nam|
|00002730| 65 3b 0a 58 7d 0a 58 0a | 58 23 20 43 6f 6e 76 65 |e;.X}.X.|X# Conve|
|00002740| 72 74 20 74 6f 20 4d 53 | 2d 44 4f 53 0a 58 23 20 |rt to MS|-DOS.X# |
|00002750| 2d 20 53 68 6f 72 74 65 | 6e 20 6e 61 6d 65 20 74 |- Shorte|n name t|
|00002760| 6f 20 38 20 63 68 61 72 | 61 63 74 65 72 73 0a 58 |o 8 char|acters.X|
|00002770| 23 20 2d 20 52 65 6d 6f | 76 65 20 61 6c 6c 20 64 |# - Remo|ve all d|
|00002780| 6f 74 73 2c 20 62 75 74 | 20 74 68 65 20 6c 61 73 |ots, but| the las|
|00002790| 74 20 6f 6e 65 0a 58 23 | 20 2d 20 53 68 6f 72 74 |t one.X#| - Short|
|000027a0| 65 6e 20 65 78 74 65 6e | 73 69 6f 6e 20 74 6f 20 |en exten|sion to |
|000027b0| 33 20 63 68 61 72 61 63 | 74 65 72 73 0a 58 23 20 |3 charac|ters.X# |
|000027c0| 2d 20 43 6f 6e 76 65 72 | 74 20 2c 3d 2b 3c 3e 7c |- Conver|t ,=+<>||
|000027d0| 3b 20 2a 3f 3a 5b 5d 5c | 22 20 74 6f 20 5e 0a 58 |; *?:[]\|" to ^.X|
|000027e0| 23 20 2d 20 43 6f 6e 76 | 65 72 74 20 64 65 76 69 |# - Conv|ert devi|
|000027f0| 63 65 20 6e 61 6d 65 20 | 28 63 6f 6e 2c 20 61 75 |ce name |(con, au|
|00002800| 78 20 2e 2e 2e 29 20 74 | 6f 20 5f 64 65 76 69 63 |x ...) t|o _devic|
|00002810| 65 0a 58 73 75 62 20 74 | 6f 5f 6d 73 64 6f 73 20 |e.Xsub t|o_msdos |
|00002820| 7b 0a 58 09 6c 6f 63 61 | 6c 28 24 6e 6d 29 3b 0a |{.X.loca|l($nm);.|
|00002830| 58 0a 58 09 24 6e 6d 20 | 3d 20 24 5f 5b 30 5d 3b |X.X.$nm |= $_[0];|
|00002840| 0a 58 09 72 65 74 75 72 | 6e 20 26 66 69 6c 65 6d |.X.retur|n &filem|
|00002850| 61 70 28 24 6e 6d 2c 20 | 27 6d 61 70 6d 73 64 6f |ap($nm, |'mapmsdo|
|00002860| 73 27 2c 20 27 63 6f 75 | 6e 74 70 72 65 70 6d 73 |s', 'cou|ntprepms|
|00002870| 64 6f 73 27 29 3b 0a 58 | 09 23 20 54 68 65 20 66 |dos');.X|.# The f|
|00002880| 6f 6c 6c 6f 77 69 6e 67 | 20 6c 69 6e 65 20 66 61 |ollowing| line fa|
|00002890| 69 6c 73 20 6f 6e 20 70 | 65 72 6c 20 33 2e 30 20 |ils on p|erl 3.0 |
|000028a0| 70 61 74 63 68 6c 65 76 | 65 6c 20 31 38 20 58 58 |patchlev|el 18 XX|
|000028b0| 58 0a 58 09 23 20 72 65 | 74 75 72 6e 20 26 66 69 |X.X.# re|turn &fi|
|000028c0| 6c 65 6d 61 70 28 24 5f | 5b 30 5d 2c 20 27 6d 61 |lemap($_|[0], 'ma|
|000028d0| 70 6d 73 64 6f 73 27 2c | 20 27 63 6f 75 6e 74 70 |pmsdos',| 'countp|
|000028e0| 72 65 70 6d 73 64 6f 73 | 27 29 3b 0a 58 7d 0a 58 |repmsdos|');.X}.X|
|000028f0| 0a 58 23 20 53 68 6f 72 | 74 65 6e 69 6e 67 20 72 |.X# Shor|tening r|
|00002900| 6f 75 74 69 6e 65 20 66 | 6f 72 20 4d 53 2d 44 4f |outine f|or MS-DO|
|00002910| 53 0a 58 73 75 62 20 6d | 61 70 6d 73 64 6f 73 20 |S.Xsub m|apmsdos |
|00002920| 7b 0a 58 09 6c 6f 63 61 | 6c 28 24 6e 61 6d 65 29 |{.X.loca|l($name)|
|00002930| 20 3d 20 24 5f 5b 30 5d | 3b 0a 58 09 6c 6f 63 61 | = $_[0]|;.X.loca|
|00002940| 6c 28 24 65 78 74 29 3b | 0a 58 0a 58 09 23 20 4c |l($ext);|.X.X.# L|
|00002950| 65 61 76 65 20 6f 6e 6c | 79 20 74 68 65 20 6c 61 |eave onl|y the la|
|00002960| 73 74 20 64 6f 74 0a 58 | 09 77 68 69 6c 65 20 28 |st dot.X|.while (|
|00002970| 24 6e 61 6d 65 20 3d 7e | 20 73 2f 28 2e 2a 29 5c |$name =~| s/(.*)\|
|00002980| 2e 28 2e 2a 29 5c 2e 28 | 2e 2a 29 2f 5c 31 5f 5c |.(.*)\.(|.*)/\1_\|
|00002990| 32 2e 5c 33 2f 67 29 20 | 7b 20 0a 58 09 09 3b 0a |2.\3/g) |{ .X..;.|
|000029a0| 58 09 7d 0a 58 09 23 20 | 43 6f 6e 76 65 72 74 20 |X.}.X.# |Convert |
|000029b0| 66 75 6e 6e 79 20 63 68 | 61 72 61 63 74 65 72 73 |funny ch|aracters|
|000029c0| 20 74 6f 20 5e 0a 58 09 | 24 6e 61 6d 65 20 3d 7e | to ^.X.|$name =~|
|000029d0| 20 73 2f 5b 2c 3d 2b 3c | 3e 7c 3b 20 2a 3f 3a 5b | s/[,=+<|>|; *?:[|
|000029e0| 5c 5d 5c 5c 5d 2f 5e 2f | 67 3b 0a 58 09 23 20 53 |\]\\]/^/|g;.X.# S|
|000029f0| 68 6f 72 74 65 6e 20 74 | 68 65 20 6e 61 6d 65 0a |horten t|he name.|
|00002a00| 58 09 69 66 20 28 24 6e | 61 6d 65 20 3d 7e 20 6d |X.if ($n|ame =~ m|
|00002a10| 2f 5c 2e 2f 29 20 7b 0a | 58 09 09 28 24 6e 61 6d |/\./) {.|X..($nam|
|00002a20| 65 2c 20 24 65 78 74 29 | 20 3d 20 73 70 6c 69 74 |e, $ext)| = split|
|00002a30| 28 2f 5c 2e 2f 2c 20 24 | 6e 61 6d 65 29 3b 0a 58 |(/\./, $|name);.X|
|00002a40| 09 09 24 6e 61 6d 65 20 | 3d 7e 20 73 2f 5e 28 28 |..$name |=~ s/^((|
|00002a50| 63 6f 6e 29 7c 28 61 75 | 78 5b 31 2d 34 5d 3f 29 |con)|(au|x[1-4]?)|
|00002a60| 7c 28 70 72 6e 29 7c 28 | 6c 70 74 5b 31 2d 33 5d ||(prn)|(|lpt[1-3]|
|00002a70| 29 7c 28 63 6c 6f 63 6b | 5c 24 29 29 24 2f 5f 5c |)|(clock|\$))$/_\|
|00002a80| 31 2f 69 3b 0a 58 09 09 | 72 65 74 75 72 6e 20 26 |1/i;.X..|return &|
|00002a90| 73 68 6f 72 74 65 6e 28 | 24 6e 61 6d 65 2c 20 38 |shorten(|$name, 8|
|00002aa0| 29 20 2e 20 27 2e 27 20 | 2e 20 26 73 68 6f 72 74 |) . '.' |. &short|
|00002ab0| 65 6e 28 24 65 78 74 2c | 20 33 29 3b 0a 58 09 7d |en($ext,| 3);.X.}|
|00002ac0| 20 65 6c 73 65 20 7b 0a | 58 09 09 24 6e 61 6d 65 | else {.|X..$name|
|00002ad0| 20 3d 7e 20 73 2f 5e 28 | 28 63 6f 6e 29 7c 28 61 | =~ s/^(|(con)|(a|
|00002ae0| 75 78 5b 31 2d 34 5d 3f | 29 7c 28 70 72 6e 29 7c |ux[1-4]?|)|(prn)||
|00002af0| 28 6c 70 74 5b 31 2d 33 | 5d 29 7c 28 63 6c 6f 63 |(lpt[1-3|])|(cloc|
|00002b00| 6b 5c 24 29 29 24 2f 5f | 5c 31 2f 69 3b 0a 58 09 |k\$))$/_|\1/i;.X.|
|00002b10| 09 72 65 74 75 72 6e 20 | 26 73 68 6f 72 74 65 6e |.return |&shorten|
|00002b20| 28 24 6e 61 6d 65 2c 20 | 38 29 3b 0a 58 09 7d 0a |($name, |8);.X.}.|
|00002b30| 58 7d 0a 58 0a 58 23 20 | 43 6f 75 6e 74 20 70 72 |X}.X.X# |Count pr|
|00002b40| 65 70 61 72 61 74 69 6f | 6e 20 72 6f 75 74 69 6e |eparatio|n routin|
|00002b50| 65 20 66 6f 72 20 4d 53 | 2d 44 4f 53 0a 58 73 75 |e for MS|-DOS.Xsu|
|00002b60| 62 20 63 6f 75 6e 74 70 | 72 65 70 6d 73 64 6f 73 |b countp|repmsdos|
|00002b70| 20 7b 0a 58 09 6c 6f 63 | 61 6c 28 24 6e 61 6d 65 | {.X.loc|al($name|
|00002b80| 29 20 3d 20 24 5f 5b 30 | 5d 3b 0a 58 09 6c 6f 63 |) = $_[0|];.X.loc|
|00002b90| 61 6c 28 24 65 78 74 29 | 3b 0a 58 09 0a 58 09 69 |al($ext)|;.X..X.i|
|00002ba0| 66 20 28 24 6e 61 6d 65 | 20 3d 7e 20 6d 2f 5c 2e |f ($name| =~ m/\.|
|00002bb0| 2f 29 20 7b 0a 58 09 09 | 28 24 6e 61 6d 65 2c 20 |/) {.X..|($name, |
|00002bc0| 24 65 78 74 29 20 3d 20 | 73 70 6c 69 74 28 2f 5c |$ext) = |split(/\|
|00002bd0| 2e 2f 2c 20 24 6e 61 6d | 65 29 3b 0a 58 09 09 72 |./, $nam|e);.X..r|
|00002be0| 65 74 75 72 6e 20 24 6e | 61 6d 65 20 2e 20 27 2e |eturn $n|ame . '.|
|00002bf0| 27 20 2e 20 73 75 62 73 | 74 72 28 24 65 78 74 2c |' . subs|tr($ext,|
|00002c00| 20 30 2c 20 31 29 3b 0a | 58 09 7d 20 65 6c 73 65 | 0, 1);.|X.} else|
|00002c10| 20 7b 0a 58 09 09 72 65 | 74 75 72 6e 20 24 6e 61 | {.X..re|turn $na|
|00002c20| 6d 65 20 2e 20 27 2e 27 | 3b 0a 58 09 7d 0a 58 7d |me . '.'|;.X.}.X}|
|00002c30| 0a 58 0a 58 0a 58 23 20 | 43 6f 6e 76 65 72 74 20 |.X.X.X# |Convert |
|00002c40| 74 6f 20 37 74 68 20 45 | 64 69 74 69 6f 6e 20 74 |to 7th E|dition t|
|00002c50| 79 70 65 20 66 69 6c 65 | 73 79 73 74 65 6d 73 0a |ype file|systems.|
|00002c60| 58 23 20 2d 20 53 68 6f | 72 74 65 6e 20 66 69 6c |X# - Sho|rten fil|
|00002c70| 65 6e 61 6d 65 73 20 74 | 6f 20 31 34 20 63 68 61 |enames t|o 14 cha|
|00002c80| 72 61 63 74 65 72 73 0a | 58 73 75 62 20 74 6f 5f |racters.|Xsub to_|
|00002c90| 76 37 20 7b 0a 58 09 6c | 6f 63 61 6c 28 24 6e 6d |v7 {.X.l|ocal($nm|
|00002ca0| 29 3b 0a 58 0a 58 09 24 | 6e 6d 20 3d 20 24 5f 5b |);.X.X.$|nm = $_[|
|00002cb0| 30 5d 3b 0a 58 09 72 65 | 74 75 72 6e 20 26 66 69 |0];.X.re|turn &fi|
|00002cc0| 6c 65 6d 61 70 28 24 6e | 6d 2c 20 27 6d 61 70 76 |lemap($n|m, 'mapv|
|00002cd0| 37 27 2c 20 27 63 6f 75 | 6e 74 70 72 65 70 76 37 |7', 'cou|ntprepv7|
|00002ce0| 27 29 3b 0a 58 7d 0a 58 | 0a 58 23 20 53 68 6f 72 |');.X}.X|.X# Shor|
|00002cf0| 74 65 6e 69 6e 67 20 72 | 6f 75 74 69 6e 65 20 66 |tening r|outine f|
|00002d00| 6f 72 20 56 37 0a 58 73 | 75 62 20 6d 61 70 76 37 |or V7.Xs|ub mapv7|
|00002d10| 20 7b 0a 58 09 72 65 74 | 75 72 6e 20 26 73 68 6f | {.X.ret|urn &sho|
|00002d20| 72 74 65 6e 28 24 5f 5b | 30 5d 2c 20 31 34 29 3b |rten($_[|0], 14);|
|00002d30| 0a 58 7d 0a 58 0a 58 23 | 20 43 6f 75 6e 74 20 70 |.X}.X.X#| Count p|
|00002d40| 72 65 70 61 72 61 74 69 | 6f 6e 20 72 6f 75 74 69 |reparati|on routi|
|00002d50| 6e 65 20 66 6f 72 20 56 | 37 0a 58 73 75 62 20 63 |ne for V|7.Xsub c|
|00002d60| 6f 75 6e 74 70 72 65 70 | 76 37 20 7b 0a 58 09 72 |ountprep|v7 {.X.r|
|00002d70| 65 74 75 72 6e 20 73 75 | 62 73 74 72 28 24 5f 5b |eturn su|bstr($_[|
|00002d80| 30 5d 2c 20 30 2c 20 31 | 32 29 3b 0a 58 7d 0a 58 |0], 0, 1|2);.X}.X|
|00002d90| 0a 58 23 20 53 68 6f 72 | 74 65 6e 20 74 68 65 20 |.X# Shor|ten the |
|00002da0| 66 69 6c 65 6e 61 6d 65 | 20 63 6f 6d 70 6f 6e 65 |filename| compone|
|00002db0| 6e 74 73 20 62 79 20 61 | 20 75 73 65 72 20 73 70 |nts by a| user sp|
|00002dc0| 65 63 69 66 69 65 64 20 | 61 6d 6f 75 6e 74 0a 58 |ecified |amount.X|
|00002dd0| 73 75 62 20 75 73 65 72 | 73 68 6f 72 74 20 7b 0a |sub user|short {.|
|00002de0| 58 09 6c 6f 63 61 6c 28 | 24 6e 6d 29 3b 0a 58 0a |X.local(|$nm);.X.|
|00002df0| 58 09 24 6e 6d 20 3d 20 | 24 5f 5b 30 5d 3b 0a 58 |X.$nm = |$_[0];.X|
|00002e00| 09 72 65 74 75 72 6e 20 | 26 66 69 6c 65 6d 61 70 |.return |&filemap|
|00002e10| 28 24 6e 6d 2c 20 27 6d | 61 70 75 73 65 72 73 68 |($nm, 'm|apusersh|
|00002e20| 6f 72 74 27 2c 20 27 63 | 6f 75 6e 74 70 72 65 70 |ort', 'c|ountprep|
|00002e30| 75 73 65 72 73 68 6f 72 | 74 27 29 3b 0a 58 7d 0a |usershor|t');.X}.|
|00002e40| 58 0a 58 23 20 53 68 6f | 72 74 65 6e 69 6e 67 20 |X.X# Sho|rtening |
|00002e50| 72 6f 75 74 69 6e 65 20 | 66 6f 72 20 75 73 65 72 |routine |for user|
|00002e60| 73 68 6f 72 74 0a 58 73 | 75 62 20 6d 61 70 75 73 |short.Xs|ub mapus|
|00002e70| 65 72 73 68 6f 72 74 20 | 7b 0a 58 09 72 65 74 75 |ershort |{.X.retu|
|00002e80| 72 6e 20 26 73 68 6f 72 | 74 65 6e 28 24 5f 5b 30 |rn &shor|ten($_[0|
|00002e90| 5d 2c 20 24 75 73 65 72 | 73 68 6f 72 74 6c 65 6e |], $user|shortlen|
|00002ea0| 29 3b 0a 58 7d 0a 58 0a | 58 23 20 43 6f 75 6e 74 |);.X}.X.|X# Count|
|00002eb0| 20 70 72 65 70 61 72 61 | 74 69 6f 6e 20 72 6f 75 | prepara|tion rou|
|00002ec0| 74 69 6e 65 20 66 6f 72 | 20 75 73 65 72 73 68 6f |tine for| usersho|
|00002ed0| 72 74 0a 58 73 75 62 20 | 63 6f 75 6e 74 70 72 65 |rt.Xsub |countpre|
|00002ee0| 70 75 73 65 72 73 68 6f | 72 74 20 7b 0a 58 09 72 |pusersho|rt {.X.r|
|00002ef0| 65 74 75 72 6e 20 73 75 | 62 73 74 72 28 24 5f 5b |eturn su|bstr($_[|
|00002f00| 30 5d 2c 20 30 2c 20 24 | 75 73 65 72 73 68 6f 72 |0], 0, $|usershor|
|00002f10| 74 6c 65 6e 29 3b 0a 58 | 7d 0a 58 0a 58 23 20 43 |tlen);.X|}.X.X# C|
|00002f20| 6f 6e 76 65 72 74 20 66 | 72 6f 6d 20 56 4d 53 0a |onvert f|rom VMS.|
|00002f30| 58 23 20 2d 20 43 6f 6e | 76 65 72 74 20 75 70 70 |X# - Con|vert upp|
|00002f40| 65 72 63 61 73 65 20 74 | 6f 20 6c 6f 77 65 72 63 |ercase t|o lowerc|
|00002f50| 61 73 65 0a 58 23 20 2d | 20 52 65 6d 6f 76 65 20 |ase.X# -| Remove |
|00002f60| 6c 65 61 64 69 6e 67 20 | 64 65 76 69 63 65 20 6e |leading |device n|
|00002f70| 61 6d 65 3a 20 6f 72 20 | 6e 6f 64 65 3a 3a 0a 58 |ame: or |node::.X|
|00002f80| 23 20 2d 20 43 6f 6e 76 | 65 72 74 20 64 69 72 65 |# - Conv|ert dire|
|00002f90| 63 74 6f 72 79 20 66 6f | 72 6d 20 5b 78 78 78 5d |ctory fo|rm [xxx]|
|00002fa0| 20 74 6f 20 78 78 78 2f | 0a 58 23 20 2d 20 52 65 | to xxx/|.X# - Re|
|00002fb0| 6d 6f 76 65 20 74 72 61 | 69 6c 69 6e 67 20 67 65 |move tra|iling ge|
|00002fc0| 6e 65 72 61 74 69 6f 6e | 20 6e 75 6d 62 65 72 0a |neration| number.|
|00002fd0| 58 23 20 2d 20 52 65 6d | 6f 76 65 20 71 75 6f 74 |X# - Rem|ove quot|
|00002fe0| 69 6e 67 20 63 68 61 72 | 61 63 74 65 72 73 20 5e |ing char|acters ^|
|00002ff0| 56 20 61 6e 64 20 22 20 | 28 58 58 58 29 0a 58 23 |V and " |(XXX).X#|
|00003000| 20 4e 4f 54 45 3a 20 20 | 49 20 61 6d 20 61 6e 20 | NOTE: |I am an |
|00003010| 69 67 6e 6f 72 61 6e 74 | 20 6f 6e 20 56 4d 53 2c |ignorant| on VMS,|
|00003020| 20 73 6f 20 74 68 69 73 | 20 70 72 6f 62 61 62 6c | so this| probabl|
|00003030| 79 20 6e 65 65 64 20 66 | 69 78 69 6e 67 2e 20 20 |y need f|ixing. |
|00003040| 55 4e 54 45 53 54 45 44 | 0a 58 73 75 62 20 66 72 |UNTESTED|.Xsub fr|
|00003050| 6f 6d 5f 76 6d 73 20 7b | 0a 58 09 6c 6f 63 61 6c |om_vms {|.X.local|
|00003060| 28 24 6e 61 6d 65 29 20 | 3d 20 24 5f 5b 30 5d 3b |($name) |= $_[0];|
|00003070| 0a 58 0a 58 09 24 6e 61 | 6d 65 20 3d 7e 20 74 72 |.X.X.$na|me =~ tr|
|00003080| 2f 5b 41 2d 5a 5d 5c 5c | 2f 5b 61 2d 7a 5d 5c 2f |/[A-Z]\\|/[a-z]\/|
|00003090| 2f 3b 0a 58 09 24 6e 61 | 6d 65 20 3d 7e 20 73 2f |/;.X.$na|me =~ s/|
|000030a0| 5e 5b 61 2d 7a 5d 2a 3a | 3a 3f 2f 2f 3b 0a 58 09 |^[a-z]*:|:?//;.X.|
|000030b0| 24 6e 61 6d 65 20 3d 7e | 20 73 2f 5c 5b 28 2e 2a |$name =~| s/\[(.*|
|000030c0| 29 5c 5d 28 2e 2a 29 2f | 5c 31 5c 2f 5c 32 2f 3b |)\](.*)/|\1\/\2/;|
|000030d0| 0a 58 09 24 6e 61 6d 65 | 20 3d 7e 20 73 2f 3b 5b |.X.$name| =~ s/;[|
|000030e0| 30 2d 39 5d 2b 24 2f 2f | 3b 0a 58 09 24 6e 61 6d |0-9]+$//|;.X.$nam|
|000030f0| 65 20 3d 7e 20 73 2f 5b | 22 5c 30 32 36 5d 2f 2f |e =~ s/[|"\026]//|
|00003100| 67 3b 0a 58 09 72 65 74 | 75 72 6e 20 24 6e 61 6d |g;.X.ret|urn $nam|
|00003110| 65 3b 0a 58 7d 0a 58 0a | 58 23 20 43 6f 6e 76 65 |e;.X}.X.|X# Conve|
|00003120| 72 74 20 66 72 6f 6d 20 | 4d 53 2d 44 4f 53 0a 58 |rt from |MS-DOS.X|
|00003130| 23 20 2d 20 43 6f 6e 76 | 65 72 74 20 5c 20 74 6f |# - Conv|ert \ to|
|00003140| 20 2f 0a 58 23 20 2d 20 | 43 6f 6e 76 65 72 74 20 | /.X# - |Convert |
|00003150| 75 70 70 65 72 63 61 73 | 65 20 74 6f 20 6c 6f 77 |uppercas|e to low|
|00003160| 65 72 63 61 73 65 0a 58 | 23 20 2d 20 52 65 6d 6f |ercase.X|# - Remo|
|00003170| 76 65 20 6c 65 61 64 69 | 6e 67 20 64 65 76 69 63 |ve leadi|ng devic|
|00003180| 65 20 6e 61 6d 65 73 0a | 58 73 75 62 20 66 72 6f |e names.|Xsub fro|
|00003190| 6d 5f 6d 73 64 6f 73 20 | 7b 0a 58 09 6c 6f 63 61 |m_msdos |{.X.loca|
|000031a0| 6c 28 24 6e 61 6d 65 29 | 20 3d 20 24 5f 5b 30 5d |l($name)| = $_[0]|
|000031b0| 3b 0a 58 0a 58 09 24 6e | 61 6d 65 20 3d 7e 20 74 |;.X.X.$n|ame =~ t|
|000031c0| 72 2f 5b 41 2d 5a 5d 5c | 5c 2f 5b 61 2d 7a 5d 5c |r/[A-Z]\|\/[a-z]\|
|000031d0| 2f 2f 3b 0a 58 09 24 6e | 61 6d 65 20 3d 7e 20 73 |//;.X.$n|ame =~ s|
|000031e0| 2f 5e 5b 61 2d 7a 5d 3a | 2f 2f 3b 0a 58 09 72 65 |/^[a-z]:|//;.X.re|
|000031f0| 74 75 72 6e 20 24 6e 61 | 6d 65 3b 0a 58 7d 0a 58 |turn $na|me;.X}.X|
|00003200| 0a 58 23 20 66 69 6c 65 | 6d 61 70 28 6e 61 6d 65 |.X# file|map(name|
|00003210| 2c 20 6d 61 70 66 75 6e | 63 2c 20 63 6f 75 6e 74 |, mapfun|c, count|
|00003220| 70 72 65 70 66 75 6e 63 | 29 0a 58 23 20 47 6f 20 |prepfunc|).X# Go |
|00003230| 74 68 72 6f 75 67 68 20 | 65 76 65 72 79 20 70 61 |through |every pa|
|00003240| 74 68 20 65 6c 65 6d 65 | 6e 74 20 6f 66 20 6e 61 |th eleme|nt of na|
|00003250| 6d 65 20 73 75 62 73 74 | 69 74 75 74 69 6e 67 20 |me subst|ituting |
|00003260| 69 74 20 77 69 74 68 20 | 74 68 65 20 72 65 73 75 |it with |the resu|
|00003270| 6c 74 0a 58 23 20 6f 66 | 20 6d 61 70 66 75 6e 63 |lt.X# of| mapfunc|
|00003280| 28 65 6c 65 6d 65 6e 74 | 29 2e 20 20 49 66 20 74 |(element|). If t|
|00003290| 68 65 20 66 69 6c 65 6e | 61 6d 65 20 69 73 20 61 |he filen|ame is a|
|000032a0| 6c 72 65 61 64 79 20 75 | 73 65 64 20 74 68 65 6e |lready u|sed then|
|000032b0| 20 73 75 62 73 74 69 74 | 75 74 65 20 69 74 0a 58 | substit|ute it.X|
|000032c0| 23 20 77 69 74 68 20 74 | 68 65 20 72 65 73 75 6c |# with t|he resul|
|000032d0| 74 20 6f 66 20 61 70 70 | 6c 79 69 6e 67 20 63 6f |t of app|lying co|
|000032e0| 75 6e 74 70 72 65 70 66 | 75 6e 63 20 74 6f 20 77 |untprepf|unc to w|
|000032f0| 69 74 68 20 61 20 74 77 | 6f 20 6c 65 74 74 65 72 |ith a tw|o letter|
|00003300| 20 63 6f 75 6e 74 65 72 | 20 0a 58 23 20 61 70 70 | counter| .X# app|
|00003310| 65 6e 64 65 64 2e 0a 58 | 23 20 54 77 6f 20 61 73 |ended..X|# Two as|
|00003320| 73 6f 63 69 61 74 69 76 | 65 20 61 72 72 61 79 73 |sociativ|e arrays|
|00003330| 20 61 72 65 20 6b 65 70 | 74 20 74 6f 20 61 76 6f | are kep|t to avo|
|00003340| 69 64 20 74 68 65 20 63 | 68 61 6e 63 65 20 6f 66 |id the c|hance of|
|00003350| 20 72 65 2d 75 73 69 6e | 67 20 61 20 6e 61 6d 65 | re-usin|g a name|
|00003360| 0a 58 23 20 25 6d 61 70 | 20 63 6f 6e 74 61 69 6e |.X# %map| contain|
|00003370| 73 20 74 68 65 20 6d 61 | 70 70 69 6e 67 73 20 66 |s the ma|ppings f|
|00003380| 72 6f 6d 20 62 69 67 20 | 6e 61 6d 65 73 20 74 6f |rom big |names to|
|00003390| 20 73 6d 61 6c 6c 20 6e | 61 6d 65 73 0a 58 23 20 | small n|ames.X# |
|000033a0| 25 75 73 65 64 20 63 6f | 6e 74 61 69 6e 73 20 31 |%used co|ntains 1|
|000033b0| 20 66 6f 72 20 65 76 65 | 72 79 20 73 68 6f 72 74 | for eve|ry short|
|000033c0| 20 6e 61 6d 65 20 74 68 | 61 74 20 68 61 73 20 62 | name th|at has b|
|000033d0| 65 65 6e 20 75 73 65 64 | 0a 58 23 20 57 65 20 6b |een used|.X# We k|
|000033e0| 65 65 70 20 70 61 72 74 | 69 61 6c 20 66 69 6c 65 |eep part|ial file|
|000033f0| 20 6e 61 6d 65 73 20 74 | 6f 20 73 70 65 65 64 20 | names t|o speed |
|00003400| 75 70 20 74 68 65 20 70 | 72 6f 63 65 73 73 0a 58 |up the p|rocess.X|
|00003410| 23 20 54 68 65 20 66 69 | 6c 65 6e 61 6d 65 73 20 |# The fi|lenames |
|00003420| 61 72 65 20 61 6c 77 61 | 79 73 20 63 61 6e 6f 6e |are alwa|ys canon|
|00003430| 69 63 61 6c 69 73 65 64 | 0a 58 73 75 62 20 66 69 |icalised|.Xsub fi|
|00003440| 6c 65 6d 61 70 20 7b 0a | 58 09 6c 6f 63 61 6c 28 |lemap {.|X.local(|
|00003450| 0a 58 09 09 40 62 69 67 | 2c 09 09 23 20 43 6f 6e |.X..@big|,..# Con|
|00003460| 74 61 69 6e 73 20 63 6f | 6d 70 6f 6e 65 6e 74 73 |tains co|mponents|
|00003470| 20 6f 66 20 6f 72 69 67 | 69 6e 61 6c 0a 58 09 09 | of orig|inal.X..|
|00003480| 40 73 6d 61 6c 6c 2c 09 | 09 23 20 52 65 73 75 6c |@small,.|.# Resul|
|00003490| 74 20 69 73 20 62 75 69 | 6c 74 20 69 6e 20 68 65 |t is bui|lt in he|
|000034a0| 72 65 0a 58 09 09 40 62 | 69 67 70 61 72 74 2c 09 |re.X..@b|igpart,.|
|000034b0| 23 20 50 61 72 74 20 6f | 66 20 62 69 67 20 74 68 |# Part o|f big th|
|000034c0| 61 74 20 68 61 73 20 62 | 65 65 6e 20 64 6f 6e 65 |at has b|een done|
|000034d0| 0a 58 09 09 40 73 2c 09 | 09 23 20 54 6f 20 74 72 |.X..@s,.|.# To tr|
|000034e0| 79 20 61 6c 74 65 72 6e | 61 74 69 76 65 20 6d 61 |y altern|ative ma|
|000034f0| 70 70 69 6e 67 73 0a 58 | 09 09 24 6e 61 6d 65 2c |ppings.X|..$name,|
|00003500| 09 09 23 20 50 61 72 74 | 20 6f 66 20 70 61 74 68 |..# Part| of path|
|00003510| 20 77 65 20 61 72 65 20 | 64 65 61 6c 69 6e 67 20 | we are |dealing |
|00003520| 77 69 74 68 0a 58 09 09 | 24 63 6f 75 6e 74 2c 09 |with.X..|$count,.|
|00003530| 09 23 20 54 6f 20 63 72 | 65 61 74 65 20 64 69 73 |.# To cr|eate dis|
|00003540| 74 69 6e 63 74 20 6e 61 | 6d 65 73 0a 58 09 09 24 |tinct na|mes.X..$|
|00003550| 74 72 79 2c 09 09 23 20 | 52 65 6d 65 6d 62 65 72 |try,..# |Remember|
|00003560| 20 6d 61 70 20 72 65 73 | 75 6c 74 0a 58 09 09 24 | map res|ult.X..$|
|00003570| 6d 61 70 66 75 6e 63 2c | 09 23 20 46 75 6e 63 74 |mapfunc,|.# Funct|
|00003580| 69 6f 6e 20 74 6f 20 63 | 72 65 61 74 65 20 6e 65 |ion to c|reate ne|
|00003590| 77 20 65 6c 65 6d 65 6e | 74 73 0a 58 09 09 24 63 |w elemen|ts.X..$c|
|000035a0| 6f 75 6e 74 70 72 65 70 | 66 75 6e 63 09 23 20 46 |ountprep|func.# F|
|000035b0| 75 6e 63 74 69 6f 6e 20 | 74 6f 20 70 72 65 70 61 |unction |to prepa|
|000035c0| 72 65 20 66 6f 72 20 63 | 6f 75 6e 74 69 6e 67 0a |re for c|ounting.|
|000035d0| 58 0a 58 09 29 3b 0a 58 | 0a 58 09 24 6d 61 70 66 |X.X.);.X|.X.$mapf|
|000035e0| 75 6e 63 20 3d 20 24 5f | 5b 31 5d 3b 0a 58 09 24 |unc = $_|[1];.X.$|
|000035f0| 63 6f 75 6e 74 70 72 65 | 70 66 75 6e 63 20 3d 20 |countpre|pfunc = |
|00003600| 24 5f 5b 32 5d 3b 0a 58 | 09 40 62 69 67 20 3d 20 |$_[2];.X|.@big = |
|00003610| 73 70 6c 69 74 28 2f 5c | 2f 2f 2c 20 26 63 61 6e |split(/\|//, &can|
|00003620| 6f 6e 69 63 28 24 5f 5b | 30 5d 29 29 3b 0a 58 09 |onic($_[|0]));.X.|
|00003630| 40 73 6d 61 6c 6c 20 3d | 20 40 62 69 67 70 61 72 |@small =| @bigpar|
|00003640| 74 20 3d 20 28 29 3b 0a | 58 09 77 68 69 6c 65 20 |t = ();.|X.while |
|00003650| 28 64 65 66 69 6e 65 64 | 28 24 6e 61 6d 65 20 3d |(defined|($name =|
|00003660| 20 73 68 69 66 74 28 40 | 62 69 67 29 29 29 20 7b | shift(@|big))) {|
|00003670| 0a 58 09 09 70 75 73 68 | 28 40 62 69 67 70 61 72 |.X..push|(@bigpar|
|00003680| 74 2c 20 24 6e 61 6d 65 | 29 3b 0a 58 09 09 69 66 |t, $name|);.X..if|
|00003690| 20 28 64 65 66 69 6e 65 | 64 28 24 74 72 79 20 3d | (define|d($try =|
|000036a0| 20 24 6d 61 70 7b 6a 6f | 69 6e 28 27 2f 27 2c 20 | $map{jo|in('/', |
|000036b0| 40 62 69 67 70 61 72 74 | 29 7d 29 29 20 7b 0a 58 |@bigpart|)})) {.X|
|000036c0| 09 09 09 23 20 46 6f 75 | 6e 64 20 69 6e 20 6d 61 |...# Fou|nd in ma|
|000036d0| 70 0a 58 09 09 09 40 73 | 6d 61 6c 6c 20 3d 20 73 |p.X...@s|mall = s|
|000036e0| 70 6c 69 74 28 2f 5c 2f | 2f 2c 20 24 74 72 79 29 |plit(/\/|/, $try)|
|000036f0| 3b 0a 58 09 09 09 23 20 | 54 68 65 20 6e 65 78 74 |;.X...# |The next|
|00003700| 20 6c 69 6e 65 20 69 73 | 20 6e 65 65 64 65 64 20 | line is| needed |
|00003710| 62 65 63 61 75 73 65 20 | 6f 66 20 62 75 67 67 79 |because |of buggy|
|00003720| 20 73 70 6c 69 74 0a 58 | 09 09 09 23 20 73 70 6c | split.X|...# spl|
|00003730| 69 74 28 2f 78 2f 2c 20 | 27 27 29 20 73 68 6f 75 |it(/x/, |'') shou|
|00003740| 6c 64 20 67 69 76 65 20 | 28 27 27 29 20 6e 6f 74 |ld give |('') not|
|00003750| 20 28 29 0a 58 09 09 09 | 40 73 6d 61 6c 6c 20 3d | ().X...|@small =|
|00003760| 20 28 27 27 29 20 69 66 | 20 24 23 73 6d 61 6c 6c | ('') if| $#small|
|00003770| 20 3d 3d 20 2d 31 3b 0a | 58 09 09 7d 20 65 6c 73 | == -1;.|X..} els|
|00003780| 65 20 7b 0a 58 09 09 09 | 23 20 43 72 65 61 74 65 |e {.X...|# Create|
|00003790| 20 6e 65 77 20 6d 61 70 | 0a 58 09 09 09 23 20 45 | new map|.X...# E|
|000037a0| 76 65 6e 20 69 66 20 74 | 68 65 20 6e 61 6d 65 20 |ven if t|he name |
|000037b0| 69 73 20 73 68 6f 72 74 | 20 77 65 20 6d 61 79 20 |is short| we may |
|000037c0| 68 61 76 65 20 75 73 65 | 64 20 69 74 20 75 70 0a |have use|d it up.|
|000037d0| 58 09 09 09 23 20 62 79 | 20 73 68 6f 72 74 65 6e |X...# by| shorten|
|000037e0| 69 6e 67 20 75 70 20 61 | 20 62 69 67 67 65 72 20 |ing up a| bigger |
|000037f0| 6f 6e 65 2c 20 73 6f 20 | 77 65 20 6d 61 79 20 68 |one, so |we may h|
|00003800| 61 76 65 20 74 6f 0a 58 | 09 09 09 23 20 63 6f 75 |ave to.X|...# cou|
|00003810| 6e 74 0a 58 09 09 09 24 | 6e 61 6d 65 20 3d 20 26 |nt.X...$|name = &|
|00003820| 24 6d 61 70 66 75 6e 63 | 28 24 6e 61 6d 65 29 3b |$mapfunc|($name);|
|00003830| 0a 58 09 09 09 24 63 6f | 75 6e 74 20 3d 20 27 27 |.X...$co|unt = ''|
|00003840| 3b 0a 58 09 09 09 77 68 | 69 6c 65 20 28 24 75 73 |;.X...wh|ile ($us|
|00003850| 65 64 7b 6a 6f 69 6e 28 | 27 2f 27 2c 20 40 73 20 |ed{join(|'/', @s |
|00003860| 3d 20 28 40 73 6d 61 6c | 6c 2c 20 24 6e 61 6d 65 |= (@smal|l, $name|
|00003870| 20 2e 20 24 63 6f 75 6e | 74 29 29 7d 29 20 7b 0a | . $coun|t))}) {.|
|00003880| 58 09 09 09 09 69 66 20 | 28 24 63 6f 75 6e 74 20 |X....if |($count |
|00003890| 65 71 20 27 27 29 20 7b | 0a 58 09 09 09 09 09 24 |eq '') {|.X.....$|
|000038a0| 6e 61 6d 65 20 3d 20 26 | 24 63 6f 75 6e 74 70 72 |name = &|$countpr|
|000038b0| 65 70 66 75 6e 63 28 24 | 6e 61 6d 65 29 3b 0a 58 |epfunc($|name);.X|
|000038c0| 09 09 09 09 09 24 63 6f | 75 6e 74 20 3d 20 27 41 |.....$co|unt = 'A|
|000038d0| 41 27 3b 0a 58 09 09 09 | 09 7d 20 65 6c 73 65 20 |A';.X...|.} else |
|000038e0| 7b 0a 58 09 09 09 09 09 | 24 63 6f 75 6e 74 2b 2b |{.X.....|$count++|
|000038f0| 3b 0a 58 09 09 09 09 7d | 0a 58 09 09 09 7d 0a 58 |;.X....}|.X...}.X|
|00003900| 09 09 09 40 73 6d 61 6c | 6c 20 3d 20 40 73 3b 0a |...@smal|l = @s;.|
|00003910| 58 09 09 09 24 75 73 65 | 64 7b 6a 6f 69 6e 28 27 |X...$use|d{join('|
|00003920| 2f 27 2c 20 40 73 6d 61 | 6c 6c 29 7d 20 3d 20 31 |/', @sma|ll)} = 1|
|00003930| 3b 0a 58 09 09 09 24 6d | 61 70 7b 6a 6f 69 6e 28 |;.X...$m|ap{join(|
|00003940| 27 2f 27 2c 20 40 62 69 | 67 70 61 72 74 29 7d 20 |'/', @bi|gpart)} |
|00003950| 3d 20 6a 6f 69 6e 28 27 | 2f 27 2c 20 40 73 6d 61 |= join('|/', @sma|
|00003960| 6c 6c 29 3b 0a 58 09 09 | 7d 0a 58 09 7d 0a 58 09 |ll);.X..|}.X.}.X.|
|00003970| 72 65 74 75 72 6e 20 6a | 6f 69 6e 28 27 2f 27 2c |return j|oin('/',|
|00003980| 20 40 73 6d 61 6c 6c 29 | 3b 0a 58 7d 0a 58 0a 58 | @small)|;.X}.X.X|
|00003990| 23 0a 58 23 20 43 6f 6e | 76 65 72 74 20 61 20 73 |#.X# Con|vert a s|
|000039a0| 69 6e 67 6c 65 20 73 74 | 72 69 6e 67 20 74 6f 20 |ingle st|ring to |
|000039b0| 73 6f 6d 65 74 68 69 6e | 67 20 63 6c 6f 73 65 20 |somethin|g close |
|000039c0| 74 6f 20 69 74 20 77 69 | 74 68 20 6c 65 6e 67 74 |to it wi|th lengt|
|000039d0| 68 20 75 70 0a 58 23 20 | 74 6f 20 6c 65 6e 67 74 |h up.X# |to lengt|
|000039e0| 68 20 67 69 76 65 6e 0a | 58 73 75 62 20 73 68 6f |h given.|Xsub sho|
|000039f0| 72 74 65 6e 20 7b 0a 58 | 09 6c 6f 63 61 6c 28 24 |rten {.X|.local($|
|00003a00| 73 74 72 2c 20 24 6c 65 | 6e 29 20 3d 20 40 5f 3b |str, $le|n) = @_;|
|00003a10| 0a 58 0a 58 09 23 20 44 | 6f 20 22 66 6f 6e 65 74 |.X.X.# D|o "fonet|
|00003a20| 69 63 20 73 70 65 6c 69 | 6e 67 22 20 66 72 6f 6d |ic speli|ng" from|
|00003a30| 20 65 6e 64 20 74 6f 20 | 62 65 67 69 6e 6e 69 6e | end to |beginnin|
|00003a40| 67 0a 58 09 77 68 69 6c | 65 20 28 0a 58 09 09 6c |g.X.whil|e (.X..l|
|00003a50| 65 6e 67 74 68 28 24 73 | 74 72 29 20 3e 20 24 6c |ength($s|tr) > $l|
|00003a60| 65 6e 20 26 26 20 28 0a | 58 09 09 09 24 73 74 72 |en && (.|X...$str|
|00003a70| 20 3d 7e 20 73 2f 28 2e | 2a 29 28 5b 66 67 6c 6d | =~ s/(.|*)([fglm|
|00003a80| 6e 70 72 73 74 5d 29 5c | 32 28 2e 2a 29 2f 5c 31 |nprst])\|2(.*)/\1|
|00003a90| 5c 32 5c 33 2f 69 20 7c | 7c 0a 58 09 09 09 24 73 |\2\3/i |||.X...$s|
|00003aa0| 74 72 20 3d 7e 20 73 2f | 28 2e 2a 29 28 6f 75 29 |tr =~ s/|(.*)(ou)|
|00003ab0| 28 2e 2a 29 2f 5c 31 75 | 5c 33 2f 69 20 7c 7c 0a |(.*)/\1u|\3/i ||.|
|00003ac0| 58 09 09 09 24 73 74 72 | 20 3d 7e 20 73 2f 28 2e |X...$str| =~ s/(.|
|00003ad0| 2a 29 28 63 6b 29 28 2e | 2a 29 2f 5c 31 6b 5c 33 |*)(ck)(.|*)/\1k\3|
|00003ae0| 2f 69 20 7c 7c 0a 58 09 | 09 09 24 73 74 72 20 3d |/i ||.X.|..$str =|
|00003af0| 7e 20 73 2f 28 2e 2a 29 | 28 6b 73 29 28 2e 2a 29 |~ s/(.*)|(ks)(.*)|
|00003b00| 2f 5c 31 78 5c 33 2f 69 | 20 7c 7c 0a 58 09 09 09 |/\1x\3/i| ||.X...|
|00003b10| 24 73 74 72 20 3d 7e 20 | 73 2f 28 2e 2a 29 28 73 |$str =~ |s/(.*)(s|
|00003b20| 68 29 28 2e 2a 29 2f 5c | 31 73 5c 33 2f 69 20 7c |h)(.*)/\|1s\3/i ||
|00003b30| 7c 0a 58 09 09 09 24 73 | 74 72 20 3d 7e 20 73 2f ||.X...$s|tr =~ s/|
|00003b40| 28 2e 2a 29 28 70 68 29 | 28 2e 2a 29 2f 5c 31 66 |(.*)(ph)|(.*)/\1f|
|00003b50| 5c 33 2f 69 20 7c 7c 0a | 58 09 09 09 24 73 74 72 |\3/i ||.|X...$str|
|00003b60| 20 3d 7e 20 73 2f 28 2e | 2a 29 28 6f 6f 29 28 2e | =~ s/(.|*)(oo)(.|
|00003b70| 2a 29 2f 5c 31 75 5c 33 | 2f 69 0a 58 09 09 29 0a |*)/\1u\3|/i.X..).|
|00003b80| 58 09 29 20 7b 20 3b 20 | 7d 0a 58 09 23 20 52 65 |X.) { ; |}.X.# Re|
|00003b90| 6d 6f 76 65 20 6c 6f 77 | 65 72 63 61 73 65 20 76 |move low|ercase v|
|00003ba0| 6f 77 65 6c 73 20 66 72 | 6f 6d 20 74 68 65 20 65 |owels fr|om the e|
|00003bb0| 6e 64 20 74 6f 20 74 68 | 65 20 62 65 67 69 6e 6e |nd to th|e beginn|
|00003bc0| 69 6e 67 0a 58 09 77 68 | 69 6c 65 20 28 0a 58 09 |ing.X.wh|ile (.X.|
|00003bd0| 09 6c 65 6e 67 74 68 28 | 24 73 74 72 29 20 3e 20 |.length(|$str) > |
|00003be0| 24 6c 65 6e 20 26 26 20 | 0a 58 09 09 24 73 74 72 |$len && |.X..$str|
|00003bf0| 20 3d 7e 20 73 2f 28 2e | 2a 29 5b 61 65 69 6f 75 | =~ s/(.|*)[aeiou|
|00003c00| 5d 28 2e 2a 29 2f 5c 31 | 5c 32 2f 0a 58 09 29 20 |](.*)/\1|\2/.X.) |
|00003c10| 7b 20 3b 20 7d 0a 58 09 | 23 20 52 65 6d 6f 76 65 |{ ; }.X.|# Remove|
|00003c20| 20 75 70 70 65 72 63 61 | 73 65 20 76 6f 77 65 6c | upperca|se vowel|
|00003c30| 73 20 66 72 6f 6d 20 74 | 68 65 20 65 6e 64 20 74 |s from t|he end t|
|00003c40| 6f 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 0a |o the be|ginning.|
|00003c50| 58 09 77 68 69 6c 65 20 | 28 0a 58 09 09 6c 65 6e |X.while |(.X..len|
|00003c60| 67 74 68 28 24 73 74 72 | 29 20 3e 20 24 6c 65 6e |gth($str|) > $len|
|00003c70| 20 26 26 20 0a 58 09 09 | 24 73 74 72 20 3d 7e 20 | && .X..|$str =~ |
|00003c80| 73 2f 28 2e 2a 29 5b 41 | 45 49 4f 55 5d 28 2e 2a |s/(.*)[A|EIOU](.*|
|00003c90| 29 2f 5c 31 5c 32 2f 0a | 58 09 29 20 7b 20 3b 20 |)/\1\2/.|X.) { ; |
|00003ca0| 7d 0a 58 09 23 20 46 69 | 6e 61 6c 6c 79 20 63 75 |}.X.# Fi|nally cu|
|00003cb0| 74 20 63 68 61 72 61 63 | 74 65 72 73 20 66 72 6f |t charac|ters fro|
|00003cc0| 6d 20 74 68 65 20 65 6e | 64 0a 58 09 24 73 74 72 |m the en|d.X.$str|
|00003cd0| 20 3d 20 73 75 62 73 74 | 72 28 24 73 74 72 2c 20 | = subst|r($str, |
|00003ce0| 30 2c 20 24 6c 65 6e 29 | 3b 0a 58 09 72 65 74 75 |0, $len)|;.X.retu|
|00003cf0| 72 6e 20 24 73 74 72 3b | 0a 58 7d 0a 58 0a 58 23 |rn $str;|.X}.X.X#|
|00003d00| 20 43 72 65 61 74 65 20 | 61 20 63 61 6e 6f 6e 69 | Create |a canoni|
|00003d10| 63 20 66 69 6c 65 20 6e | 61 6d 65 20 6f 75 74 20 |c file n|ame out |
|00003d20| 6f 66 20 6f 6e 65 20 63 | 6f 6e 74 61 69 6e 69 6e |of one c|ontainin|
|00003d30| 67 20 2e 2e 20 61 6e 64 | 20 2e 20 0a 58 23 20 45 |g .. and| . .X# E|
|00003d40| 6d 70 6c 6f 79 20 55 6e | 69 78 20 73 65 6d 61 6e |mploy Un|ix seman|
|00003d50| 74 69 63 73 3a 20 65 6d | 70 74 79 20 66 69 6c 65 |tics: em|pty file|
|00003d60| 20 6d 65 61 6e 73 20 72 | 6f 6f 74 20 64 69 72 65 | means r|oot dire|
|00003d70| 63 74 6f 72 79 2e 0a 58 | 73 75 62 20 63 61 6e 6f |ctory..X|sub cano|
|00003d80| 6e 69 63 20 7b 0a 58 09 | 6c 6f 63 61 6c 28 40 63 |nic {.X.|local(@c|
|00003d90| 6f 6d 70 2c 20 40 63 61 | 6e 29 3b 0a 58 0a 58 09 |omp, @ca|n);.X.X.|
|00003da0| 40 63 6f 6d 70 20 3d 20 | 73 70 6c 69 74 28 2f 5c |@comp = |split(/\|
|00003db0| 2f 2f 2c 20 24 5f 5b 30 | 5d 29 3b 0a 58 09 66 6f |//, $_[0|]);.X.fo|
|00003dc0| 72 20 28 24 69 20 3d 20 | 30 3b 20 24 69 20 3c 3d |r ($i = |0; $i <=|
|00003dd0| 20 24 23 63 6f 6d 70 3b | 20 24 69 2b 2b 29 20 7b | $#comp;| $i++) {|
|00003de0| 0a 58 09 09 69 66 20 28 | 24 63 6f 6d 70 5b 24 69 |.X..if (|$comp[$i|
|00003df0| 5d 20 65 71 20 27 2e 27 | 29 20 7b 0a 58 09 09 09 |] eq '.'|) {.X...|
|00003e00| 3b 0a 58 09 09 7d 20 65 | 6c 73 69 66 20 28 24 63 |;.X..} e|lsif ($c|
|00003e10| 6f 6d 70 5b 24 69 5d 20 | 65 71 20 27 27 29 20 7b |omp[$i] |eq '') {|
|00003e20| 0a 58 09 09 09 40 63 61 | 6e 20 3d 20 28 29 3b 0a |.X...@ca|n = ();.|
|00003e30| 58 09 09 09 70 75 73 68 | 28 40 63 61 6e 2c 20 27 |X...push|(@can, '|
|00003e40| 27 29 3b 0a 58 09 09 7d | 20 65 6c 73 69 66 20 28 |');.X..}| elsif (|
|00003e50| 24 63 6f 6d 70 5b 24 69 | 5d 20 65 71 20 27 2e 2e |$comp[$i|] eq '..|
|00003e60| 27 29 20 7b 0a 58 09 09 | 09 70 6f 70 28 40 63 61 |') {.X..|.pop(@ca|
|00003e70| 6e 29 3b 0a 58 09 09 7d | 20 65 6c 73 65 20 7b 0a |n);.X..}| else {.|
|00003e80| 58 09 09 09 70 75 73 68 | 28 40 63 61 6e 2c 20 24 |X...push|(@can, $|
|00003e90| 63 6f 6d 70 5b 24 69 5d | 29 3b 0a 58 09 09 7d 0a |comp[$i]|);.X..}.|
|00003ea0| 58 09 7d 0a 58 09 72 65 | 74 75 72 6e 20 6a 6f 69 |X.}.X.re|turn joi|
|00003eb0| 6e 28 27 2f 27 2c 20 40 | 63 61 6e 29 3b 0a 58 7d |n('/', @|can);.X}|
|00003ec0| 0a 58 0a 58 23 20 41 20 | 64 6f 20 6e 6f 74 68 69 |.X.X# A |do nothi|
|00003ed0| 6e 67 20 70 72 6f 63 65 | 64 75 72 65 0a 58 73 75 |ng proce|dure.Xsu|
|00003ee0| 62 20 63 6f 70 79 20 7b | 0a 58 09 72 65 74 75 72 |b copy {|.X.retur|
|00003ef0| 6e 20 24 5f 5b 30 5d 3b | 0a 58 7d 0a 58 0a 58 23 |n $_[0];|.X}.X.X#|
|00003f00| 20 43 6f 70 79 20 61 20 | 74 61 70 65 20 61 72 63 | Copy a |tape arc|
|00003f10| 68 69 76 65 20 66 72 6f | 6d 20 73 74 64 69 6e 20 |hive fro|m stdin |
|00003f20| 74 6f 20 73 74 64 6f 75 | 74 0a 58 73 75 62 20 63 |to stdou|t.Xsub c|
|00003f30| 6f 70 79 74 61 72 20 7b | 0a 58 09 62 69 6e 6d 6f |opytar {|.X.binmo|
|00003f40| 64 65 20 53 54 44 49 4e | 3b 0a 58 09 62 69 6e 6d |de STDIN|;.X.binm|
|00003f50| 6f 64 65 20 53 54 44 4f | 55 54 3b 0a 58 0a 58 09 |ode STDO|UT;.X.X.|
|00003f60| 66 6f 72 6c 6f 6f 70 3a | 20 66 6f 72 28 3b 3b 29 |forloop:| for(;;)|
|00003f70| 20 7b 0a 58 09 09 72 65 | 61 64 28 53 54 44 49 4e | {.X..re|ad(STDIN|
|00003f80| 2c 20 24 68 65 61 64 65 | 72 2c 20 35 31 32 29 20 |, $heade|r, 512) |
|00003f90| 3d 3d 20 35 31 32 20 7c | 7c 20 64 69 65 20 22 24 |== 512 ||| die "$|
|00003fa0| 30 3a 20 43 6f 75 6c 64 | 6e 27 74 20 72 65 61 64 |0: Could|n't read|
|00003fb0| 20 68 65 61 64 65 72 3a | 20 24 21 5c 6e 22 3b 0a | header:| $!\n";.|
|00003fc0| 58 09 09 69 66 20 28 24 | 68 65 61 64 65 72 20 65 |X..if ($|header e|
|00003fd0| 71 20 22 5c 30 22 20 78 | 20 35 31 32 29 20 7b 0a |q "\0" x| 512) {.|
|00003fe0| 58 09 09 09 6c 61 73 74 | 20 66 6f 72 6c 6f 6f 70 |X...last| forloop|
|00003ff0| 3b 0a 58 09 09 7d 0a 58 | 09 09 28 24 6e 61 6d 65 |;.X..}.X|..($name|
|00004000| 2c 20 24 6d 6f 64 65 2c | 20 24 75 69 64 2c 20 24 |, $mode,| $uid, $|
|00004010| 67 69 64 2c 20 24 73 69 | 7a 65 2c 20 24 6d 74 69 |gid, $si|ze, $mti|
|00004020| 6d 65 2c 20 24 63 68 65 | 63 6b 73 75 6d 2c 20 24 |me, $che|cksum, $|
|00004030| 6c 69 6e 6b 66 6c 61 67 | 2c 20 24 6c 69 6e 6b 6e |linkflag|, $linkn|
|00004040| 61 6d 65 29 20 3d 20 75 | 6e 70 61 63 6b 28 22 61 |ame) = u|npack("a|
|00004050| 31 30 30 20 41 37 78 20 | 41 37 78 20 41 37 78 20 |100 A7x |A7x A7x |
|00004060| 41 31 32 20 41 31 32 20 | 61 38 20 61 31 20 61 31 |A12 A12 |a8 a1 a1|
|00004070| 30 30 22 2c 20 24 68 65 | 61 64 65 72 29 3b 0a 58 |00", $he|ader);.X|
|00004080| 09 09 23 0a 58 09 09 23 | 20 48 65 61 64 65 72 20 |..#.X..#| Header |
|00004090| 6d 6f 64 69 66 69 63 61 | 74 69 6f 6e 20 63 6f 64 |modifica|tion cod|
|000040a0| 65 20 73 68 6f 75 6c 64 | 20 62 65 20 70 75 74 20 |e should| be put |
|000040b0| 68 65 72 65 0a 58 09 09 | 23 20 48 45 41 44 45 52 |here.X..|# HEADER|
|000040c0| 4d 4f 44 0a 58 09 09 24 | 6e 61 6d 65 20 3d 7e 20 |MOD.X..$|name =~ |
|000040d0| 73 2f 5b 5c 30 30 30 20 | 5d 2a 2f 2f 67 3b 0a 58 |s/[\000 |]*//g;.X|
|000040e0| 09 09 24 6e 61 6d 65 20 | 3d 20 26 24 70 72 6f 63 |..$name |= &$proc|
|000040f0| 28 24 6e 61 6d 65 29 3b | 0a 58 09 09 69 66 20 28 |($name);|.X..if (|
|00004100| 24 6c 69 6e 6b 66 6c 61 | 67 20 21 3d 20 22 5c 30 |$linkfla|g != "\0|
|00004110| 22 29 20 7b 0a 58 09 09 | 09 24 6c 69 6e 6b 6e 61 |") {.X..|.$linkna|
|00004120| 6d 65 20 3d 7e 20 73 2f | 5b 5c 30 30 30 20 5d 2a |me =~ s/|[\000 ]*|
|00004130| 2f 2f 67 3b 0a 58 09 09 | 09 24 6c 69 6e 6b 6e 61 |//g;.X..|.$linkna|
|00004140| 6d 65 20 3d 20 26 24 70 | 72 6f 63 28 24 6c 69 6e |me = &$p|roc($lin|
|00004150| 6b 6e 61 6d 65 29 3b 0a | 58 09 09 7d 0a 58 0a 58 |kname);.|X..}.X.X|
|00004160| 09 09 23 20 43 72 65 61 | 74 65 20 64 75 6d 6d 79 |..# Crea|te dummy|
|00004170| 20 68 65 61 64 65 72 20 | 66 6f 72 20 63 68 65 63 | header |for chec|
|00004180| 6b 73 75 6d 20 63 61 6c | 63 75 6c 61 74 69 6f 6e |ksum cal|culation|
|00004190| 20 28 63 68 65 63 6b 73 | 75 6d 20 69 73 20 62 6c | (checks|um is bl|
|000041a0| 61 6e 6b 73 29 0a 58 09 | 09 24 68 6e 65 77 20 3d |anks).X.|.$hnew =|
|000041b0| 20 70 61 63 6b 28 22 61 | 39 39 78 20 41 36 61 31 | pack("a|99x A6a1|
|000041c0| 78 20 41 36 61 31 78 20 | 41 36 61 31 78 20 41 31 |x A6a1x |A6a1x A1|
|000041d0| 31 61 31 20 41 31 31 61 | 31 20 61 38 20 61 31 20 |1a1 A11a|1 a8 a1 |
|000041e0| 61 39 39 78 20 78 32 35 | 35 22 2c 20 0a 58 09 09 |a99x x25|5", .X..|
|000041f0| 09 28 24 6e 61 6d 65 2c | 20 24 6d 6f 64 65 2c 20 |.($name,| $mode, |
|00004200| 27 20 27 2c 20 24 75 69 | 64 2c 20 27 20 27 2c 20 |' ', $ui|d, ' ', |
|00004210| 24 67 69 64 2c 20 27 20 | 27 2c 20 24 73 69 7a 65 |$gid, ' |', $size|
|00004220| 2c 20 27 20 27 2c 20 24 | 6d 74 69 6d 65 2c 20 27 |, ' ', $|mtime, '|
|00004230| 20 27 2c 20 27 20 27 20 | 78 20 38 2c 20 24 6c 69 | ', ' ' |x 8, $li|
|00004240| 6e 6b 66 6c 61 67 2c 20 | 24 6c 69 6e 6b 6e 61 6d |nkflag, |$linknam|
|00004250| 65 29 29 3b 0a 58 09 09 | 24 73 7a 20 3d 20 24 73 |e));.X..|$sz = $s|
|00004260| 69 7a 65 3b 0a 58 09 09 | 24 73 7a 20 3d 7e 20 73 |ize;.X..|$sz =~ s|
|00004270| 2f 20 2a 2f 2f 67 3b 0a | 58 09 09 24 73 7a 20 3d |/ *//g;.|X..$sz =|
|00004280| 20 6f 63 74 28 24 73 7a | 29 3b 0a 58 09 09 24 63 | oct($sz|);.X..$c|
|00004290| 68 65 63 6b 73 75 6d 20 | 3d 7e 20 73 2f 20 2a 2f |hecksum |=~ s/ */|
|000042a0| 2f 67 3b 0a 58 09 09 24 | 63 68 65 63 6b 73 75 6d |/g;.X..$|checksum|
|000042b0| 20 3d 20 6f 63 74 28 24 | 63 68 65 63 6b 73 75 6d | = oct($|checksum|
|000042c0| 29 3b 0a 58 09 09 24 6e | 65 77 63 68 65 63 6b 20 |);.X..$n|ewcheck |
|000042d0| 3d 20 26 63 68 65 63 6b | 28 24 68 6e 65 77 29 3b |= &check|($hnew);|
|000042e0| 0a 58 09 09 23 20 43 72 | 65 61 74 65 20 74 68 65 |.X..# Cr|eate the|
|000042f0| 20 68 65 61 64 65 72 20 | 77 69 74 68 20 74 68 65 | header |with the|
|00004300| 20 6e 65 77 20 63 68 65 | 63 6b 73 75 6d 0a 58 09 | new che|cksum.X.|
|00004310| 09 24 68 6e 65 77 20 3d | 20 70 61 63 6b 28 22 61 |.$hnew =| pack("a|
|00004320| 39 39 78 20 41 36 61 31 | 78 20 41 36 61 31 78 20 |99x A6a1|x A6a1x |
|00004330| 41 36 61 31 78 20 41 31 | 31 61 31 20 41 31 31 61 |A6a1x A1|1a1 A11a|
|00004340| 31 20 61 36 78 61 31 20 | 61 31 20 61 39 39 78 20 |1 a6xa1 |a1 a99x |
|00004350| 78 32 35 35 22 2c 20 0a | 58 09 09 09 28 24 6e 61 |x255", .|X...($na|
|00004360| 6d 65 2c 20 24 6d 6f 64 | 65 2c 20 27 20 27 2c 20 |me, $mod|e, ' ', |
|00004370| 24 75 69 64 2c 20 27 20 | 27 2c 20 24 67 69 64 2c |$uid, ' |', $gid,|
|00004380| 20 27 20 27 2c 20 24 73 | 69 7a 65 2c 20 27 20 27 | ' ', $s|ize, ' '|
|00004390| 2c 20 24 6d 74 69 6d 65 | 2c 20 27 20 27 2c 20 73 |, $mtime|, ' ', s|
|000043a0| 70 72 69 6e 74 66 28 27 | 25 36 6f 27 2c 20 24 6e |printf('|%6o', $n|
|000043b0| 65 77 63 68 65 63 6b 29 | 2c 20 27 20 27 2c 20 24 |ewcheck)|, ' ', $|
|000043c0| 6c 69 6e 6b 66 6c 61 67 | 2c 20 24 6c 69 6e 6b 6e |linkflag|, $linkn|
|000043d0| 61 6d 65 29 29 3b 0a 58 | 09 09 70 72 69 6e 74 20 |ame));.X|..print |
|000043e0| 53 54 44 4f 55 54 20 24 | 68 6e 65 77 3b 0a 58 09 |STDOUT $|hnew;.X.|
|000043f0| 09 23 20 43 6f 70 79 20 | 63 6f 6e 74 65 6e 74 73 |.# Copy |contents|
|00004400| 0a 58 09 09 66 6f 72 20 | 28 24 69 20 3d 20 30 3b |.X..for |($i = 0;|
|00004410| 20 24 69 20 3c 20 24 73 | 7a 3b 20 24 69 20 2b 3d | $i < $s|z; $i +=|
|00004420| 20 35 31 32 29 20 7b 0a | 58 09 09 09 72 65 61 64 | 512) {.|X...read|
|00004430| 28 53 54 44 49 4e 2c 20 | 24 63 6f 6e 74 65 6e 74 |(STDIN, |$content|
|00004440| 73 2c 20 35 31 32 29 20 | 3d 3d 20 35 31 32 20 7c |s, 512) |== 512 ||
|00004450| 7c 20 64 69 65 20 22 24 | 30 3a 20 43 6f 75 6c 64 || die "$|0: Could|
|00004460| 6e 27 74 20 72 65 61 64 | 20 64 61 74 61 3a 20 24 |n't read| data: $|
|00004470| 21 5c 6e 22 3b 0a 58 09 | 09 09 70 72 69 6e 74 20 |!\n";.X.|..print |
|00004480| 53 54 44 4f 55 54 20 24 | 63 6f 6e 74 65 6e 74 73 |STDOUT $|contents|
|00004490| 3b 0a 58 09 09 7d 0a 58 | 09 09 23 73 65 65 6b 28 |;.X..}.X|..#seek(|
|000044a0| 53 54 44 49 4e 2c 20 28 | 69 6e 74 28 24 73 7a 20 |STDIN, (|int($sz |
|000044b0| 2f 20 35 31 32 29 20 2b | 20 31 29 20 2a 20 35 31 |/ 512) +| 1) * 51|
|000044c0| 32 2c 20 31 29 20 75 6e | 6c 65 73 73 20 24 73 7a |2, 1) un|less $sz|
|000044d0| 20 3d 3d 20 30 3b 0a 58 | 09 7d 0a 58 09 23 20 57 | == 0;.X|.}.X.# W|
|000044e0| 72 69 74 65 20 45 4f 46 | 0a 58 09 70 72 69 6e 74 |rite EOF|.X.print|
|000044f0| 20 53 54 44 4f 55 54 20 | 70 61 63 6b 28 22 78 35 | STDOUT |pack("x5|
|00004500| 31 32 22 2c 20 28 29 29 | 3b 0a 58 09 70 72 69 6e |12", ())|;.X.prin|
|00004510| 74 20 53 54 44 4f 55 54 | 20 70 61 63 6b 28 22 78 |t STDOUT| pack("x|
|00004520| 35 31 32 22 2c 20 28 29 | 29 3b 0a 58 7d 0a 58 0a |512", ()|);.X}.X.|
|00004530| 58 23 20 52 65 74 75 72 | 6e 20 63 68 65 63 6b 73 |X# Retur|n checks|
|00004540| 75 6d 20 66 6f 72 20 74 | 61 72 20 68 65 61 64 65 |um for t|ar heade|
|00004550| 72 20 62 6c 6f 63 6b 0a | 58 73 75 62 20 63 68 65 |r block.|Xsub che|
|00004560| 63 6b 20 7b 0a 58 09 24 | 68 20 3d 20 24 5f 5b 30 |ck {.X.$|h = $_[0|
|00004570| 5d 3b 0a 58 09 6c 6f 63 | 61 6c 28 24 69 2c 20 24 |];.X.loc|al($i, $|
|00004580| 73 29 3b 0a 58 0a 58 09 | 24 73 20 3d 20 30 3b 0a |s);.X.X.|$s = 0;.|
|00004590| 58 09 66 6f 72 28 24 69 | 20 3d 20 30 3b 20 24 69 |X.for($i| = 0; $i|
|000045a0| 20 3c 20 35 31 32 3b 20 | 24 69 2b 2b 29 20 7b 0a | < 512; |$i++) {.|
|000045b0| 58 09 09 24 73 20 2b 3d | 20 75 6e 70 61 63 6b 28 |X..$s +=| unpack(|
|000045c0| 27 43 27 2c 20 73 75 62 | 73 74 72 28 24 68 2c 20 |'C', sub|str($h, |
|000045d0| 24 69 2c 20 31 29 29 3b | 0a 58 09 7d 0a 58 09 72 |$i, 1));|.X.}.X.r|
|000045e0| 65 74 75 72 6e 20 24 73 | 3b 0a 58 7d 0a 58 0a 58 |eturn $s|;.X}.X.X|
|000045f0| 22 0a 58 3a 65 6e 64 20 | 22 2c 20 30 3b 0a 45 4e |".X:end |", 0;.EN|
|00004600| 44 5f 4f 46 5f 46 49 4c | 45 0a 69 66 20 74 65 73 |D_OF_FIL|E.if tes|
|00004610| 74 20 31 30 31 39 32 20 | 2d 6e 65 20 60 77 63 20 |t 10192 |-ne `wc |
|00004620| 2d 63 20 3c 27 74 61 72 | 66 69 78 27 60 3b 20 74 |-c <'tar|fix'`; t|
|00004630| 68 65 6e 0a 20 20 20 20 | 65 63 68 6f 20 73 68 61 |hen. |echo sha|
|00004640| 72 3a 20 5c 22 27 74 61 | 72 66 69 78 27 5c 22 20 |r: \"'ta|rfix'\" |
|00004650| 75 6e 70 61 63 6b 65 64 | 20 77 69 74 68 20 77 72 |unpacked| with wr|
|00004660| 6f 6e 67 20 73 69 7a 65 | 21 0a 66 69 0a 63 68 6d |ong size|!.fi.chm|
|00004670| 6f 64 20 2b 78 20 27 74 | 61 72 66 69 78 27 0a 23 |od +x 't|arfix'.#|
|00004680| 20 65 6e 64 20 6f 66 20 | 27 74 61 72 66 69 78 27 | end of |'tarfix'|
|00004690| 0a 66 69 0a 65 63 68 6f | 20 73 68 61 72 3a 20 45 |.fi.echo| shar: E|
|000046a0| 6e 64 20 6f 66 20 73 68 | 65 6c 6c 20 61 72 63 68 |nd of sh|ell arch|
|000046b0| 69 76 65 2e 0a 65 78 69 | 74 20 30 0a 2d 2d 0a 44 |ive..exi|t 0.--.D|
|000046c0| 69 6f 6d 69 64 69 73 20 | 53 70 69 6e 65 6c 6c 69 |iomidis |Spinelli|
|000046d0| 73 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |s | |
|000046e0| 20 20 20 49 6e 74 65 72 | 6e 65 74 3a 20 20 20 20 | Inter|net: |
|000046f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 64 64 73 | | dds|
|00004700| 40 63 63 2e 69 63 2e 61 | 63 2e 75 6b 0a 44 65 70 |@cc.ic.a|c.uk.Dep|
|00004710| 61 72 74 6d 65 6e 74 20 | 6f 66 20 43 6f 6d 70 75 |artment |of Compu|
|00004720| 74 69 6e 67 20 20 20 20 | 20 20 20 20 20 20 20 20 |ting | |
|00004730| 20 55 55 43 50 3a 20 20 | 20 20 20 20 20 20 20 20 | UUCP: | |
|00004740| 20 20 20 20 20 20 20 20 | 20 20 2e 2e 2e 21 75 6b | | ...!uk|
|00004750| 63 21 69 63 63 63 21 64 | 64 73 0a 49 6d 70 65 72 |c!iccc!d|ds.Imper|
|00004760| 69 61 6c 20 43 6f 6c 6c | 65 67 65 20 20 20 20 20 |ial Coll|ege |
|00004770| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 4a | | J|
|00004780| 41 4e 45 54 3a 20 20 20 | 20 20 20 20 20 20 20 20 |ANET: | |
|00004790| 20 20 20 20 20 20 20 20 | 20 64 64 73 40 75 6b 2e | | dds@uk.|
|000047a0| 61 63 2e 69 63 2e 63 63 | 0a 4c 6f 6e 64 6f 6e 20 |ac.ic.cc|.London |
|000047b0| 53 57 37 20 32 42 5a 20 | 20 20 20 20 20 20 20 20 |SW7 2BZ | |
|000047c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 23 69 6e | | #in|
|000047d0| 63 6c 75 64 65 20 22 2f | 64 65 76 2f 74 74 79 22 |clude "/|dev/tty"|
|000047e0| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+