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

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 70 63 | 67 40 63 73 2e 61 62 65 |From: pc|g@cs.abe|
|00000010| 72 2e 61 63 2e 75 6b 20 | 28 50 69 65 72 63 61 72 |r.ac.uk |(Piercar|
|00000020| 6c 6f 20 47 72 61 6e 64 | 69 29 0a 4e 65 77 73 67 |lo Grand|i).Newsg|
|00000030| 72 6f 75 70 73 3a 20 63 | 6f 6d 70 2e 75 6e 69 78 |roups: c|omp.unix|
|00000040| 2e 69 33 38 36 2c 61 6c | 74 2e 73 6f 75 72 63 65 |.i386,al|t.source|
|00000050| 73 0a 53 75 62 6a 65 63 | 74 3a 20 46 69 6c 65 20 |s.Subjec|t: File |
|00000060| 64 65 73 63 72 69 70 74 | 6f 72 20 63 6c 6f 6e 65 |descript|or clone|
|00000070| 72 20 28 64 75 70 29 20 | 64 72 69 76 65 72 0a 4d |r (dup) |driver.M|
|00000080| 65 73 73 61 67 65 2d 49 | 44 3a 20 3c 50 43 47 2e |essage-I|D: <PCG.|
|00000090| 39 30 4a 75 6c 32 36 31 | 36 33 35 30 33 40 6f 64 |90Jul261|63503@od|
|000000a0| 69 6e 2e 63 73 2e 61 62 | 65 72 2e 61 63 2e 75 6b |in.cs.ab|er.ac.uk|
|000000b0| 3e 0a 44 61 74 65 3a 20 | 32 36 20 4a 75 6c 20 39 |>.Date: |26 Jul 9|
|000000c0| 30 20 31 35 3a 33 35 3a | 30 33 20 47 4d 54 0a 0a |0 15:35:|03 GMT..|
|000000d0| 0a 49 74 27 73 20 72 65 | 61 6c 6c 79 20 62 6f 6e |.It's re|ally bon|
|000000e0| 61 6e 7a 61 20 74 69 6d | 65 20 66 6f 72 20 74 68 |anza tim|e for th|
|000000f0| 65 20 61 75 64 69 65 6e | 63 65 20 6f 66 20 63 6f |e audien|ce of co|
|00000100| 6d 70 2e 75 6e 69 78 2e | 69 33 38 36 20 3a 2d 29 |mp.unix.|i386 :-)|
|00000110| 2e 20 48 65 72 65 0a 65 | 6e 63 6c 6f 73 65 64 20 |. Here.e|nclosed |
|00000120| 79 6f 75 20 77 69 6c 6c | 20 66 69 6e 64 20 74 68 |you will| find th|
|00000130| 65 20 73 6f 75 72 63 65 | 20 66 6f 72 20 61 20 53 |e source| for a S|
|00000140| 79 73 74 65 6d 20 56 2f | 33 38 36 20 69 6d 70 6c |ystem V/|386 impl|
|00000150| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 6f 66 0a 74 68 |ementati|on of.th|
|00000160| 65 20 64 72 69 76 65 72 | 20 28 6f 72 69 67 69 6e |e driver| (origin|
|00000170| 61 74 65 64 20 69 6e 20 | 55 6e 69 78 20 65 64 69 |ated in |Unix edi|
|00000180| 74 69 6f 6e 20 38 29 20 | 74 68 61 74 20 61 6c 6c |tion 8) |that all|
|00000190| 6f 77 73 20 79 6f 75 20 | 74 6f 20 6e 61 6d 65 20 |ows you |to name |
|000001a0| 73 74 64 69 6e 0a 73 74 | 64 6f 75 74 20 61 6e 64 |stdin.st|dout and|
|000001b0| 20 73 74 64 65 72 72 20 | 28 61 6e 64 20 61 6e 79 | stderr |(and any|
|000001c0| 20 6f 74 68 65 72 20 66 | 69 6c 65 20 64 65 73 63 | other f|ile desc|
|000001d0| 72 69 70 74 6f 72 20 66 | 6f 72 20 74 68 65 20 63 |riptor f|or the c|
|000001e0| 75 72 72 65 6e 74 0a 70 | 72 6f 63 65 73 73 29 20 |urrent.p|rocess) |
|000001f0| 61 73 20 70 73 65 75 64 | 6f 20 64 65 76 69 63 65 |as pseud|o device|
|00000200| 73 20 69 6e 20 2f 64 65 | 76 2c 20 74 68 75 73 20 |s in /de|v, thus |
|00000210| 65 6e 61 62 6c 69 6e 67 | 20 70 72 6f 67 72 61 6d |enabling| program|
|00000220| 73 20 74 68 61 74 20 6f | 6e 6c 79 0a 6f 70 65 72 |s that o|nly.oper|
|00000230| 61 74 65 20 6f 6e 20 70 | 61 74 68 20 6e 61 6d 65 |ate on p|ath name|
|00000240| 73 20 74 6f 20 62 65 20 | 75 73 65 64 20 69 6e 20 |s to be |used in |
|00000250| 61 20 70 69 70 65 20 74 | 6f 6f 2e 0a 0a 4e 6f 74 |a pipe t|oo...Not|
|00000260| 69 63 65 20 74 68 61 74 | 20 74 68 69 73 20 64 72 |ice that| this dr|
|00000270| 69 76 65 72 20 77 69 6c | 6c 20 68 61 76 65 20 74 |iver wil|l have t|
|00000280| 68 65 20 65 66 66 65 63 | 74 20 6f 66 20 61 20 64 |he effec|t of a d|
|00000290| 75 70 28 32 29 2c 20 6e | 6f 74 20 6f 66 20 61 0a |up(2), n|ot of a.|
|000002a0| 73 65 63 6f 6e 64 20 6f | 70 65 6e 20 6f 6e 20 74 |second o|pen on t|
|000002b0| 68 65 20 67 69 76 65 6e | 20 66 69 6c 65 20 64 65 |he given| file de|
|000002c0| 73 63 72 69 70 74 6f 72 | 27 73 20 69 6e 6f 64 65 |scriptor|'s inode|
|000002d0| 2e 0a 0a 49 20 77 69 6c | 6c 20 70 75 74 20 68 65 |...I wil|l put he|
|000002e0| 72 65 20 6d 79 20 75 73 | 75 61 6c 20 64 69 73 63 |re my us|ual disc|
|000002f0| 6c 61 69 6d 65 72 20 74 | 68 61 74 20 49 20 68 61 |laimer t|hat I ha|
|00000300| 76 65 20 66 6f 72 67 6f | 74 74 65 6e 20 74 6f 20 |ve forgo|tten to |
|00000310| 77 72 69 74 65 20 66 6f | 72 0a 74 68 65 20 70 61 |write fo|r.the pa|
|00000320| 72 61 6c 6c 65 6c 20 70 | 6f 72 74 20 64 72 69 76 |rallel p|ort driv|
|00000330| 65 72 3a 0a 0a 09 54 68 | 69 73 20 77 6f 72 6b 20 |er:...Th|is work |
|00000340| 69 73 20 74 68 65 20 72 | 65 73 75 6c 74 20 6f 66 |is the r|esult of|
|00000350| 20 70 65 72 73 6f 6e 61 | 6c 20 72 65 73 65 61 72 | persona|l resear|
|00000360| 63 68 20 61 63 74 69 76 | 69 74 79 20 77 69 74 68 |ch activ|ity with|
|00000370| 20 74 68 65 0a 09 75 73 | 65 20 6f 66 20 6d 79 20 | the..us|e of my |
|00000380| 74 69 6d 65 2c 20 66 61 | 63 69 6c 69 74 69 65 73 |time, fa|cilities|
|00000390| 2c 20 66 75 6e 64 69 6e | 67 20 61 6e 64 20 72 65 |, fundin|g and re|
|000003a0| 73 6f 75 72 63 65 73 20 | 65 78 63 6c 75 73 69 76 |sources |exclusiv|
|000003b0| 65 6c 79 2e 0a 09 49 6e | 20 6e 6f 20 77 61 79 20 |ely...In| no way |
|000003c0| 74 68 65 20 55 6e 69 76 | 65 72 73 69 74 79 20 43 |the Univ|ersity C|
|000003d0| 6f 6c 6c 65 67 65 20 6f | 66 20 57 61 6c 65 73 20 |ollege o|f Wales |
|000003e0| 68 61 73 20 61 69 64 65 | 64 20 6f 72 20 73 75 70 |has aide|d or sup|
|000003f0| 70 6f 72 74 65 64 0a 09 | 74 68 69 73 20 77 6f 72 |ported..|this wor|
|00000400| 6b 2c 20 6e 6f 72 20 73 | 75 70 70 6c 69 65 64 20 |k, nor s|upplied |
|00000410| 61 6e 79 20 66 75 6e 64 | 69 6e 67 20 6f 72 20 72 |any fund|ing or r|
|00000420| 65 73 6f 75 72 63 65 73 | 20 66 6f 72 20 69 74 73 |esources| for its|
|00000430| 0a 09 70 65 72 66 6f 72 | 6d 61 6e 63 65 2c 20 6e |..perfor|mance, n|
|00000440| 6f 72 20 69 74 20 69 73 | 20 69 6e 20 61 6e 79 20 |or it is| in any |
|00000450| 77 61 79 20 72 65 6c 61 | 74 65 64 20 74 6f 20 72 |way rela|ted to r|
|00000460| 65 73 65 61 72 63 68 20 | 6f 72 20 6f 74 68 65 72 |esearch |or other|
|00000470| 0a 09 61 63 74 69 76 69 | 74 69 65 73 20 6f 66 20 |..activi|ties of |
|00000480| 74 68 65 20 55 6e 69 76 | 65 72 73 69 74 79 20 43 |the Univ|ersity C|
|00000490| 6f 6c 6c 65 67 65 20 6f | 66 20 57 61 6c 65 73 2e |ollege o|f Wales.|
|000004a0| 0a 0a 49 20 77 61 6e 74 | 20 68 6f 77 65 76 65 72 |..I want| however|
|000004b0| 20 74 6f 20 74 68 61 6e | 6b 20 74 68 65 6d 20 66 | to than|k them f|
|000004c0| 6f 72 20 70 72 6f 76 69 | 64 69 6e 67 20 6e 65 74 |or provi|ding net|
|000004d0| 77 6f 72 6b 20 61 63 63 | 65 73 73 2c 20 61 6e 64 |work acc|ess, and|
|000004e0| 20 74 68 65 72 65 66 6f | 72 65 0a 74 68 65 20 61 | therefo|re.the a|
|000004f0| 62 69 6c 69 74 79 20 74 | 6f 20 64 6f 20 74 68 69 |bility t|o do thi|
|00000500| 73 20 70 6f 73 74 69 6e | 67 2e 0a 0a 2d 2d 2d 2d |s postin|g...----|
|00000510| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000520| 2d 2d 2d 2d 20 63 75 74 | 20 68 65 72 65 20 2d 2d |---- cut| here --|
|00000530| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000540| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0a 23 |--------|------.#|
|00000550| 21 20 2f 62 69 6e 2f 73 | 68 0a 23 20 54 68 69 73 |! /bin/s|h.# This|
|00000560| 20 69 73 20 61 20 73 68 | 65 6c 6c 20 61 72 63 68 | is a sh|ell arch|
|00000570| 69 76 65 2e 20 20 52 65 | 6d 6f 76 65 20 61 6e 79 |ive. Re|move any|
|00000580| 74 68 69 6e 67 20 62 65 | 66 6f 72 65 20 74 68 69 |thing be|fore thi|
|00000590| 73 20 6c 69 6e 65 2c 20 | 74 68 65 6e 20 75 6e 70 |s line, |then unp|
|000005a0| 61 63 6b 0a 23 20 69 74 | 20 62 79 20 73 61 76 69 |ack.# it| by savi|
|000005b0| 6e 67 20 69 74 20 69 6e | 74 6f 20 61 20 66 69 6c |ng it in|to a fil|
|000005c0| 65 20 61 6e 64 20 74 79 | 70 69 6e 67 20 22 73 68 |e and ty|ping "sh|
|000005d0| 20 66 69 6c 65 22 2e 20 | 20 54 6f 20 6f 76 65 72 | file". | To over|
|000005e0| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 0a 23 |write ex|isting.#|
|000005f0| 20 66 69 6c 65 73 2c 20 | 74 79 70 65 20 22 73 68 | files, |type "sh|
|00000600| 20 66 69 6c 65 20 2d 63 | 22 2e 20 20 59 6f 75 20 | file -c|". You |
|00000610| 63 61 6e 20 61 6c 73 6f | 20 66 65 65 64 20 74 68 |can also| feed th|
|00000620| 69 73 20 61 73 20 73 74 | 61 6e 64 61 72 64 20 69 |is as st|andard i|
|00000630| 6e 70 75 74 20 76 69 61 | 0a 23 20 75 6e 73 68 61 |nput via|.# unsha|
|00000640| 72 2c 20 6f 72 20 62 79 | 20 74 79 70 69 6e 67 20 |r, or by| typing |
|00000650| 22 73 68 20 3c 66 69 6c | 65 22 2c 20 65 2e 67 2e |"sh <fil|e", e.g.|
|00000660| 2e 20 20 49 66 20 74 68 | 69 73 20 61 72 63 68 69 |. If th|is archi|
|00000670| 76 65 20 69 73 20 63 6f | 6d 70 6c 65 74 65 2c 20 |ve is co|mplete, |
|00000680| 79 6f 75 0a 23 20 77 69 | 6c 6c 20 73 65 65 20 74 |you.# wi|ll see t|
|00000690| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 6d 65 73 |he follo|wing mes|
|000006a0| 73 61 67 65 20 61 74 20 | 74 68 65 20 65 6e 64 3a |sage at |the end:|
|000006b0| 0a 23 09 09 22 45 6e 64 | 20 6f 66 20 61 72 63 68 |.#.."End| of arch|
|000006c0| 69 76 65 20 31 20 28 6f | 66 20 31 29 2e 22 0a 23 |ive 1 (o|f 1).".#|
|000006d0| 20 43 6f 6e 74 65 6e 74 | 73 3a 20 20 4d 41 4e 49 | Content|s: MANI|
|000006e0| 46 45 53 54 20 4d 61 6b | 65 66 69 6c 65 20 4d 61 |FEST Mak|efile Ma|
|000006f0| 73 74 65 72 20 4e 61 6d | 65 20 4e 6f 64 65 20 52 |ster Nam|e Node R|
|00000700| 45 41 44 4d 45 20 53 79 | 73 74 65 6d 20 64 75 70 |EADME Sy|stem dup|
|00000710| 2e 63 0a 23 20 57 72 61 | 70 70 65 64 20 62 79 20 |.c.# Wra|pped by |
|00000720| 73 75 40 61 77 61 72 65 | 20 6f 6e 20 54 68 75 20 |su@aware| on Thu |
|00000730| 4a 75 6c 20 32 36 20 31 | 35 3a 31 34 3a 33 38 20 |Jul 26 1|5:14:38 |
|00000740| 31 39 39 30 0a 50 41 54 | 48 3d 2f 62 69 6e 3a 2f |1990.PAT|H=/bin:/|
|00000750| 75 73 72 2f 62 69 6e 3a | 2f 75 73 72 2f 75 63 62 |usr/bin:|/usr/ucb|
|00000760| 20 3b 20 65 78 70 6f 72 | 74 20 50 41 54 48 0a 65 | ; expor|t PATH.e|
|00000770| 63 68 6f 20 27 0a 20 20 | 20 43 6f 70 79 72 69 67 |cho '. | Copyrig|
|00000780| 68 74 20 31 39 39 30 20 | 50 69 65 72 63 61 72 6c |ht 1990 |Piercarl|
|00000790| 6f 20 47 72 61 6e 64 69 | 2e 20 41 6c 6c 20 72 69 |o Grandi|. All ri|
|000007a0| 67 68 74 73 20 72 65 73 | 65 72 76 65 64 2e 0a 0a |ghts res|erved...|
|000007b0| 20 20 20 54 68 69 73 20 | 73 68 61 72 20 61 72 63 | This |shar arc|
|000007c0| 68 69 76 65 20 63 6f 6e | 74 61 69 6e 73 20 66 72 |hive con|tains fr|
|000007d0| 65 65 20 73 6f 66 74 77 | 61 72 65 3b 20 79 6f 75 |ee softw|are; you|
|000007e0| 20 63 61 6e 20 72 65 64 | 69 73 74 72 69 62 75 74 | can red|istribut|
|000007f0| 65 20 69 74 0a 20 20 20 | 61 6e 64 2f 6f 72 20 6d |e it. |and/or m|
|00000800| 6f 64 69 66 79 20 69 74 | 20 75 6e 64 65 72 20 74 |odify it| under t|
|00000810| 68 65 20 74 65 72 6d 73 | 20 6f 66 20 74 68 65 20 |he terms| of the |
|00000820| 47 4e 55 20 47 65 6e 65 | 72 61 6c 20 50 75 62 6c |GNU Gene|ral Publ|
|00000830| 69 63 20 4c 69 63 65 6e | 73 65 20 61 73 0a 20 20 |ic Licen|se as. |
|00000840| 20 70 75 62 6c 69 73 68 | 65 64 20 62 79 20 74 68 | publish|ed by th|
|00000850| 65 20 46 72 65 65 20 53 | 6f 66 74 77 61 72 65 20 |e Free S|oftware |
|00000860| 46 6f 75 6e 64 61 74 69 | 6f 6e 3b 20 65 69 74 68 |Foundati|on; eith|
|00000870| 65 72 20 76 65 72 73 69 | 6f 6e 20 31 2c 20 6f 72 |er versi|on 1, or|
|00000880| 0a 20 20 20 28 61 74 20 | 79 6f 75 72 20 6f 70 74 |. (at |your opt|
|00000890| 69 6f 6e 29 20 61 6e 79 | 20 6c 61 74 65 72 20 76 |ion) any| later v|
|000008a0| 65 72 73 69 6f 6e 2e 0a | 0a 20 20 20 41 73 20 61 |ersion..|. As a|
|000008b0| 20 73 70 65 63 69 61 6c | 20 63 61 73 65 2c 20 74 | special| case, t|
|000008c0| 68 65 20 64 72 69 76 65 | 72 20 63 6f 6e 74 61 69 |he drive|r contai|
|000008d0| 6e 65 64 20 68 65 72 65 | 69 6e 20 6d 61 79 20 62 |ned here|in may b|
|000008e0| 65 20 69 6e 63 6f 72 70 | 6f 72 61 74 65 64 0a 20 |e incorp|orated. |
|000008f0| 20 20 69 6e 20 61 6e 79 | 20 4f 53 20 6b 65 72 6e | in any| OS kern|
|00000900| 65 6c 2c 20 77 68 65 74 | 68 65 72 20 74 68 65 20 |el, whet|her the |
|00000910| 47 4e 55 20 47 65 6e 65 | 72 61 6c 20 50 75 62 6c |GNU Gene|ral Publ|
|00000920| 69 63 20 4c 69 63 65 6e | 73 65 20 61 70 70 6c 69 |ic Licen|se appli|
|00000930| 65 73 20 74 6f 0a 20 20 | 20 69 74 20 6f 72 20 6e |es to. | it or n|
|00000940| 6f 74 2e 0a 0a 20 20 20 | 54 68 69 73 20 64 72 69 |ot... |This dri|
|00000950| 76 65 72 20 69 73 20 64 | 69 73 74 72 69 62 75 74 |ver is d|istribut|
|00000960| 65 64 20 69 6e 20 74 68 | 65 20 68 6f 70 65 20 74 |ed in th|e hope t|
|00000970| 68 61 74 20 69 74 20 77 | 69 6c 6c 20 62 65 20 75 |hat it w|ill be u|
|00000980| 73 65 66 75 6c 2c 0a 20 | 20 20 62 75 74 20 57 49 |seful,. | but WI|
|00000990| 54 48 4f 55 54 20 41 4e | 59 20 57 41 52 52 41 4e |THOUT AN|Y WARRAN|
|000009a0| 54 59 3b 20 77 69 74 68 | 6f 75 74 20 65 76 65 6e |TY; with|out even|
|000009b0| 20 74 68 65 20 69 6d 70 | 6c 69 65 64 20 77 61 72 | the imp|lied war|
|000009c0| 72 61 6e 74 79 20 6f 66 | 0a 20 20 20 4d 45 52 43 |ranty of|. MERC|
|000009d0| 48 41 4e 54 41 42 49 4c | 49 54 59 20 6f 72 20 46 |HANTABIL|ITY or F|
|000009e0| 49 54 4e 45 53 53 20 46 | 4f 52 20 41 20 50 41 52 |ITNESS F|OR A PAR|
|000009f0| 54 49 43 55 4c 41 52 20 | 50 55 52 50 4f 53 45 2e |TICULAR |PURPOSE.|
|00000a00| 20 20 53 65 65 20 74 68 | 65 0a 20 20 20 47 4e 55 | See th|e. GNU|
|00000a10| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 20 | General| Public |
|00000a20| 4c 69 63 65 6e 73 65 20 | 66 6f 72 20 6d 6f 72 65 |License |for more|
|00000a30| 20 64 65 74 61 69 6c 73 | 2e 0a 0a 20 20 20 59 6f | details|... Yo|
|00000a40| 75 20 6d 61 79 20 68 61 | 76 65 20 72 65 63 65 69 |u may ha|ve recei|
|00000a50| 76 65 64 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ved a co|py of th|
|00000a60| 65 20 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 |e GNU Ge|neral Pu|
|00000a70| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 0a 20 20 20 |blic Lic|ense. |
|00000a80| 61 6c 6f 6e 67 20 77 69 | 74 68 20 74 68 69 73 20 |along wi|th this |
|00000a90| 64 72 69 76 65 72 3b 20 | 69 66 20 6e 6f 74 2c 20 |driver; |if not, |
|00000aa0| 77 72 69 74 65 20 74 6f | 20 74 68 65 20 46 72 65 |write to| the Fre|
|00000ab0| 65 20 53 6f 66 74 77 61 | 72 65 0a 20 20 20 46 6f |e Softwa|re. Fo|
|00000ac0| 75 6e 64 61 74 69 6f 6e | 2c 20 49 6e 63 2e 2c 20 |undation|, Inc., |
|00000ad0| 36 37 35 20 4d 61 73 73 | 20 41 76 65 2c 20 43 61 |675 Mass| Ave, Ca|
|00000ae0| 6d 62 72 69 64 67 65 2c | 20 4d 41 20 30 32 31 33 |mbridge,| MA 0213|
|00000af0| 39 2c 20 55 53 41 2e 0a | 27 0a 65 63 68 6f 20 34 |9, USA..|'.echo 4|
|00000b00| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 52 45 41 |.if test| -f 'REA|
|00000b10| 44 4d 45 27 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |DME' -a |"${1}" !|
|00000b20| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|00000b30| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|00000b40| 20 6e 6f 74 20 63 6c 6f | 62 62 65 72 20 65 78 69 | not clo|bber exi|
|00000b50| 73 74 69 6e 67 20 66 69 | 6c 65 20 5c 22 27 52 45 |sting fi|le \"'RE|
|00000b60| 41 44 4d 45 27 5c 22 0a | 65 6c 73 65 0a 65 63 68 |ADME'\".|else.ech|
|00000b70| 6f 20 73 68 61 72 3a 20 | 45 78 74 72 61 63 74 69 |o shar: |Extracti|
|00000b80| 6e 67 20 5c 22 27 52 45 | 41 44 4d 45 27 5c 22 20 |ng \"'RE|ADME'\" |
|00000b90| 5c 28 35 38 35 20 63 68 | 61 72 61 63 74 65 72 73 |\(585 ch|aracters|
|00000ba0| 5c 29 0a 73 65 64 20 22 | 73 2f 5e 58 2f 2f 22 20 |\).sed "|s/^X//" |
|00000bb0| 3e 27 52 45 41 44 4d 45 | 27 20 3c 3c 27 45 4e 44 |>'README|' <<'END|
|00000bc0| 5f 4f 46 5f 46 49 4c 45 | 27 0a 58 54 68 69 73 20 |_OF_FILE|'.XThis |
|00000bd0| 64 72 69 76 65 72 20 69 | 73 20 61 20 53 79 73 74 |driver i|s a Syst|
|00000be0| 65 6d 20 56 20 61 64 61 | 70 74 61 74 69 6f 6e 20 |em V ada|ptation |
|00000bf0| 6f 66 20 61 6e 20 65 71 | 75 69 76 61 6c 65 6e 74 |of an eq|uivalent|
|00000c00| 20 64 72 69 76 65 72 20 | 66 6f 72 20 34 2e 32 42 | driver |for 4.2B|
|00000c10| 53 44 2e 0a 58 54 68 65 | 20 6f 72 69 67 69 6e 61 |SD..XThe| origina|
|00000c20| 6c 20 69 64 65 61 20 61 | 70 70 65 61 72 65 64 20 |l idea a|ppeared |
|00000c30| 69 6e 20 56 65 72 73 69 | 6f 6e 20 38 20 55 6e 69 |in Versi|on 8 Uni|
|00000c40| 78 2e 0a 58 0a 58 57 68 | 65 6e 20 61 20 70 72 6f |x..X.XWh|en a pro|
|00000c50| 63 65 73 73 20 6f 70 65 | 6e 73 20 6d 69 6e 6f 72 |cess ope|ns minor|
|00000c60| 20 64 65 76 69 63 65 20 | 4e 20 6f 66 20 74 68 69 | device |N of thi|
|00000c70| 73 20 64 72 69 76 65 72 | 20 69 74 20 67 65 74 20 |s driver| it get |
|00000c80| 61 20 66 69 6c 65 20 64 | 65 73 63 72 69 70 74 6f |a file d|escripto|
|00000c90| 72 0a 58 77 68 69 63 68 | 20 69 73 20 61 20 64 75 |r.Xwhich| is a du|
|00000ca0| 70 6c 69 63 61 74 65 20 | 6f 66 20 69 74 73 20 6f |plicate |of its o|
|00000cb0| 77 6e 20 66 69 6c 65 20 | 64 65 73 63 72 69 70 74 |wn file |descript|
|00000cc0| 6f 72 20 4e 2c 20 61 73 | 20 69 66 20 61 20 64 75 |or N, as| if a du|
|00000cd0| 70 28 32 29 20 63 61 6c | 6c 20 68 61 64 0a 58 62 |p(2) cal|l had.Xb|
|00000ce0| 65 65 6e 20 65 66 66 65 | 63 74 65 64 2e 0a 58 0a |een effe|cted..X.|
|00000cf0| 58 54 68 69 73 20 69 73 | 20 6d 6f 73 74 20 75 73 |XThis is| most us|
|00000d00| 65 66 75 6c 20 74 6f 20 | 6d 61 6b 65 20 69 74 20 |eful to |make it |
|00000d10| 70 6f 73 73 69 62 6c 65 | 20 74 6f 20 72 65 64 69 |possible| to redi|
|00000d20| 72 65 63 74 20 74 6f 20 | 74 68 65 20 73 74 61 6e |rect to |the stan|
|00000d30| 64 61 72 64 20 69 6e 70 | 75 74 0a 58 6f 75 74 70 |dard inp|ut.Xoutp|
|00000d40| 75 74 20 61 6e 64 20 65 | 72 72 6f 72 20 73 74 72 |ut and e|rror str|
|00000d50| 65 61 6d 73 20 70 72 6f | 67 72 61 6d 73 20 74 68 |eams pro|grams th|
|00000d60| 61 74 20 72 65 71 75 69 | 72 65 20 61 20 6e 61 6d |at requi|re a nam|
|00000d70| 65 64 20 66 69 6c 65 20 | 61 73 20 6f 70 65 72 61 |ed file |as opera|
|00000d80| 6e 64 2e 20 46 6f 72 0a | 58 65 78 61 6d 70 6c 65 |nd. For.|Xexample|
|00000d90| 2c 20 73 6f 6d 65 74 68 | 69 6e 67 20 6c 69 6b 65 |, someth|ing like|
|00000da0| 0a 58 0a 58 09 63 70 20 | 2f 65 74 63 2f 70 61 73 |.X.X.cp |/etc/pas|
|00000db0| 73 77 64 20 2f 64 65 76 | 2f 73 74 64 6f 75 74 20 |swd /dev|/stdout |
|00000dc0| 7c 20 77 63 0a 58 0a 58 | 77 69 6c 6c 20 77 6f 72 || wc.X.X|will wor|
|00000dd0| 6b 20 61 73 20 69 6e 74 | 65 6e 64 65 64 20 28 74 |k as int|ended (t|
|00000de0| 68 69 73 20 70 61 72 74 | 69 63 75 6c 61 72 20 65 |his part|icular e|
|00000df0| 78 61 6d 70 6c 65 20 6d | 61 79 20 6e 6f 74 20 62 |xample m|ay not b|
|00000e00| 65 20 76 65 72 79 20 75 | 73 65 66 75 6c 2c 20 62 |e very u|seful, b|
|00000e10| 75 74 0a 58 6f 74 68 65 | 72 73 20 61 72 65 29 2e |ut.Xothe|rs are).|
|00000e20| 0a 58 0a 45 4e 44 5f 4f | 46 5f 46 49 4c 45 0a 69 |.X.END_O|F_FILE.i|
|00000e30| 66 20 74 65 73 74 20 35 | 38 35 20 2d 6e 65 20 60 |f test 5|85 -ne `|
|00000e40| 77 63 20 2d 63 20 3c 27 | 52 45 41 44 4d 45 27 60 |wc -c <'|README'`|
|00000e50| 3b 20 74 68 65 6e 0a 20 | 20 20 20 65 63 68 6f 20 |; then. | echo |
|00000e60| 73 68 61 72 3a 20 5c 22 | 27 52 45 41 44 4d 45 27 |shar: \"|'README'|
|00000e70| 5c 22 20 75 6e 70 61 63 | 6b 65 64 20 77 69 74 68 |\" unpac|ked with|
|00000e80| 20 77 72 6f 6e 67 20 73 | 69 7a 65 21 0a 66 69 0a | wrong s|ize!.fi.|
|00000e90| 23 20 65 6e 64 20 6f 66 | 20 27 52 45 41 44 4d 45 |# end of| 'README|
|00000ea0| 27 0a 66 69 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |'.fi.if |test -f |
|00000eb0| 27 4d 41 4e 49 46 45 53 | 54 27 20 2d 61 20 22 24 |'MANIFES|T' -a "$|
|00000ec0| 7b 31 7d 22 20 21 3d 20 | 22 2d 63 22 20 3b 20 74 |{1}" != |"-c" ; t|
|00000ed0| 68 65 6e 20 0a 20 20 65 | 63 68 6f 20 73 68 61 72 |hen . e|cho shar|
|00000ee0| 3a 20 57 69 6c 6c 20 6e | 6f 74 20 63 6c 6f 62 62 |: Will n|ot clobb|
|00000ef0| 65 72 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |er exist|ing file|
|00000f00| 20 5c 22 27 4d 41 4e 49 | 46 45 53 54 27 5c 22 0a | \"'MANI|FEST'\".|
|00000f10| 65 6c 73 65 0a 65 63 68 | 6f 20 73 68 61 72 3a 20 |else.ech|o shar: |
|00000f20| 45 78 74 72 61 63 74 69 | 6e 67 20 5c 22 27 4d 41 |Extracti|ng \"'MA|
|00000f30| 4e 49 46 45 53 54 27 5c | 22 20 5c 28 33 36 32 20 |NIFEST'\|" \(362 |
|00000f40| 63 68 61 72 61 63 74 65 | 72 73 5c 29 0a 73 65 64 |characte|rs\).sed|
|00000f50| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 27 4d 41 4e 49 | "s/^X//|" >'MANI|
|00000f60| 46 45 53 54 27 20 3c 3c | 27 45 4e 44 5f 4f 46 5f |FEST' <<|'END_OF_|
|00000f70| 46 49 4c 45 27 0a 58 20 | 20 20 46 69 6c 65 20 4e |FILE'.X | File N|
|00000f80| 61 6d 65 09 09 41 72 63 | 68 69 76 65 20 23 09 44 |ame..Arc|hive #.D|
|00000f90| 65 73 63 72 69 70 74 69 | 6f 6e 0a 58 2d 2d 2d 2d |escripti|on.X----|
|00000fa0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000fb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000fc0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000fd0| 2d 2d 2d 2d 2d 2d 2d 0a | 58 20 4d 41 4e 49 46 45 |-------.|X MANIFE|
|00000fe0| 53 54 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ST | |
|00000ff0| 20 20 20 20 20 31 09 54 | 68 69 73 20 73 68 69 70 | 1.T|his ship|
|00001000| 70 69 6e 67 20 6c 69 73 | 74 0a 58 20 4d 61 6b 65 |ping lis|t.X Make|
|00001010| 66 69 6c 65 20 20 20 20 | 20 20 20 20 20 20 20 20 |file | |
|00001020| 20 20 20 20 20 20 20 31 | 09 0a 58 20 4d 61 73 74 | 1|..X Mast|
|00001030| 65 72 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |er | |
|00001040| 20 20 20 20 20 20 20 31 | 09 0a 58 20 4e 61 6d 65 | 1|..X Name|
|00001050| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001060| 20 20 20 20 20 20 20 31 | 09 0a 58 20 4e 6f 64 65 | 1|..X Node|
|00001070| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001080| 20 20 20 20 20 20 20 31 | 09 0a 58 20 52 45 41 44 | 1|..X READ|
|00001090| 4d 45 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ME | |
|000010a0| 20 20 20 20 20 20 20 31 | 09 0a 58 20 53 79 73 74 | 1|..X Syst|
|000010b0| 65 6d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |em | |
|000010c0| 20 20 20 20 20 20 20 31 | 09 0a 58 20 64 75 70 2e | 1|..X dup.|
|000010d0| 63 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |c | |
|000010e0| 20 20 20 20 20 20 20 31 | 09 0a 45 4e 44 5f 4f 46 | 1|..END_OF|
|000010f0| 5f 46 49 4c 45 0a 69 66 | 20 74 65 73 74 20 33 36 |_FILE.if| test 36|
|00001100| 32 20 2d 6e 65 20 60 77 | 63 20 2d 63 20 3c 27 4d |2 -ne `w|c -c <'M|
|00001110| 41 4e 49 46 45 53 54 27 | 60 3b 20 74 68 65 6e 0a |ANIFEST'|`; then.|
|00001120| 20 20 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 5c | echo| shar: \|
|00001130| 22 27 4d 41 4e 49 46 45 | 53 54 27 5c 22 20 75 6e |"'MANIFE|ST'\" un|
|00001140| 70 61 63 6b 65 64 20 77 | 69 74 68 20 77 72 6f 6e |packed w|ith wron|
|00001150| 67 20 73 69 7a 65 21 0a | 66 69 0a 23 20 65 6e 64 |g size!.|fi.# end|
|00001160| 20 6f 66 20 27 4d 41 4e | 49 46 45 53 54 27 0a 66 | of 'MAN|IFEST'.f|
|00001170| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 4d 61 |i.if tes|t -f 'Ma|
|00001180| 6b 65 66 69 6c 65 27 20 | 2d 61 20 22 24 7b 31 7d |kefile' |-a "${1}|
|00001190| 22 20 21 3d 20 22 2d 63 | 22 20 3b 20 74 68 65 6e |" != "-c|" ; then|
|000011a0| 20 0a 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 57 | . echo| shar: W|
|000011b0| 69 6c 6c 20 6e 6f 74 20 | 63 6c 6f 62 62 65 72 20 |ill not |clobber |
|000011c0| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 5c 22 |existing| file \"|
|000011d0| 27 4d 61 6b 65 66 69 6c | 65 27 5c 22 0a 65 6c 73 |'Makefil|e'\".els|
|000011e0| 65 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 78 74 |e.echo s|har: Ext|
|000011f0| 72 61 63 74 69 6e 67 20 | 5c 22 27 4d 61 6b 65 66 |racting |\"'Makef|
|00001200| 69 6c 65 27 5c 22 20 5c | 28 31 37 31 20 63 68 61 |ile'\" \|(171 cha|
|00001210| 72 61 63 74 65 72 73 5c | 29 0a 73 65 64 20 22 73 |racters\|).sed "s|
|00001220| 2f 5e 58 2f 2f 22 20 3e | 27 4d 61 6b 65 66 69 6c |/^X//" >|'Makefil|
|00001230| 65 27 20 3c 3c 27 45 4e | 44 5f 4f 46 5f 46 49 4c |e' <<'EN|D_OF_FIL|
|00001240| 45 27 0a 58 43 4f 4e 46 | 09 09 3d 2f 65 74 63 2f |E'.XCONF|..=/etc/|
|00001250| 63 6f 6e 66 2f 62 69 6e | 2f 0a 58 43 43 09 09 3d |conf/bin|/.XCC..=|
|00001260| 63 63 0a 58 43 46 4c 41 | 47 53 09 09 3d 2d 4f 20 |cc.XCFLA|GS..=-O |
|00001270| 2d 44 49 4e 4b 45 52 4e | 45 4c 0a 58 0a 58 44 72 |-DINKERN|EL.X.XDr|
|00001280| 69 76 65 72 2e 6f 3a 09 | 64 75 70 2e 6f 3b 09 09 |iver.o:.|dup.o;..|
|00001290| 09 6c 6e 20 24 3f 20 24 | 40 0a 58 0a 58 69 6e 73 |.ln $? $|@.X.Xins|
|000012a0| 74 61 6c 6c 3a 09 44 72 | 69 76 65 72 2e 6f 20 4d |tall:.Dr|iver.o M|
|000012b0| 61 73 74 65 72 20 53 79 | 73 74 65 6d 20 4e 6f 64 |aster Sy|stem Nod|
|000012c0| 65 20 4e 61 6d 65 0a 58 | 09 24 28 43 4f 4e 46 29 |e Name.X|.$(CONF)|
|000012d0| 69 64 69 6e 73 74 61 6c | 6c 20 2d 6b 65 75 20 64 |idinstal|l -keu d|
|000012e0| 75 70 0a 58 09 24 28 43 | 4f 4e 46 29 69 64 6d 6b |up.X.$(C|ONF)idmk|
|000012f0| 6e 6f 64 20 2d 73 0a 45 | 4e 44 5f 4f 46 5f 46 49 |nod -s.E|ND_OF_FI|
|00001300| 4c 45 0a 69 66 20 74 65 | 73 74 20 31 37 31 20 2d |LE.if te|st 171 -|
|00001310| 6e 65 20 60 77 63 20 2d | 63 20 3c 27 4d 61 6b 65 |ne `wc -|c <'Make|
|00001320| 66 69 6c 65 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |file'`; |then. |
|00001330| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 4d | echo sh|ar: \"'M|
|00001340| 61 6b 65 66 69 6c 65 27 | 5c 22 20 75 6e 70 61 63 |akefile'|\" unpac|
|00001350| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|00001360| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|00001370| 20 27 4d 61 6b 65 66 69 | 6c 65 27 0a 66 69 0a 69 | 'Makefi|le'.fi.i|
|00001380| 66 20 74 65 73 74 20 2d | 66 20 27 4d 61 73 74 65 |f test -|f 'Maste|
|00001390| 72 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |r' -a "$|{1}" != |
|000013a0| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|000013b0| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|000013c0| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|000013d0| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 4d 61 73 74 |ing file| \"'Mast|
|000013e0| 65 72 27 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |er'\".el|se.echo |
|000013f0| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00001400| 20 5c 22 27 4d 61 73 74 | 65 72 27 5c 22 20 5c 28 | \"'Mast|er'\" \(|
|00001410| 32 36 20 63 68 61 72 61 | 63 74 65 72 73 5c 29 0a |26 chara|cters\).|
|00001420| 73 65 64 20 22 73 2f 5e | 58 2f 2f 22 20 3e 27 4d |sed "s/^|X//" >'M|
|00001430| 61 73 74 65 72 27 20 3c | 3c 27 45 4e 44 5f 4f 46 |aster' <|<'END_OF|
|00001440| 5f 46 49 4c 45 27 0a 58 | 64 75 70 09 6f 09 63 69 |_FILE'.X|dup.o.ci|
|00001450| 6f 09 64 75 70 09 30 09 | 35 35 09 31 09 31 09 2d |o.dup.0.|55.1.1.-|
|00001460| 31 0a 45 4e 44 5f 4f 46 | 5f 46 49 4c 45 0a 69 66 |1.END_OF|_FILE.if|
|00001470| 20 74 65 73 74 20 32 36 | 20 2d 6e 65 20 60 77 63 | test 26| -ne `wc|
|00001480| 20 2d 63 20 3c 27 4d 61 | 73 74 65 72 27 60 3b 20 | -c <'Ma|ster'`; |
|00001490| 74 68 65 6e 0a 20 20 20 | 20 65 63 68 6f 20 73 68 |then. | echo sh|
|000014a0| 61 72 3a 20 5c 22 27 4d | 61 73 74 65 72 27 5c 22 |ar: \"'M|aster'\"|
|000014b0| 20 75 6e 70 61 63 6b 65 | 64 20 77 69 74 68 20 77 | unpacke|d with w|
|000014c0| 72 6f 6e 67 20 73 69 7a | 65 21 0a 66 69 0a 23 20 |rong siz|e!.fi.# |
|000014d0| 65 6e 64 20 6f 66 20 27 | 4d 61 73 74 65 72 27 0a |end of '|Master'.|
|000014e0| 66 69 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 4e |fi.if te|st -f 'N|
|000014f0| 61 6d 65 27 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |ame' -a |"${1}" !|
|00001500| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|00001510| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|00001520| 20 6e 6f 74 20 63 6c 6f | 62 62 65 72 20 65 78 69 | not clo|bber exi|
|00001530| 73 74 69 6e 67 20 66 69 | 6c 65 20 5c 22 27 4e 61 |sting fi|le \"'Na|
|00001540| 6d 65 27 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |me'\".el|se.echo |
|00001550| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00001560| 20 5c 22 27 4e 61 6d 65 | 27 5c 22 20 5c 28 34 30 | \"'Name|'\" \(40|
|00001570| 20 63 68 61 72 61 63 74 | 65 72 73 5c 29 0a 73 65 | charact|ers\).se|
|00001580| 64 20 22 73 2f 5e 58 2f | 2f 22 20 3e 27 4e 61 6d |d "s/^X/|/" >'Nam|
|00001590| 65 27 20 3c 3c 27 45 4e | 44 5f 4f 46 5f 46 49 4c |e' <<'EN|D_OF_FIL|
|000015a0| 45 27 0a 58 64 75 70 20 | 46 69 6c 65 20 64 65 73 |E'.Xdup |File des|
|000015b0| 63 72 69 70 74 6f 72 20 | 64 75 70 28 32 29 20 63 |criptor |dup(2) c|
|000015c0| 6c 6f 6e 65 20 64 72 69 | 76 65 72 0a 45 4e 44 5f |lone dri|ver.END_|
|000015d0| 4f 46 5f 46 49 4c 45 0a | 69 66 20 74 65 73 74 20 |OF_FILE.|if test |
|000015e0| 34 30 20 2d 6e 65 20 60 | 77 63 20 2d 63 20 3c 27 |40 -ne `|wc -c <'|
|000015f0| 4e 61 6d 65 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |Name'`; |then. |
|00001600| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 4e | echo sh|ar: \"'N|
|00001610| 61 6d 65 27 5c 22 20 75 | 6e 70 61 63 6b 65 64 20 |ame'\" u|npacked |
|00001620| 77 69 74 68 20 77 72 6f | 6e 67 20 73 69 7a 65 21 |with wro|ng size!|
|00001630| 0a 66 69 0a 23 20 65 6e | 64 20 6f 66 20 27 4e 61 |.fi.# en|d of 'Na|
|00001640| 6d 65 27 0a 66 69 0a 69 | 66 20 74 65 73 74 20 2d |me'.fi.i|f test -|
|00001650| 66 20 27 4e 6f 64 65 27 | 20 2d 61 20 22 24 7b 31 |f 'Node'| -a "${1|
|00001660| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00001670| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|00001680| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|00001690| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|000016a0| 22 27 4e 6f 64 65 27 5c | 22 0a 65 6c 73 65 0a 65 |"'Node'\|".else.e|
|000016b0| 63 68 6f 20 73 68 61 72 | 3a 20 45 78 74 72 61 63 |cho shar|: Extrac|
|000016c0| 74 69 6e 67 20 5c 22 27 | 4e 6f 64 65 27 5c 22 20 |ting \"'|Node'\" |
|000016d0| 5c 28 34 34 20 63 68 61 | 72 61 63 74 65 72 73 5c |\(44 cha|racters\|
|000016e0| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|000016f0| 27 4e 6f 64 65 27 20 3c | 3c 27 45 4e 44 5f 4f 46 |'Node' <|<'END_OF|
|00001700| 5f 46 49 4c 45 27 0a 58 | 64 75 70 09 73 74 64 69 |_FILE'.X|dup.stdi|
|00001710| 6e 09 63 09 30 0a 58 64 | 75 70 09 73 74 64 6f 75 |n.c.0.Xd|up.stdou|
|00001720| 74 09 63 09 31 0a 58 64 | 75 70 09 73 74 64 65 72 |t.c.1.Xd|up.stder|
|00001730| 72 09 63 09 32 0a 45 4e | 44 5f 4f 46 5f 46 49 4c |r.c.2.EN|D_OF_FIL|
|00001740| 45 0a 69 66 20 74 65 73 | 74 20 34 34 20 2d 6e 65 |E.if tes|t 44 -ne|
|00001750| 20 60 77 63 20 2d 63 20 | 3c 27 4e 6f 64 65 27 60 | `wc -c |<'Node'`|
|00001760| 3b 20 74 68 65 6e 0a 20 | 20 20 20 65 63 68 6f 20 |; then. | echo |
|00001770| 73 68 61 72 3a 20 5c 22 | 27 4e 6f 64 65 27 5c 22 |shar: \"|'Node'\"|
|00001780| 20 75 6e 70 61 63 6b 65 | 64 20 77 69 74 68 20 77 | unpacke|d with w|
|00001790| 72 6f 6e 67 20 73 69 7a | 65 21 0a 66 69 0a 23 20 |rong siz|e!.fi.# |
|000017a0| 65 6e 64 20 6f 66 20 27 | 4e 6f 64 65 27 0a 66 69 |end of '|Node'.fi|
|000017b0| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 53 79 73 |.if test| -f 'Sys|
|000017c0| 74 65 6d 27 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |tem' -a |"${1}" !|
|000017d0| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|000017e0| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|000017f0| 20 6e 6f 74 20 63 6c 6f | 62 62 65 72 20 65 78 69 | not clo|bber exi|
|00001800| 73 74 69 6e 67 20 66 69 | 6c 65 20 5c 22 27 53 79 |sting fi|le \"'Sy|
|00001810| 73 74 65 6d 27 5c 22 0a | 65 6c 73 65 0a 65 63 68 |stem'\".|else.ech|
|00001820| 6f 20 73 68 61 72 3a 20 | 45 78 74 72 61 63 74 69 |o shar: |Extracti|
|00001830| 6e 67 20 5c 22 27 53 79 | 73 74 65 6d 27 5c 22 20 |ng \"'Sy|stem'\" |
|00001840| 5c 28 32 32 20 63 68 61 | 72 61 63 74 65 72 73 5c |\(22 cha|racters\|
|00001850| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|00001860| 27 53 79 73 74 65 6d 27 | 20 3c 3c 27 45 4e 44 5f |'System'| <<'END_|
|00001870| 4f 46 5f 46 49 4c 45 27 | 0a 58 64 75 70 09 59 09 |OF_FILE'|.Xdup.Y.|
|00001880| 31 09 30 09 30 09 30 09 | 30 09 30 09 30 09 30 0a |1.0.0.0.|0.0.0.0.|
|00001890| 45 4e 44 5f 4f 46 5f 46 | 49 4c 45 0a 69 66 20 74 |END_OF_F|ILE.if t|
|000018a0| 65 73 74 20 32 32 20 2d | 6e 65 20 60 77 63 20 2d |est 22 -|ne `wc -|
|000018b0| 63 20 3c 27 53 79 73 74 | 65 6d 27 60 3b 20 74 68 |c <'Syst|em'`; th|
|000018c0| 65 6e 0a 20 20 20 20 65 | 63 68 6f 20 73 68 61 72 |en. e|cho shar|
|000018d0| 3a 20 5c 22 27 53 79 73 | 74 65 6d 27 5c 22 20 75 |: \"'Sys|tem'\" u|
|000018e0| 6e 70 61 63 6b 65 64 20 | 77 69 74 68 20 77 72 6f |npacked |with wro|
|000018f0| 6e 67 20 73 69 7a 65 21 | 0a 66 69 0a 23 20 65 6e |ng size!|.fi.# en|
|00001900| 64 20 6f 66 20 27 53 79 | 73 74 65 6d 27 0a 66 69 |d of 'Sy|stem'.fi|
|00001910| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 64 75 70 |.if test| -f 'dup|
|00001920| 2e 63 27 20 2d 61 20 22 | 24 7b 31 7d 22 20 21 3d |.c' -a "|${1}" !=|
|00001930| 20 22 2d 63 22 20 3b 20 | 74 68 65 6e 20 0a 20 20 | "-c" ; |then . |
|00001940| 65 63 68 6f 20 73 68 61 | 72 3a 20 57 69 6c 6c 20 |echo sha|r: Will |
|00001950| 6e 6f 74 20 63 6c 6f 62 | 62 65 72 20 65 78 69 73 |not clob|ber exis|
|00001960| 74 69 6e 67 20 66 69 6c | 65 20 5c 22 27 64 75 70 |ting fil|e \"'dup|
|00001970| 2e 63 27 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |.c'\".el|se.echo |
|00001980| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00001990| 20 5c 22 27 64 75 70 2e | 63 27 5c 22 20 5c 28 33 | \"'dup.|c'\" \(3|
|000019a0| 31 31 38 20 63 68 61 72 | 61 63 74 65 72 73 5c 29 |118 char|acters\)|
|000019b0| 0a 73 65 64 20 22 73 2f | 5e 58 2f 2f 22 20 3e 27 |.sed "s/|^X//" >'|
|000019c0| 64 75 70 2e 63 27 20 3c | 3c 27 45 4e 44 5f 4f 46 |dup.c' <|<'END_OF|
|000019d0| 5f 46 49 4c 45 27 0a 58 | 2f 2a 0a 58 20 20 20 20 |_FILE'.X|/*.X |
|000019e0| 24 48 65 61 64 65 72 3a | 20 2f 61 77 61 72 65 30 |$Header:| /aware0|
|000019f0| 2f 73 72 63 2f 64 75 70 | 2f 64 75 70 2e 63 2c 76 |/src/dup|/dup.c,v|
|00001a00| 20 31 2e 32 20 39 30 2f | 30 37 2f 32 36 20 31 32 | 1.2 90/|07/26 12|
|00001a10| 3a 35 35 3a 34 34 20 73 | 77 20 45 78 70 20 24 0a |:55:44 s|w Exp $.|
|00001a20| 58 2a 2f 0a 58 0a 58 23 | 69 6e 63 6c 75 64 65 20 |X*/.X.X#|include |
|00001a30| 3c 73 79 73 2f 70 61 72 | 61 6d 2e 68 3e 0a 58 23 |<sys/par|am.h>.X#|
|00001a40| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 74 79 70 |include |<sys/typ|
|00001a50| 65 73 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |es.h>.X#|include |
|00001a60| 3c 73 79 73 2f 73 79 73 | 6d 61 63 72 6f 73 2e 68 |<sys/sys|macros.h|
|00001a70| 3e 0a 58 23 69 6e 63 6c | 75 64 65 20 3c 73 79 73 |>.X#incl|ude <sys|
|00001a80| 2f 64 69 72 2e 68 3e 0a | 58 23 69 6e 63 6c 75 64 |/dir.h>.|X#includ|
|00001a90| 65 20 3c 73 79 73 2f 66 | 69 6c 65 2e 68 3e 0a 58 |e <sys/f|ile.h>.X|
|00001aa0| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 69 6e |#include| <sys/in|
|00001ab0| 6f 64 65 2e 68 3e 0a 58 | 23 69 6e 63 6c 75 64 65 |ode.h>.X|#include|
|00001ac0| 20 3c 73 79 73 2f 73 69 | 67 6e 61 6c 2e 68 3e 0a | <sys/si|gnal.h>.|
|00001ad0| 58 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 2f 65 |X#includ|e <sys/e|
|00001ae0| 72 72 6e 6f 2e 68 3e 0a | 58 23 69 6e 63 6c 75 64 |rrno.h>.|X#includ|
|00001af0| 65 20 3c 73 79 73 2f 75 | 73 65 72 2e 68 3e 0a 58 |e <sys/u|ser.h>.X|
|00001b00| 0a 58 2f 2a 0a 58 20 20 | 20 20 34 2e 32 20 42 53 |.X/*.X | 4.2 BS|
|00001b10| 44 20 70 73 65 75 64 6f | 2d 64 65 76 69 63 65 20 |D pseudo|-device |
|00001b20| 64 72 69 76 65 72 20 66 | 6f 72 20 74 68 65 20 22 |driver f|or the "|
|00001b30| 66 64 22 20 64 65 76 69 | 63 65 2e 20 20 41 6e 20 |fd" devi|ce. An |
|00001b40| 61 74 74 65 6d 70 74 20 | 74 6f 0a 58 20 20 20 20 |attempt |to.X |
|00001b50| 6f 70 65 6e 20 74 68 69 | 73 20 64 65 76 69 63 65 |open thi|s device|
|00001b60| 20 72 65 74 75 72 6e 73 | 20 61 20 66 69 6c 65 20 | returns| a file |
|00001b70| 64 65 73 63 72 69 70 74 | 6f 72 20 77 68 69 63 68 |descript|or which|
|00001b80| 20 69 73 20 61 20 22 64 | 75 70 6c 69 63 61 74 65 | is a "d|uplicate|
|00001b90| 22 0a 58 20 20 20 20 6f | 66 20 74 68 65 20 6f 70 |".X o|f the op|
|00001ba0| 65 6e 20 66 69 6c 65 20 | 64 65 73 63 72 69 70 74 |en file |descript|
|00001bb0| 6f 72 20 63 6f 72 72 65 | 73 70 6f 6e 64 69 6e 67 |or corre|sponding|
|00001bc0| 20 74 6f 20 74 68 65 20 | 6d 69 6e 6f 72 20 64 65 | to the |minor de|
|00001bd0| 76 69 63 65 0a 58 20 20 | 20 20 6e 75 6d 62 65 72 |vice.X | number|
|00001be0| 20 6f 66 20 74 68 65 20 | 70 61 72 74 69 63 75 6c | of the |particul|
|00001bf0| 61 72 20 66 69 6c 65 64 | 65 73 63 20 64 65 76 69 |ar filed|esc devi|
|00001c00| 63 65 20 6f 70 65 6e 65 | 64 2e 20 20 46 6f 72 20 |ce opene|d. For |
|00001c10| 65 78 61 6d 70 6c 65 2c | 20 74 68 65 0a 58 20 20 |example,| the.X |
|00001c20| 20 20 64 65 76 69 63 65 | 20 2f 64 65 76 2f 73 74 | device| /dev/st|
|00001c30| 64 69 6e 20 69 73 20 61 | 20 66 64 20 64 65 76 69 |din is a| fd devi|
|00001c40| 63 65 20 77 69 74 68 20 | 6d 69 6e 6f 72 20 64 65 |ce with |minor de|
|00001c50| 76 69 63 65 20 30 2e 20 | 20 4f 70 65 6e 69 6e 67 |vice 0. | Opening|
|00001c60| 0a 58 20 20 20 20 2f 64 | 65 76 2f 73 74 64 69 6e |.X /d|ev/stdin|
|00001c70| 20 72 65 74 75 72 6e 73 | 20 61 20 64 75 70 6c 69 | returns| a dupli|
|00001c80| 63 61 74 65 20 6f 66 20 | 66 69 6c 65 20 64 65 73 |cate of |file des|
|00001c90| 63 72 69 70 74 6f 72 20 | 30 2c 20 65 71 75 69 76 |criptor |0, equiv|
|00001ca0| 61 6c 65 6e 74 20 74 6f | 0a 58 20 20 20 20 66 64 |alent to|.X fd|
|00001cb0| 28 30 29 2e 20 20 54 68 | 65 20 6f 70 65 6e 20 6d |(0). Th|e open m|
|00001cc0| 6f 64 65 20 6d 75 73 74 | 20 62 65 20 74 68 65 20 |ode must| be the |
|00001cd0| 73 61 6d 65 20 61 73 20 | 74 68 65 20 6d 6f 64 65 |same as |the mode|
|00001ce0| 20 6f 66 20 74 68 65 20 | 66 69 6c 65 0a 58 20 20 | of the |file.X |
|00001cf0| 20 20 64 65 73 63 72 69 | 70 74 6f 72 20 62 65 69 | descri|ptor bei|
|00001d00| 6e 67 20 64 75 70 6c 69 | 63 61 74 65 64 2c 20 65 |ng dupli|cated, e|
|00001d10| 78 63 65 70 74 20 74 68 | 61 74 20 61 20 72 65 61 |xcept th|at a rea|
|00001d20| 64 2f 77 72 69 74 65 20 | 66 69 6c 65 0a 58 20 20 |d/write |file.X |
|00001d30| 20 20 64 65 73 63 72 69 | 70 74 6f 72 20 63 61 6e | descri|ptor can|
|00001d40| 20 62 65 20 64 75 70 65 | 64 20 66 6f 72 20 6a 75 | be dupe|d for ju|
|00001d50| 73 74 20 72 65 61 64 20 | 6f 72 20 6a 75 73 74 20 |st read |or just |
|00001d60| 77 72 69 74 65 2e 0a 58 | 0a 58 20 20 20 20 54 68 |write..X|.X Th|
|00001d70| 65 20 69 64 65 61 20 6f | 66 20 22 2f 64 65 76 2f |e idea o|f "/dev/|
|00001d80| 73 74 64 69 6e 22 20 6f | 72 69 67 69 6e 61 74 65 |stdin" o|riginate|
|00001d90| 64 20 69 6e 20 42 65 6c | 6c 20 4c 61 62 73 20 55 |d in Bel|l Labs U|
|00001da0| 4e 49 58 20 38 74 68 20 | 45 64 69 74 69 6f 6e 0a |NIX 8th |Edition.|
|00001db0| 58 20 20 20 20 28 72 65 | 73 65 61 72 63 68 20 76 |X (re|search v|
|00001dc0| 65 72 73 69 6f 6e 20 38 | 29 20 61 6e 64 20 77 61 |ersion 8|) and wa|
|00001dd0| 73 20 64 65 73 63 72 69 | 62 65 64 20 62 79 20 52 |s descri|bed by R|
|00001de0| 6f 62 20 50 69 6b 65 20 | 61 74 20 74 68 65 20 53 |ob Pike |at the S|
|00001df0| 75 6d 6d 65 72 0a 58 20 | 20 20 20 31 39 38 35 20 |ummer.X | 1985 |
|00001e00| 55 73 65 6e 69 78 20 43 | 6f 6e 66 65 72 65 6e 63 |Usenix C|onferenc|
|00001e10| 65 20 69 6e 20 50 6f 72 | 74 6c 61 6e 64 2e 20 20 |e in Por|tland. |
|00001e20| 57 65 20 75 73 65 20 74 | 68 65 20 6e 61 6d 65 73 |We use t|he names|
|00001e30| 0a 58 20 20 20 20 22 2f | 64 65 76 2f 73 74 64 69 |.X "/|dev/stdi|
|00001e40| 6e 22 2c 20 22 2f 64 65 | 76 2f 73 74 64 6f 75 74 |n", "/de|v/stdout|
|00001e50| 22 2c 20 61 6e 64 20 22 | 2f 64 65 76 2f 73 74 64 |", and "|/dev/std|
|00001e60| 65 72 72 22 20 66 6f 72 | 20 6d 69 6e 6f 72 20 64 |err" for| minor d|
|00001e70| 65 76 69 63 65 73 0a 58 | 20 20 20 20 30 2c 31 2c |evices.X| 0,1,|
|00001e80| 20 61 6e 64 20 32 2c 20 | 61 73 20 77 65 6c 6c 20 | and 2, |as well |
|00001e90| 61 73 20 74 68 65 20 6e | 61 6d 65 73 20 22 2f 64 |as the n|ames "/d|
|00001ea0| 65 76 2f 66 64 58 58 22 | 20 66 6f 72 20 58 58 20 |ev/fdXX"| for XX |
|00001eb0| 72 61 6e 67 69 6e 67 20 | 66 72 6f 6d 20 30 0a 58 |ranging |from 0.X|
|00001ec0| 20 20 20 20 74 6f 20 4e | 4f 46 49 4c 45 2d 31 2e | to N|OFILE-1.|
|00001ed0| 20 20 54 68 65 20 70 72 | 6f 74 65 63 74 69 6f 6e | The pr|otection|
|00001ee0| 20 6d 6f 64 65 20 6f 66 | 20 74 68 65 20 64 65 76 | mode of| the dev|
|00001ef0| 69 63 65 20 69 6e 6f 64 | 65 73 20 73 68 6f 75 6c |ice inod|es shoul|
|00001f00| 64 20 62 65 0a 58 20 20 | 20 20 30 36 36 36 2e 0a |d be.X | 0666..|
|00001f10| 58 0a 58 20 20 20 20 22 | 66 64 22 20 64 72 69 76 |X.X "|fd" driv|
|00001f20| 65 72 20 77 72 69 74 74 | 65 6e 20 31 36 2d 4a 75 |er writt|en 16-Ju|
|00001f30| 6e 2d 38 35 20 62 79 20 | 44 61 72 77 79 6e 20 50 |n-85 by |Darwyn P|
|00001f40| 65 61 63 68 65 79 2c 20 | 43 6f 6d 70 75 74 65 72 |eachey, |Computer|
|00001f50| 20 53 63 69 65 6e 63 65 | 0a 58 20 20 20 20 52 65 | Science|.X Re|
|00001f60| 73 65 61 72 63 68 20 4c | 61 62 2c 20 55 6e 69 76 |search L|ab, Univ|
|00001f70| 65 72 73 69 74 79 20 6f | 66 20 53 61 73 6b 61 74 |ersity o|f Saskat|
|00001f80| 63 68 65 77 61 6e 2c 20 | 53 61 73 6b 61 74 6f 6f |chewan, |Saskatoo|
|00001f90| 6e 2c 20 43 61 6e 61 64 | 61 20 53 37 4e 0a 58 20 |n, Canad|a S7N.X |
|00001fa0| 20 20 20 30 57 30 20 50 | 68 6f 6e 65 3a 20 28 33 | 0W0 P|hone: (3|
|00001fb0| 30 36 29 20 39 36 36 2d | 34 39 30 39 20 55 55 43 |06) 966-|4909 UUC|
|00001fc0| 50 3a 20 69 68 6e 70 34 | 21 73 61 73 6b 21 6b 69 |P: ihnp4|!sask!ki|
|00001fd0| 6d 6e 6f 76 61 78 21 70 | 65 61 63 68 65 79 0a 58 |mnovax!p|eachey.X|
|00001fe0| 0a 58 20 20 20 20 53 75 | 69 74 61 62 6c 79 20 61 |.X Su|itably a|
|00001ff0| 64 61 70 74 65 64 20 74 | 6f 20 53 79 73 74 65 6d |dapted t|o System|
|00002000| 20 56 2f 33 38 36 20 72 | 65 6c 2e 20 20 33 2e 32 | V/386 r|el. 3.2|
|00002010| 20 62 79 20 50 69 65 72 | 63 61 72 6c 6f 20 47 72 | by Pier|carlo Gr|
|00002020| 61 6e 64 69 2c 0a 58 20 | 20 20 20 4a 75 6c 79 20 |andi,.X | July |
|00002030| 31 39 39 30 2e 20 20 4e | 61 6d 65 20 63 68 61 6e |1990. N|ame chan|
|00002040| 67 65 64 20 74 6f 20 22 | 64 75 70 22 20 74 6f 20 |ged to "|dup" to |
|00002050| 61 76 6f 69 64 20 63 6f | 6e 66 6c 69 63 74 20 77 |avoid co|nflict w|
|00002060| 69 74 68 20 74 68 65 0a | 58 20 20 20 20 66 6c 6f |ith the.|X flo|
|00002070| 70 70 79 20 64 69 73 63 | 20 64 72 69 76 65 72 2e |ppy disc| driver.|
|00002080| 0a 58 2a 2f 0a 58 0a 58 | 64 75 70 6f 70 65 6e 28 |.X*/.X.X|dupopen(|
|00002090| 64 65 76 2c 6d 6f 64 65 | 29 0a 58 20 20 20 20 64 |dev,mode|).X d|
|000020a0| 65 76 5f 74 20 20 20 20 | 20 20 20 20 20 20 20 20 |ev_t | |
|000020b0| 20 20 20 20 20 20 20 64 | 65 76 3b 0a 58 20 20 20 | d|ev;.X |
|000020c0| 20 69 6e 74 20 20 20 20 | 20 20 20 20 20 20 20 20 | int | |
|000020d0| 20 20 20 20 20 20 20 20 | 20 6d 6f 64 65 3b 0a 58 | | mode;.X|
|000020e0| 7b 0a 58 20 20 20 20 72 | 65 67 69 73 74 65 72 20 |{.X r|egister |
|000020f0| 69 6e 74 20 20 20 20 20 | 20 20 20 20 20 20 20 66 |int | f|
|00002100| 64 2c 6f 6c 64 66 64 3b | 0a 58 20 20 20 20 72 65 |d,oldfd;|.X re|
|00002110| 67 69 73 74 65 72 20 73 | 74 72 75 63 74 20 66 69 |gister s|truct fi|
|00002120| 6c 65 20 20 20 20 2a 66 | 70 2c 2a 6f 6c 64 66 70 |le *f|p,*oldfp|
|00002130| 3b 0a 58 0a 58 20 20 20 | 20 2f 2a 0a 58 20 20 20 |;.X.X | /*.X |
|00002140| 20 20 20 20 20 48 65 72 | 65 20 77 65 20 72 65 6c | Her|e we rel|
|00002150| 79 20 6f 6e 20 74 68 65 | 20 63 75 72 72 65 6e 74 |y on the| current|
|00002160| 20 66 69 6c 65 20 64 65 | 73 63 72 69 70 74 6f 72 | file de|scriptor|
|00002170| 20 62 65 69 6e 67 20 73 | 74 69 6c 6c 20 69 6e 0a | being s|till in.|
|00002180| 58 09 75 2e 75 5f 72 2e | 72 5f 76 61 6c 31 2c 20 |X.u.u_r.|r_val1, |
|00002190| 77 68 65 72 65 20 69 74 | 20 68 61 73 20 62 65 65 |where it| has bee|
|000021a0| 6e 20 70 75 74 20 62 79 | 20 6f 70 65 6e 69 28 29 |n put by| openi()|
|000021b0| 20 74 6f 20 62 65 20 72 | 65 74 75 72 6e 65 64 0a | to be r|eturned.|
|000021c0| 58 09 74 6f 20 74 68 65 | 20 75 73 65 72 20 61 73 |X.to the| user as|
|000021d0| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 66 20 74 | the res|ult of t|
|000021e0| 68 65 20 6f 70 65 6e 28 | 32 29 20 63 61 6c 6c 2e |he open(|2) call.|
|000021f0| 20 48 6f 72 72 69 62 6c | 65 20 6b 6c 75 64 67 65 | Horribl|e kludge|
|00002200| 2e 0a 58 20 20 20 20 2a | 2f 0a 58 0a 58 20 20 20 |..X *|/.X.X |
|00002210| 20 2f 2a 0a 58 09 54 68 | 65 20 63 75 72 72 65 6e | /*.X.Th|e curren|
|00002220| 74 20 66 69 6c 65 20 64 | 65 73 63 72 69 70 74 6f |t file d|escripto|
|00002230| 72 20 6d 75 73 74 20 62 | 65 20 76 61 6c 69 64 2e |r must b|e valid.|
|00002240| 0a 58 20 20 20 20 2a 2f | 0a 58 0a 58 20 20 20 20 |.X */|.X.X |
|00002250| 66 64 20 3d 20 75 2e 75 | 5f 72 2e 72 5f 72 65 67 |fd = u.u|_r.r_reg|
|00002260| 2e 72 5f 76 61 6c 31 3b | 0a 58 20 20 20 20 69 66 |.r_val1;|.X if|
|00002270| 20 28 66 64 20 3c 20 30 | 20 7c 7c 20 66 64 20 3e | (fd < 0| || fd >|
|00002280| 3d 20 4e 4f 46 49 4c 45 | 29 09 2f 2a 20 73 6f 6d |= NOFILE|)./* som|
|00002290| 65 74 68 69 6e 67 20 74 | 65 72 72 69 62 6c 65 20 |ething t|errible |
|000022a0| 68 61 73 20 68 61 70 70 | 65 6e 65 64 20 2a 2f 0a |has happ|ened */.|
|000022b0| 58 09 72 65 74 75 72 6e | 20 45 49 4e 56 41 4c 3b |X.return| EINVAL;|
|000022c0| 0a 58 0a 58 20 20 20 20 | 2f 2a 0a 58 09 54 68 65 |.X.X |/*.X.The|
|000022d0| 20 6f 6c 64 20 66 69 6c | 65 20 64 65 73 63 72 69 | old fil|e descri|
|000022e0| 70 74 6f 72 20 6d 75 73 | 74 20 62 65 20 76 61 6c |ptor mus|t be val|
|000022f0| 69 64 20 61 6e 64 20 64 | 69 66 66 65 72 65 6e 74 |id and d|ifferent|
|00002300| 20 66 72 6f 6d 20 74 68 | 65 0a 58 09 63 75 72 72 | from th|e.X.curr|
|00002310| 65 6e 74 20 6f 6e 65 2e | 0a 58 20 20 20 20 2a 2f |ent one.|.X */|
|00002320| 0a 58 0a 58 20 20 20 20 | 6f 6c 64 66 64 20 3d 20 |.X.X |oldfd = |
|00002330| 6d 69 6e 6f 72 28 64 65 | 76 29 3b 0a 58 20 20 20 |minor(de|v);.X |
|00002340| 20 69 66 20 28 6f 6c 64 | 66 64 20 3c 20 30 20 7c | if (old|fd < 0 ||
|00002350| 7c 20 6f 6c 64 66 64 20 | 3e 3d 20 4e 4f 46 49 4c || oldfd |>= NOFIL|
|00002360| 45 20 7c 7c 20 66 64 20 | 3d 3d 20 6f 6c 64 66 64 |E || fd |== oldfd|
|00002370| 29 0a 58 09 72 65 74 75 | 72 6e 20 45 42 41 44 46 |).X.retu|rn EBADF|
|00002380| 3b 0a 58 0a 58 20 20 20 | 20 2f 2a 0a 58 09 54 68 |;.X.X | /*.X.Th|
|00002390| 65 20 6f 6c 64 20 66 69 | 6c 65 20 64 65 73 63 72 |e old fi|le descr|
|000023a0| 69 70 74 6f 72 20 6d 75 | 73 74 20 70 6f 69 6e 74 |iptor mu|st point|
|000023b0| 20 74 6f 20 73 6f 6d 65 | 20 66 69 6c 65 20 73 74 | to some| file st|
|000023c0| 72 75 63 74 2c 20 61 6e | 64 20 74 68 65 0a 58 09 |ruct, an|d the.X.|
|000023d0| 6f 6c 64 20 6f 70 65 6e | 20 6d 6f 64 65 20 6d 75 |old open| mode mu|
|000023e0| 73 74 20 62 65 20 61 20 | 73 75 70 65 72 73 65 74 |st be a |superset|
|000023f0| 20 6f 66 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | of the |current |
|00002400| 6f 6e 65 2e 0a 58 20 20 | 20 20 2a 2f 0a 58 0a 58 |one..X | */.X.X|
|00002410| 20 20 20 20 6f 6c 64 66 | 70 20 3d 20 75 2e 75 5f | oldf|p = u.u_|
|00002420| 6f 66 69 6c 65 5b 6f 6c | 64 66 64 5d 3b 0a 58 20 |ofile[ol|dfd];.X |
|00002430| 20 20 20 69 66 20 28 6f | 6c 64 66 70 20 3d 3d 20 | if (o|ldfp == |
|00002440| 4e 55 4c 4c 29 0a 58 09 | 72 65 74 75 72 6e 20 45 |NULL).X.|return E|
|00002450| 42 41 44 46 3b 0a 58 0a | 58 20 20 20 20 69 66 20 |BADF;.X.|X if |
|00002460| 28 28 6d 6f 64 65 20 26 | 20 28 6f 6c 64 66 70 2d |((mode &| (oldfp-|
|00002470| 3e 66 5f 66 6c 61 67 20 | 26 20 28 46 52 45 41 44 |>f_flag |& (FREAD|
|00002480| 7c 46 57 52 49 54 45 29 | 29 29 20 21 3d 20 28 6d ||FWRITE)|)) != (m|
|00002490| 6f 64 65 20 26 20 28 46 | 52 45 41 44 7c 46 57 52 |ode & (F|READ|FWR|
|000024a0| 49 54 45 29 29 29 0a 58 | 09 72 65 74 75 72 6e 20 |ITE))).X|.return |
|000024b0| 45 41 43 43 45 53 3b 0a | 58 0a 58 20 20 20 20 2f |EACCES;.|X.X /|
|000024c0| 2a 0a 58 09 54 68 65 20 | 63 75 72 72 65 6e 74 20 |*.X.The |current |
|000024d0| 66 69 6c 65 20 70 6f 69 | 6e 74 65 72 20 63 61 6e |file poi|nter can|
|000024e0| 20 6e 6f 77 20 62 65 20 | 74 68 72 6f 77 6e 20 61 | now be |thrown a|
|000024f0| 77 61 79 2e 0a 58 20 20 | 20 20 2a 2f 0a 58 0a 58 |way..X | */.X.X|
|00002500| 20 20 20 20 66 70 20 3d | 20 75 2e 75 5f 6f 66 69 | fp =| u.u_ofi|
|00002510| 6c 65 5b 66 64 5d 3b 0a | 58 20 20 20 20 69 66 20 |le[fd];.|X if |
|00002520| 28 66 70 20 21 3d 20 4e | 55 4c 4c 29 20 2f 2a 20 |(fp != N|ULL) /* |
|00002530| 6f 74 68 65 72 77 69 73 | 65 20 73 6f 6d 65 74 68 |otherwis|e someth|
|00002540| 69 6e 67 20 74 65 72 72 | 69 62 6c 65 20 68 61 73 |ing terr|ible has|
|00002550| 20 68 61 70 70 65 6e 65 | 64 20 2a 2f 0a 58 20 20 | happene|d */.X |
|00002560| 20 20 7b 0a 58 09 75 2e | 75 5f 6f 66 69 6c 65 5b | {.X.u.|u_ofile[|
|00002570| 66 64 5d 20 3d 20 4e 55 | 4c 4c 3b 0a 58 09 69 66 |fd] = NU|LL;.X.if|
|00002580| 20 28 66 70 2d 3e 66 5f | 69 6e 6f 64 65 29 20 69 | (fp->f_|inode) i|
|00002590| 70 75 74 28 66 70 2d 3e | 66 5f 69 6e 6f 64 65 29 |put(fp->|f_inode)|
|000025a0| 3b 0a 58 09 66 70 2d 3e | 66 5f 63 6f 75 6e 74 20 |;.X.fp->|f_count |
|000025b0| 3d 20 30 3b 0a 58 20 20 | 20 20 7d 0a 58 0a 58 20 |= 0;.X | }.X.X |
|000025c0| 20 20 20 2f 2a 0a 58 09 | 54 68 65 20 6f 6c 64 20 | /*.X.|The old |
|000025d0| 66 69 6c 65 20 70 6f 69 | 6e 74 65 72 20 62 65 63 |file poi|nter bec|
|000025e0| 6f 6d 65 73 20 74 68 65 | 20 63 75 72 72 65 6e 74 |omes the| current|
|000025f0| 20 6f 6e 65 20 61 73 20 | 77 65 6c 6c 2e 0a 58 20 | one as |well..X |
|00002600| 20 20 20 2a 2f 0a 58 0a | 58 20 20 20 20 75 2e 75 | */.X.|X u.u|
|00002610| 5f 70 6f 66 69 6c 65 5b | 66 64 5d 20 3d 20 75 2e |_pofile[|fd] = u.|
|00002620| 75 5f 70 6f 66 69 6c 65 | 5b 6f 6c 64 66 64 5d 3b |u_pofile|[oldfd];|
|00002630| 0a 58 20 20 20 20 28 75 | 2e 75 5f 6f 66 69 6c 65 |.X (u|.u_ofile|
|00002640| 5b 66 64 5d 20 3d 20 6f | 6c 64 66 70 29 2d 3e 66 |[fd] = o|ldfp)->f|
|00002650| 5f 63 6f 75 6e 74 2b 2b | 3b 0a 58 0a 58 20 20 20 |_count++|;.X.X |
|00002660| 20 72 65 74 75 72 6e 20 | 30 3b 0a 58 7d 0a 45 4e | return |0;.X}.EN|
|00002670| 44 5f 4f 46 5f 46 49 4c | 45 0a 69 66 20 74 65 73 |D_OF_FIL|E.if tes|
|00002680| 74 20 33 31 31 38 20 2d | 6e 65 20 60 77 63 20 2d |t 3118 -|ne `wc -|
|00002690| 63 20 3c 27 64 75 70 2e | 63 27 60 3b 20 74 68 65 |c <'dup.|c'`; the|
|000026a0| 6e 0a 20 20 20 20 65 63 | 68 6f 20 73 68 61 72 3a |n. ec|ho shar:|
|000026b0| 20 5c 22 27 64 75 70 2e | 63 27 5c 22 20 75 6e 70 | \"'dup.|c'\" unp|
|000026c0| 61 63 6b 65 64 20 77 69 | 74 68 20 77 72 6f 6e 67 |acked wi|th wrong|
|000026d0| 20 73 69 7a 65 21 0a 66 | 69 0a 23 20 65 6e 64 20 | size!.f|i.# end |
|000026e0| 6f 66 20 27 64 75 70 2e | 63 27 0a 66 69 0a 65 63 |of 'dup.|c'.fi.ec|
|000026f0| 68 6f 20 73 68 61 72 3a | 20 45 6e 64 20 6f 66 20 |ho shar:| End of |
|00002700| 61 72 63 68 69 76 65 20 | 31 20 5c 28 6f 66 20 31 |archive |1 \(of 1|
|00002710| 5c 29 2e 0a 63 70 20 2f | 64 65 76 2f 6e 75 6c 6c |\)..cp /|dev/null|
|00002720| 20 61 72 6b 31 69 73 64 | 6f 6e 65 0a 4d 49 53 53 | ark1isd|one.MISS|
|00002730| 49 4e 47 3d 22 22 0a 66 | 6f 72 20 49 20 69 6e 20 |ING="".f|or I in |
|00002740| 31 20 3b 20 64 6f 0a 20 | 20 20 20 69 66 20 74 65 |1 ; do. | if te|
|00002750| 73 74 20 21 20 2d 66 20 | 61 72 6b 24 7b 49 7d 69 |st ! -f |ark${I}i|
|00002760| 73 64 6f 6e 65 20 3b 20 | 74 68 65 6e 0a 09 4d 49 |sdone ; |then..MI|
|00002770| 53 53 49 4e 47 3d 22 24 | 7b 4d 49 53 53 49 4e 47 |SSING="$|{MISSING|
|00002780| 7d 20 24 7b 49 7d 22 0a | 20 20 20 20 66 69 0a 64 |} ${I}".| fi.d|
|00002790| 6f 6e 65 0a 69 66 20 74 | 65 73 74 20 22 24 7b 4d |one.if t|est "${M|
|000027a0| 49 53 53 49 4e 47 7d 22 | 20 3d 20 22 22 20 3b 20 |ISSING}"| = "" ; |
|000027b0| 74 68 65 6e 0a 20 20 20 | 20 65 63 68 6f 20 59 6f |then. | echo Yo|
|000027c0| 75 20 68 61 76 65 20 74 | 68 65 20 61 72 63 68 69 |u have t|he archi|
|000027d0| 76 65 2e 0a 20 20 20 20 | 72 6d 20 2d 66 20 61 72 |ve.. |rm -f ar|
|000027e0| 6b 5b 31 2d 39 5d 69 73 | 64 6f 6e 65 0a 65 6c 73 |k[1-9]is|done.els|
|000027f0| 65 0a 20 20 20 20 65 63 | 68 6f 20 59 6f 75 20 73 |e. ec|ho You s|
|00002800| 74 69 6c 6c 20 6e 65 65 | 64 20 74 6f 20 75 6e 70 |till nee|d to unp|
|00002810| 61 63 6b 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |ack the |followin|
|00002820| 67 20 61 72 63 68 69 76 | 65 73 3a 0a 20 20 20 20 |g archiv|es:. |
|00002830| 65 63 68 6f 20 22 20 20 | 20 20 20 20 20 20 22 20 |echo " | " |
|00002840| 24 7b 4d 49 53 53 49 4e | 47 7d 0a 66 69 0a 23 23 |${MISSIN|G}.fi.##|
|00002850| 20 20 45 6e 64 20 6f 66 | 20 73 68 65 6c 6c 20 61 | End of| shell a|
|00002860| 72 63 68 69 76 65 2e 0a | 65 78 69 74 20 30 0a 2d |rchive..|exit 0.-|
|00002870| 2d 0a 50 69 65 72 63 61 | 72 6c 6f 20 22 50 65 74 |-.Pierca|rlo "Pet|
|00002880| 65 72 22 20 47 72 61 6e | 64 69 20 20 20 20 20 20 |er" Gran|di |
|00002890| 20 20 20 20 20 7c 20 41 | 52 50 41 3a 20 70 63 67 | | A|RPA: pcg|
|000028a0| 25 63 73 2e 61 62 65 72 | 2e 61 63 2e 75 6b 40 6e |%cs.aber|.ac.uk@n|
|000028b0| 73 66 6e 65 74 2d 72 65 | 6c 61 79 2e 61 63 2e 75 |sfnet-re|lay.ac.u|
|000028c0| 6b 0a 44 65 70 74 20 6f | 66 20 43 53 2c 20 55 43 |k.Dept o|f CS, UC|
|000028d0| 57 20 41 62 65 72 79 73 | 74 77 79 74 68 20 20 20 |W Aberys|twyth |
|000028e0| 20 20 20 20 20 7c 20 55 | 55 43 50 3a 20 2e 2e 2e | | U|UCP: ...|
|000028f0| 21 6d 63 73 75 6e 21 75 | 6b 63 21 61 62 65 72 2d |!mcsun!u|kc!aber-|
|00002900| 63 73 21 70 63 67 0a 50 | 65 6e 67 6c 61 69 73 2c |cs!pcg.P|englais,|
|00002910| 20 41 62 65 72 79 73 74 | 77 79 74 68 20 53 59 32 | Aberyst|wyth SY2|
|00002920| 33 20 33 42 5a 2c 20 55 | 4b 20 7c 20 49 4e 45 54 |3 3BZ, U|K | INET|
|00002930| 3a 20 70 63 67 40 63 73 | 2e 61 62 65 72 2e 61 63 |: pcg@cs|.aber.ac|
|00002940| 2e 75 6b 0a | |.uk. | |
+--------+-------------------------+-------------------------+--------+--------+