home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume26 / dup / part01 next >
SHell self-extracting ARchive  |  1993-01-29  |  9.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


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

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text 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)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 75 6e 69 78 0a 46 72 |.sources|.unix.Fr|
|00000020| 6f 6d 3a 20 78 65 6e 69 | 74 65 63 21 67 6f 6c 65 |om: xeni|tec!gole|
|00000030| 6d 21 64 61 76 69 64 66 | 40 75 75 6e 65 74 2e 63 |m!davidf|@uunet.c|
|00000040| 61 20 28 44 61 76 69 64 | 20 4a 2e 20 46 69 61 6e |a (David| J. Fian|
|00000050| 64 65 72 29 0a 53 75 62 | 6a 65 63 74 3a 20 76 32 |der).Sub|ject: v2|
|00000060| 36 69 30 38 37 3a 20 64 | 75 70 20 2d 20 61 20 2f |6i087: d|up - a /|
|00000070| 64 65 76 2f 66 64 20 64 | 72 69 76 65 72 20 66 6f |dev/fd d|river fo|
|00000080| 72 20 58 65 6e 69 78 2f | 33 38 36 20 32 2e 33 2b |r Xenix/|386 2.3+|
|00000090| 2c 20 50 61 72 74 30 31 | 2f 30 31 0a 53 65 6e 64 |, Part01|/01.Send|
|000000a0| 65 72 3a 20 75 6e 69 78 | 2d 73 6f 75 72 63 65 73 |er: unix|-sources|
|000000b0| 2d 6d 6f 64 65 72 61 74 | 6f 72 40 70 61 2e 64 65 |-moderat|or@pa.de|
|000000c0| 63 2e 63 6f 6d 0a 41 70 | 70 72 6f 76 65 64 3a 20 |c.com.Ap|proved: |
|000000d0| 76 69 78 69 65 40 70 61 | 2e 64 65 63 2e 63 6f 6d |vixie@pa|.dec.com|
|000000e0| 0a 0a 53 75 62 6d 69 74 | 74 65 64 2d 42 79 3a 20 |..Submit|ted-By: |
|000000f0| 78 65 6e 69 74 65 63 21 | 67 6f 6c 65 6d 21 64 61 |xenitec!|golem!da|
|00000100| 76 69 64 66 40 75 75 6e | 65 74 2e 63 61 20 28 44 |vidf@uun|et.ca (D|
|00000110| 61 76 69 64 20 4a 2e 20 | 46 69 61 6e 64 65 72 29 |avid J. |Fiander)|
|00000120| 0a 50 6f 73 74 69 6e 67 | 2d 4e 75 6d 62 65 72 3a |.Posting|-Number:|
|00000130| 20 56 6f 6c 75 6d 65 20 | 32 36 2c 20 49 73 73 75 | Volume |26, Issu|
|00000140| 65 20 38 37 0a 41 72 63 | 68 69 76 65 2d 4e 61 6d |e 87.Arc|hive-Nam|
|00000150| 65 3a 20 64 75 70 2f 70 | 61 72 74 30 31 0a 0a 5b |e: dup/p|art01..[|
|00000160| 20 54 68 69 73 20 73 6f | 75 72 63 65 20 69 73 20 | This so|urce is |
|00000170| 70 61 72 74 69 63 75 6c | 61 72 20 74 6f 20 53 43 |particul|ar to SC|
|00000180| 4f 20 58 65 6e 69 78 2f | 33 38 36 20 32 2e 33 2b |O Xenix/|386 2.3+|
|00000190| 2e 20 20 49 66 20 79 6f | 75 20 64 6f 6e 27 74 20 |. If yo|u don't |
|000001a0| 68 61 76 65 20 74 68 61 | 74 2c 0a 20 20 79 6f 75 |have tha|t,. you|
|000001b0| 20 70 72 6f 62 61 62 6c | 79 20 64 6f 6e 27 74 20 | probabl|y don't |
|000001c0| 77 61 6e 74 20 74 68 69 | 73 2e 20 20 49 20 64 6f |want thi|s. I do|
|000001d0| 6e 27 74 20 68 61 76 65 | 20 69 74 2c 20 73 6f 20 |n't have| it, so |
|000001e0| 49 20 64 69 64 6e 27 74 | 20 74 65 73 74 20 74 68 |I didn't| test th|
|000001f0| 69 73 2e 0a 20 20 2d 2d | 76 69 78 20 5d 0a 0a 54 |is.. --|vix ]..T|
|00000200| 68 65 20 2f 64 65 76 2f | 66 64 20 64 72 69 76 65 |he /dev/|fd drive|
|00000210| 72 20 65 66 66 65 63 74 | 69 76 65 6c 79 20 61 6c |r effect|ively al|
|00000220| 6c 6f 77 73 20 79 6f 75 | 20 74 6f 20 73 70 65 63 |lows you| to spec|
|00000230| 69 66 79 20 61 6e 20 61 | 6c 72 65 61 64 79 2d 6f |ify an a|lready-o|
|00000240| 70 65 6e 20 66 69 6c 65 | 0a 64 65 73 63 72 69 70 |pen file|.descrip|
|00000250| 74 6f 72 20 6e 75 6d 62 | 65 72 20 77 68 65 72 65 |tor numb|er where|
|00000260| 20 61 20 70 61 74 68 20 | 6e 61 6d 65 20 69 73 20 | a path |name is |
|00000270| 6e 6f 72 6d 61 6c 6c 79 | 20 72 65 71 75 69 72 65 |normally| require|
|00000280| 64 2e 20 54 68 69 73 20 | 61 6c 6c 6f 77 73 20 61 |d. This |allows a|
|00000290| 0a 70 72 6f 67 72 61 6d | 20 74 68 61 74 20 64 65 |.program| that de|
|000002a0| 6d 61 6e 64 73 20 61 20 | 70 61 74 68 20 6e 61 6d |mands a |path nam|
|000002b0| 65 20 74 6f 20 62 65 20 | 75 73 65 64 20 74 6f 20 |e to be |used to |
|000002c0| 70 72 6f 63 65 73 73 20 | 73 74 61 6e 64 61 72 64 |process |standard|
|000002d0| 20 69 6e 70 75 74 20 6f | 72 0a 73 74 61 6e 64 61 | input o|r.standa|
|000002e0| 72 64 20 6f 75 74 70 75 | 74 20 62 79 20 73 70 65 |rd outpu|t by spe|
|000002f0| 63 69 66 79 69 6e 67 20 | 2f 64 65 76 2f 66 64 2f |cifying |/dev/fd/|
|00000300| 30 20 6f 72 20 2f 64 65 | 76 2f 66 64 2f 31 2c 20 |0 or /de|v/fd/1, |
|00000310| 72 65 73 70 65 63 74 69 | 76 65 6c 79 2e 0a 0a 09 |respecti|vely....|
|00000320| 78 65 6e 69 74 65 63 21 | 67 6f 6c 65 6d 21 64 61 |xenitec!|golem!da|
|00000330| 76 69 64 66 40 75 75 6e | 65 74 2e 63 61 20 28 44 |vidf@uun|et.ca (D|
|00000340| 61 76 69 64 20 4a 2e 20 | 46 69 61 6e 64 65 72 29 |avid J. |Fiander)|
|00000350| 0a 0a 23 21 20 2f 62 69 | 6e 2f 73 68 0a 23 20 54 |..#! /bi|n/sh.# T|
|00000360| 68 69 73 20 69 73 20 61 | 20 73 68 65 6c 6c 20 61 |his is a| shell a|
|00000370| 72 63 68 69 76 65 2e 20 | 20 52 65 6d 6f 76 65 20 |rchive. | Remove |
|00000380| 61 6e 79 74 68 69 6e 67 | 20 62 65 66 6f 72 65 20 |anything| before |
|00000390| 74 68 69 73 20 6c 69 6e | 65 2c 20 74 68 65 6e 20 |this lin|e, then |
|000003a0| 75 6e 70 61 63 6b 0a 23 | 20 69 74 20 62 79 20 73 |unpack.#| it by s|
|000003b0| 61 76 69 6e 67 20 69 74 | 20 69 6e 74 6f 20 61 20 |aving it| into a |
|000003c0| 66 69 6c 65 20 61 6e 64 | 20 74 79 70 69 6e 67 20 |file and| typing |
|000003d0| 22 73 68 20 66 69 6c 65 | 22 2e 20 20 54 6f 20 6f |"sh file|". To o|
|000003e0| 76 65 72 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |verwrite| existin|
|000003f0| 67 0a 23 20 66 69 6c 65 | 73 2c 20 74 79 70 65 20 |g.# file|s, type |
|00000400| 22 73 68 20 66 69 6c 65 | 20 2d 63 22 2e 20 20 59 |"sh file| -c". Y|
|00000410| 6f 75 20 63 61 6e 20 61 | 6c 73 6f 20 66 65 65 64 |ou can a|lso feed|
|00000420| 20 74 68 69 73 20 61 73 | 20 73 74 61 6e 64 61 72 | this as| standar|
|00000430| 64 20 69 6e 70 75 74 20 | 76 69 61 0a 23 20 75 6e |d input |via.# un|
|00000440| 73 68 61 72 2c 20 6f 72 | 20 62 79 20 74 79 70 69 |shar, or| by typi|
|00000450| 6e 67 20 22 73 68 20 3c | 66 69 6c 65 22 2c 20 65 |ng "sh <|file", e|
|00000460| 2e 67 2e 2e 20 20 49 66 | 20 74 68 69 73 20 61 72 |.g.. If| this ar|
|00000470| 63 68 69 76 65 20 69 73 | 20 63 6f 6d 70 6c 65 74 |chive is| complet|
|00000480| 65 2c 20 79 6f 75 0a 23 | 20 77 69 6c 6c 20 73 65 |e, you.#| will se|
|00000490| 65 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |e the fo|llowing |
|000004a0| 6d 65 73 73 61 67 65 20 | 61 74 20 74 68 65 20 65 |message |at the e|
|000004b0| 6e 64 3a 0a 23 09 09 22 | 45 6e 64 20 6f 66 20 61 |nd:.#.."|End of a|
|000004c0| 72 63 68 69 76 65 20 31 | 20 28 6f 66 20 31 29 2e |rchive 1| (of 1).|
|000004d0| 22 0a 23 20 43 6f 6e 74 | 65 6e 74 73 3a 20 20 49 |".# Cont|ents: I|
|000004e0| 6e 73 74 61 6c 6c 20 4d | 41 4e 49 46 45 53 54 20 |nstall M|ANIFEST |
|000004f0| 4d 61 6b 65 66 69 6c 65 | 20 52 45 41 44 4d 45 20 |Makefile| README |
|00000500| 64 75 70 2e 63 0a 23 20 | 57 72 61 70 70 65 64 20 |dup.c.# |Wrapped |
|00000510| 62 79 20 76 69 78 69 65 | 40 63 6f 67 6e 69 74 69 |by vixie|@cogniti|
|00000520| 6f 6e 2e 70 61 2e 64 65 | 63 2e 63 6f 6d 20 6f 6e |on.pa.de|c.com on|
|00000530| 20 53 61 74 20 4a 61 6e | 20 33 30 20 31 37 3a 30 | Sat Jan| 30 17:0|
|00000540| 33 3a 30 36 20 31 39 39 | 33 0a 50 41 54 48 3d 2f |3:06 199|3.PATH=/|
|00000550| 62 69 6e 3a 2f 75 73 72 | 2f 62 69 6e 3a 2f 75 73 |bin:/usr|/bin:/us|
|00000560| 72 2f 75 63 62 20 3b 20 | 65 78 70 6f 72 74 20 50 |r/ucb ; |export P|
|00000570| 41 54 48 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |ATH.if t|est -f '|
|00000580| 49 6e 73 74 61 6c 6c 27 | 20 2d 61 20 22 24 7b 31 |Install'| -a "${1|
|00000590| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|000005a0| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|000005b0| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|000005c0| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|000005d0| 22 27 49 6e 73 74 61 6c | 6c 27 5c 22 0a 65 6c 73 |"'Instal|l'\".els|
|000005e0| 65 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 78 74 |e.echo s|har: Ext|
|000005f0| 72 61 63 74 69 6e 67 20 | 5c 22 27 49 6e 73 74 61 |racting |\"'Insta|
|00000600| 6c 6c 27 5c 22 20 5c 28 | 39 33 31 20 63 68 61 72 |ll'\" \(|931 char|
|00000610| 61 63 74 65 72 73 5c 29 | 0a 73 65 64 20 22 73 2f |acters\)|.sed "s/|
|00000620| 5e 58 2f 2f 22 20 3e 27 | 49 6e 73 74 61 6c 6c 27 |^X//" >'|Install'|
|00000630| 20 3c 3c 27 45 4e 44 5f | 4f 46 5f 46 49 4c 45 27 | <<'END_|OF_FILE'|
|00000640| 0a 4d 4f 44 55 4c 45 3d | 64 75 70 0a 6d 61 6b 65 |.MODULE=|dup.make|
|00000650| 20 24 7b 4d 4f 44 55 4c | 45 7d 2e 6f 20 7c 7c 20 | ${MODUL|E}.o || |
|00000660| 65 78 69 74 09 23 20 44 | 6f 6e 27 74 20 62 6f 74 |exit.# D|on't bot|
|00000670| 68 65 72 20 77 69 74 68 | 20 61 6e 79 74 68 69 6e |her with| anythin|
|00000680| 67 20 69 66 20 77 65 20 | 63 61 6e 27 74 20 6d 61 |g if we |can't ma|
|00000690| 6b 65 2e 0a 58 0a 4e 4f | 46 49 4c 45 3d 32 30 09 |ke..X.NO|FILE=20.|
|000006a0| 23 20 44 6f 20 77 65 20 | 72 65 61 6c 6c 79 20 6e |# Do we |really n|
|000006b0| 65 65 64 20 6d 6f 72 65 | 3f 0a 58 0a 73 65 74 20 |eed more|?.X.set |
|000006c0| 2d 65 0a 58 0a 63 64 20 | 2f 75 73 72 2f 73 79 73 |-e.X.cd |/usr/sys|
|000006d0| 2f 63 6f 6e 66 0a 58 0a | 58 5b 20 2d 64 20 2f 64 |/conf.X.|X[ -d /d|
|000006e0| 65 76 2f 66 64 20 5d 20 | 26 26 20 5b 20 2d 63 20 |ev/fd ] |&& [ -c |
|000006f0| 2f 64 65 76 2f 73 74 64 | 69 6e 20 5d 20 7c 7c 0a |/dev/std|in ] ||.|
|00000700| 58 7b 0a 58 09 65 63 68 | 6f 20 27 4d 61 6b 69 6e |X{.X.ech|o 'Makin|
|00000710| 67 20 66 69 6c 65 73 20 | 69 6e 20 2f 64 65 76 27 |g files |in /dev'|
|00000720| 0a 58 09 6d 61 6a 6f 72 | 3d 60 2e 2f 63 6f 6e 66 |.X.major|=`./conf|
|00000730| 69 67 75 72 65 20 2d 6a | 20 4e 45 58 54 4d 41 4a |igure -j| NEXTMAJ|
|00000740| 4f 52 60 0a 58 0a 58 09 | 65 63 68 6f 20 27 54 68 |OR`.X.X.|echo 'Th|
|00000750| 65 20 6d 61 6a 6f 72 20 | 64 65 76 69 63 65 20 6e |e major |device n|
|00000760| 75 6d 62 65 72 20 66 6f | 72 20 74 68 65 20 2f 64 |umber fo|r the /d|
|00000770| 65 76 2f 66 64 20 64 72 | 69 76 65 72 20 69 73 27 |ev/fd dr|iver is'|
|00000780| 20 24 6d 61 6a 6f 72 0a | 58 0a 58 09 65 63 68 6f | $major.|X.X.echo|
|00000790| 20 27 41 64 64 69 6e 67 | 20 22 2e 2e 2f 69 6f 2f | 'Adding| "../io/|
|000007a0| 64 75 70 2f 64 75 70 2e | 6f 22 20 74 6f 20 6c 69 |dup/dup.|o" to li|
|000007b0| 6e 6b 5f 78 65 6e 69 78 | 27 0a 58 09 65 64 20 2d |nk_xenix|'.X.ed -|
|000007c0| 20 2e 2f 6c 69 6e 6b 5f | 78 65 6e 69 78 20 3c 3c | ./link_|xenix <<|
|000007d0| 5c 53 43 52 49 50 54 0a | 58 2f 75 74 73 2e 6f 2f |\SCRIPT.|X/uts.o/|
|000007e0| 61 0a 58 09 2e 2e 2f 69 | 6f 2f 64 75 70 2f 64 75 |a.X.../i|o/dup/du|
|000007f0| 70 2e 6f 20 5c 0a 58 2e | 0a 77 0a 71 0a 53 43 52 |p.o \.X.|.w.q.SCR|
|00000800| 49 50 54 0a 58 0a 58 09 | 65 63 68 6f 20 27 55 70 |IPT.X.X.|echo 'Up|
|00000810| 64 61 74 69 6e 67 20 6d | 61 73 74 65 72 20 61 6e |dating m|aster an|
|00000820| 64 20 78 65 6e 69 78 63 | 6f 6e 66 20 66 69 6c 65 |d xenixc|onf file|
|00000830| 73 27 0a 58 09 2e 2f 63 | 6f 6e 66 69 67 75 72 65 |s'.X../c|onfigure|
|00000840| 20 2d 63 20 2d 6d 20 24 | 6d 61 6a 6f 72 20 2d 61 | -c -m $|major -a|
|00000850| 20 64 75 70 6f 70 65 6e | 0a 58 0a 58 09 72 6d 20 | dupopen|.X.X.rm |
|00000860| 2d 72 66 20 2f 64 65 76 | 2f 66 64 20 2f 64 65 76 |-rf /dev|/fd /dev|
|00000870| 2f 73 74 64 69 6e 20 2f | 64 65 76 2f 73 74 64 6f |/stdin /|dev/stdo|
|00000880| 75 74 20 2f 64 65 76 2f | 73 74 64 65 72 72 0a 58 |ut /dev/|stderr.X|
|00000890| 09 6d 6b 64 69 72 20 2f | 64 65 76 2f 66 64 0a 58 |.mkdir /|dev/fd.X|
|000008a0| 09 63 68 6d 6f 64 20 37 | 35 35 20 2f 64 65 76 2f |.chmod 7|55 /dev/|
|000008b0| 66 64 0a 58 09 6d 69 6e | 6f 72 3d 30 0a 58 09 77 |fd.X.min|or=0.X.w|
|000008c0| 68 69 6c 65 20 5b 20 24 | 6d 69 6e 6f 72 20 2d 6c |hile [ $|minor -l|
|000008d0| 74 20 24 4e 4f 46 49 4c | 45 20 5d 0a 58 09 64 6f |t $NOFIL|E ].X.do|
|000008e0| 0a 58 09 09 6d 6b 6e 6f | 64 20 2f 64 65 76 2f 66 |.X..mkno|d /dev/f|
|000008f0| 64 2f 24 6d 69 6e 6f 72 | 20 63 20 24 6d 61 6a 6f |d/$minor| c $majo|
|00000900| 72 20 24 6d 69 6e 6f 72 | 0a 58 09 09 63 68 6d 6f |r $minor|.X..chmo|
|00000910| 64 20 36 36 36 20 2f 64 | 65 76 2f 66 64 2f 24 6d |d 666 /d|ev/fd/$m|
|00000920| 69 6e 6f 72 0a 58 09 09 | 6d 69 6e 6f 72 3d 60 65 |inor.X..|minor=`e|
|00000930| 78 70 72 20 24 6d 69 6e | 6f 72 20 2b 20 31 60 0a |xpr $min|or + 1`.|
|00000940| 58 09 64 6f 6e 65 0a 58 | 09 6c 6e 20 2d 66 20 2f |X.done.X|.ln -f /|
|00000950| 64 65 76 2f 66 64 2f 30 | 20 2f 64 65 76 2f 73 74 |dev/fd/0| /dev/st|
|00000960| 64 69 6e 0a 58 09 6c 6e | 20 2d 66 20 2f 64 65 76 |din.X.ln| -f /dev|
|00000970| 2f 66 64 2f 31 20 2f 64 | 65 76 2f 73 74 64 6f 75 |/fd/1 /d|ev/stdou|
|00000980| 74 0a 58 09 6c 6e 20 2d | 66 20 2f 64 65 76 2f 66 |t.X.ln -|f /dev/f|
|00000990| 64 2f 32 20 2f 64 65 76 | 2f 73 74 64 65 72 72 0a |d/2 /dev|/stderr.|
|000009a0| 58 7d 0a 58 0a 65 63 68 | 6f 20 27 42 75 69 6c 64 |X}.X.ech|o 'Build|
|000009b0| 69 6e 67 20 6e 65 77 20 | 78 65 6e 69 78 27 0a 58 |ing new |xenix'.X|
|000009c0| 2e 2f 6c 69 6e 6b 5f 78 | 65 6e 69 78 0a 58 0a 65 |./link_x|enix.X.e|
|000009d0| 63 68 6f 20 27 59 6f 75 | 20 6d 75 73 74 20 6e 6f |cho 'You| must no|
|000009e0| 77 20 69 6e 73 74 61 6c | 6c 20 74 68 65 20 6e 65 |w instal|l the ne|
|000009f0| 77 20 78 65 6e 69 78 20 | 69 6e 20 2f 20 61 6e 64 |w xenix |in / and|
|00000a00| 20 72 65 62 6f 6f 74 27 | 0a 45 4e 44 5f 4f 46 5f | reboot'|.END_OF_|
|00000a10| 46 49 4c 45 0a 69 66 20 | 74 65 73 74 20 39 33 31 |FILE.if |test 931|
|00000a20| 20 2d 6e 65 20 60 77 63 | 20 2d 63 20 3c 27 49 6e | -ne `wc| -c <'In|
|00000a30| 73 74 61 6c 6c 27 60 3b | 20 74 68 65 6e 0a 20 20 |stall'`;| then. |
|00000a40| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 5c 22 27 | echo s|har: \"'|
|00000a50| 49 6e 73 74 61 6c 6c 27 | 5c 22 20 75 6e 70 61 63 |Install'|\" unpac|
|00000a60| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|00000a70| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|00000a80| 20 27 49 6e 73 74 61 6c | 6c 27 0a 66 69 0a 69 66 | 'Instal|l'.fi.if|
|00000a90| 20 74 65 73 74 20 2d 66 | 20 27 4d 41 4e 49 46 45 | test -f| 'MANIFE|
|00000aa0| 53 54 27 20 2d 61 20 22 | 24 7b 31 7d 22 20 21 3d |ST' -a "|${1}" !=|
|00000ab0| 20 22 2d 63 22 20 3b 20 | 74 68 65 6e 20 0a 20 20 | "-c" ; |then . |
|00000ac0| 65 63 68 6f 20 73 68 61 | 72 3a 20 57 69 6c 6c 20 |echo sha|r: Will |
|00000ad0| 6e 6f 74 20 63 6c 6f 62 | 62 65 72 20 65 78 69 73 |not clob|ber exis|
|00000ae0| 74 69 6e 67 20 66 69 6c | 65 20 5c 22 27 4d 41 4e |ting fil|e \"'MAN|
|00000af0| 49 46 45 53 54 27 5c 22 | 0a 65 6c 73 65 0a 65 63 |IFEST'\"|.else.ec|
|00000b00| 68 6f 20 73 68 61 72 3a | 20 45 78 74 72 61 63 74 |ho shar:| Extract|
|00000b10| 69 6e 67 20 5c 22 27 4d | 41 4e 49 46 45 53 54 27 |ing \"'M|ANIFEST'|
|00000b20| 5c 22 20 5c 28 32 35 31 | 20 63 68 61 72 61 63 74 |\" \(251| charact|
|00000b30| 65 72 73 5c 29 0a 73 65 | 64 20 22 73 2f 5e 58 2f |ers\).se|d "s/^X/|
|00000b40| 2f 22 20 3e 27 4d 41 4e | 49 46 45 53 54 27 20 3c |/" >'MAN|IFEST' <|
|00000b50| 3c 27 45 4e 44 5f 4f 46 | 5f 46 49 4c 45 27 0a 58 |<'END_OF|_FILE'.X|
|00000b60| 20 20 20 46 69 6c 65 20 | 4e 61 6d 65 09 09 41 72 | File |Name..Ar|
|00000b70| 63 68 69 76 65 20 23 09 | 44 65 73 63 72 69 70 74 |chive #.|Descript|
|00000b80| 69 6f 6e 0a 58 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ion.X---|--------|
|00000b90| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000ba0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000bb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000bc0| 0a 58 20 49 6e 73 74 61 | 6c 6c 20 20 20 20 20 20 |.X Insta|ll |
|00000bd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 31 09 | | 1.|
|00000be0| 0a 58 20 4d 41 4e 49 46 | 45 53 54 20 20 20 20 20 |.X MANIF|EST |
|00000bf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 31 09 | | 1.|
|00000c00| 0a 58 20 4d 61 6b 65 66 | 69 6c 65 20 20 20 20 20 |.X Makef|ile |
|00000c10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 31 09 | | 1.|
|00000c20| 0a 58 20 52 45 41 44 4d | 45 20 20 20 20 20 20 20 |.X READM|E |
|00000c30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 31 09 | | 1.|
|00000c40| 0a 58 20 64 75 70 2e 63 | 20 20 20 20 20 20 20 20 |.X dup.c| |
|00000c50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 31 09 | | 1.|
|00000c60| 0a 45 4e 44 5f 4f 46 5f | 46 49 4c 45 0a 69 66 20 |.END_OF_|FILE.if |
|00000c70| 74 65 73 74 20 32 35 31 | 20 2d 6e 65 20 60 77 63 |test 251| -ne `wc|
|00000c80| 20 2d 63 20 3c 27 4d 41 | 4e 49 46 45 53 54 27 60 | -c <'MA|NIFEST'`|
|00000c90| 3b 20 74 68 65 6e 0a 20 | 20 20 20 65 63 68 6f 20 |; then. | echo |
|00000ca0| 73 68 61 72 3a 20 5c 22 | 27 4d 41 4e 49 46 45 53 |shar: \"|'MANIFES|
|00000cb0| 54 27 5c 22 20 75 6e 70 | 61 63 6b 65 64 20 77 69 |T'\" unp|acked wi|
|00000cc0| 74 68 20 77 72 6f 6e 67 | 20 73 69 7a 65 21 0a 66 |th wrong| size!.f|
|00000cd0| 69 0a 23 20 65 6e 64 20 | 6f 66 20 27 4d 41 4e 49 |i.# end |of 'MANI|
|00000ce0| 46 45 53 54 27 0a 66 69 | 0a 69 66 20 74 65 73 74 |FEST'.fi|.if test|
|00000cf0| 20 2d 66 20 27 4d 61 6b | 65 66 69 6c 65 27 20 2d | -f 'Mak|efile' -|
|00000d00| 61 20 22 24 7b 31 7d 22 | 20 21 3d 20 22 2d 63 22 |a "${1}"| != "-c"|
|00000d10| 20 3b 20 74 68 65 6e 20 | 0a 20 20 65 63 68 6f 20 | ; then |. echo |
|00000d20| 73 68 61 72 3a 20 57 69 | 6c 6c 20 6e 6f 74 20 63 |shar: Wi|ll not c|
|00000d30| 6c 6f 62 62 65 72 20 65 | 78 69 73 74 69 6e 67 20 |lobber e|xisting |
|00000d40| 66 69 6c 65 20 5c 22 27 | 4d 61 6b 65 66 69 6c 65 |file \"'|Makefile|
|00000d50| 27 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |'\".else|.echo sh|
|00000d60| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|00000d70| 22 27 4d 61 6b 65 66 69 | 6c 65 27 5c 22 20 5c 28 |"'Makefi|le'\" \(|
|00000d80| 39 33 20 63 68 61 72 61 | 63 74 65 72 73 5c 29 0a |93 chara|cters\).|
|00000d90| 73 65 64 20 22 73 2f 5e | 58 2f 2f 22 20 3e 27 4d |sed "s/^|X//" >'M|
|00000da0| 61 6b 65 66 69 6c 65 27 | 20 3c 3c 27 45 4e 44 5f |akefile'| <<'END_|
|00000db0| 4f 46 5f 46 49 4c 45 27 | 0a 43 46 4c 41 47 53 3d |OF_FILE'|.CFLAGS=|
|00000dc0| 20 2d 4f 20 2d 44 58 45 | 4e 49 58 20 2d 44 4d 5f | -O -DXE|NIX -DM_|
|00000dd0| 4b 45 52 4e 45 4c 20 2d | 4d 33 65 20 2d 5a 70 34 |KERNEL -|M3e -Zp4|
|00000de0| 20 2d 49 2f 75 73 72 2f | 73 79 73 2f 68 0a 58 0a | -I/usr/|sys/h.X.|
|00000df0| 64 75 70 2e 6f 3a 20 64 | 75 70 2e 63 0a 58 09 24 |dup.o: d|up.c.X.$|
|00000e00| 28 43 43 29 20 24 28 43 | 46 4c 41 47 53 29 20 2d |(CC) $(C|FLAGS) -|
|00000e10| 63 20 64 75 70 2e 63 0a | 45 4e 44 5f 4f 46 5f 46 |c dup.c.|END_OF_F|
|00000e20| 49 4c 45 0a 69 66 20 74 | 65 73 74 20 39 33 20 2d |ILE.if t|est 93 -|
|00000e30| 6e 65 20 60 77 63 20 2d | 63 20 3c 27 4d 61 6b 65 |ne `wc -|c <'Make|
|00000e40| 66 69 6c 65 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |file'`; |then. |
|00000e50| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 4d | echo sh|ar: \"'M|
|00000e60| 61 6b 65 66 69 6c 65 27 | 5c 22 20 75 6e 70 61 63 |akefile'|\" unpac|
|00000e70| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|00000e80| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|00000e90| 20 27 4d 61 6b 65 66 69 | 6c 65 27 0a 66 69 0a 69 | 'Makefi|le'.fi.i|
|00000ea0| 66 20 74 65 73 74 20 2d | 66 20 27 52 45 41 44 4d |f test -|f 'READM|
|00000eb0| 45 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |E' -a "$|{1}" != |
|00000ec0| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00000ed0| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|00000ee0| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|00000ef0| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 52 45 41 44 |ing file| \"'READ|
|00000f00| 4d 45 27 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |ME'\".el|se.echo |
|00000f10| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00000f20| 20 5c 22 27 52 45 41 44 | 4d 45 27 5c 22 20 5c 28 | \"'READ|ME'\" \(|
|00000f30| 31 37 37 37 20 63 68 61 | 72 61 63 74 65 72 73 5c |1777 cha|racters\|
|00000f40| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|00000f50| 27 52 45 41 44 4d 45 27 | 20 3c 3c 27 45 4e 44 5f |'README'| <<'END_|
|00000f60| 4f 46 5f 46 49 4c 45 27 | 0a 54 68 65 20 53 6f 75 |OF_FILE'|.The Sou|
|00000f70| 72 63 65 0a 58 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0a |rce.X---|-------.|
|00000f80| 58 0a 54 68 69 73 20 2f | 64 65 76 2f 66 64 20 64 |X.This /|dev/fd d|
|00000f90| 72 69 76 65 72 20 69 73 | 20 6c 6f 6f 73 65 6c 79 |river is| loosely|
|00000fa0| 20 62 61 73 65 64 20 6f | 6e 20 6f 6e 65 20 77 72 | based o|n one wr|
|00000fb0| 69 74 74 65 6e 20 62 79 | 20 4d 69 6b 65 0a 58 22 |itten by| Mike.X"|
|00000fc0| 46 6f 72 64 22 20 44 69 | 74 74 6f 20 66 6f 72 20 |Ford" Di|tto for |
|00000fd0| 74 68 65 20 41 54 26 54 | 20 55 4e 49 58 20 70 63 |the AT&T| UNIX pc|
|00000fe0| 2e 20 20 54 68 69 73 20 | 76 65 72 73 69 6f 6e 20 |. This |version |
|00000ff0| 72 75 6e 73 20 6f 6e 20 | 53 43 4f 0a 58 58 45 4e |runs on |SCO.XXEN|
|00001000| 49 58 20 33 38 36 2c 20 | 76 65 72 73 69 6f 6e 20 |IX 386, |version |
|00001010| 32 2e 33 2b 2e 20 20 54 | 68 65 20 69 6e 73 74 61 |2.3+. T|he insta|
|00001020| 6c 6c 20 73 63 72 69 70 | 74 20 69 6e 63 6c 75 64 |ll scrip|t includ|
|00001030| 65 64 20 77 69 6c 6c 0a | 63 6f 6e 66 69 67 75 72 |ed will.|configur|
|00001040| 65 20 74 68 65 20 6b 65 | 72 6e 65 6c 2c 20 65 64 |e the ke|rnel, ed|
|00001050| 69 74 20 2f 75 73 72 2f | 73 79 73 2f 63 6f 6e 66 |it /usr/|sys/conf|
|00001060| 2f 6c 69 6e 6b 5f 78 65 | 6e 69 78 2c 20 61 6e 64 |/link_xe|nix, and|
|00001070| 20 62 75 69 6c 64 0a 74 | 68 65 20 6e 65 77 20 6b | build.t|he new k|
|00001080| 65 72 6e 65 6c 20 61 6e | 64 20 64 65 76 69 63 65 |ernel an|d device|
|00001090| 20 66 69 6c 65 73 20 69 | 6e 20 2f 64 65 76 2f 66 | files i|n /dev/f|
|000010a0| 64 2e 0a 58 0a 42 75 69 | 6c 64 69 6e 67 20 74 68 |d..X.Bui|lding th|
|000010b0| 65 20 64 72 69 76 65 72 | 0a 58 2d 2d 2d 2d 2d 2d |e driver|.X------|
|000010c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 0a 58 0a |--------|-----.X.|
|000010d0| 54 6f 20 70 72 6f 70 65 | 72 6c 79 20 62 75 69 6c |To prope|rly buil|
|000010e0| 64 20 65 76 65 72 79 74 | 68 69 6e 67 2c 20 6d 6f |d everyt|hing, mo|
|000010f0| 76 65 20 74 68 65 20 4d | 61 6b 65 66 69 6c 65 2c |ve the M|akefile,|
|00001100| 20 64 75 70 2e 63 20 61 | 6e 64 0a 49 6e 73 74 61 | dup.c a|nd.Insta|
|00001110| 6c 6c 20 73 63 72 69 70 | 74 20 69 6e 74 6f 20 61 |ll scrip|t into a|
|00001120| 20 6e 65 77 20 64 69 72 | 65 63 74 6f 72 79 20 63 | new dir|ectory c|
|00001130| 61 6c 6c 65 64 20 2f 75 | 73 72 2f 73 79 73 2f 69 |alled /u|sr/sys/i|
|00001140| 6f 2f 64 75 70 2c 20 61 | 6e 64 0a 72 75 6e 20 6d |o/dup, a|nd.run m|
|00001150| 61 6b 65 20 69 6e 20 74 | 68 61 74 20 64 69 72 65 |ake in t|hat dire|
|00001160| 63 74 6f 72 79 2e 20 20 | 54 68 65 6e 20 72 75 6e |ctory. |Then run|
|00001170| 20 49 6e 73 74 61 6c 6c | 2e 0a 58 0a 57 68 61 74 | Install|..X.What|
|00001180| 20 2f 64 65 76 2f 66 64 | 20 69 73 0a 58 2d 2d 2d | /dev/fd| is.X---|
|00001190| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0a 54 68 65 |--------|----.The|
|000011a0| 20 2f 64 65 76 2f 66 64 | 20 64 72 69 76 65 72 20 | /dev/fd| driver |
|000011b0| 65 66 66 65 63 74 69 76 | 65 6c 79 20 61 6c 6c 6f |effectiv|ely allo|
|000011c0| 77 73 20 79 6f 75 20 74 | 6f 20 73 70 65 63 69 66 |ws you t|o specif|
|000011d0| 79 20 61 6e 20 61 6c 72 | 65 61 64 79 2d 6f 70 65 |y an alr|eady-ope|
|000011e0| 6e 0a 66 69 6c 65 20 64 | 65 73 63 72 69 70 74 6f |n.file d|escripto|
|000011f0| 72 20 6e 75 6d 62 65 72 | 20 77 68 65 72 65 20 61 |r number| where a|
|00001200| 20 70 61 74 68 20 6e 61 | 6d 65 20 69 73 20 6e 6f | path na|me is no|
|00001210| 72 6d 61 6c 6c 79 20 72 | 65 71 75 69 72 65 64 2e |rmally r|equired.|
|00001220| 20 54 68 69 73 0a 61 6c | 6c 6f 77 73 20 61 20 70 | This.al|lows a p|
|00001230| 72 6f 67 72 61 6d 20 74 | 68 61 74 20 64 65 6d 61 |rogram t|hat dema|
|00001240| 6e 64 73 20 61 20 70 61 | 74 68 20 6e 61 6d 65 20 |nds a pa|th name |
|00001250| 74 6f 20 62 65 20 75 73 | 65 64 20 74 6f 20 70 72 |to be us|ed to pr|
|00001260| 6f 63 65 73 73 0a 73 74 | 61 6e 64 61 72 64 20 69 |ocess.st|andard i|
|00001270| 6e 70 75 74 20 6f 72 20 | 73 74 61 6e 64 61 72 64 |nput or |standard|
|00001280| 20 6f 75 74 70 75 74 20 | 62 79 20 73 70 65 63 69 | output |by speci|
|00001290| 66 79 69 6e 67 20 2f 64 | 65 76 2f 66 64 2f 30 20 |fying /d|ev/fd/0 |
|000012a0| 6f 72 20 2f 64 65 76 2f | 66 64 2f 31 2c 0a 72 65 |or /dev/|fd/1,.re|
|000012b0| 73 70 65 63 74 69 76 65 | 6c 79 2e 0a 58 0a 58 2f |spective|ly..X.X/|
|000012c0| 64 65 76 2f 73 74 64 69 | 6e 20 61 6e 64 20 2f 64 |dev/stdi|n and /d|
|000012d0| 65 76 2f 73 64 74 6f 75 | 74 20 61 72 65 20 6c 69 |ev/sdtou|t are li|
|000012e0| 6e 6b 73 20 74 6f 20 74 | 68 65 20 72 65 73 70 65 |nks to t|he respe|
|000012f0| 63 74 69 76 65 20 65 6e | 74 72 69 65 73 20 69 6e |ctive en|tries in|
|00001300| 0a 58 2f 64 65 76 2f 66 | 64 2f 2e 0a 58 0a 54 68 |.X/dev/f|d/..X.Th|
|00001310| 69 73 20 69 73 20 70 72 | 69 6d 61 72 69 6c 79 20 |is is pr|imarily |
|00001320| 75 73 65 66 75 6c 20 77 | 68 65 6e 20 72 75 6e 6e |useful w|hen runn|
|00001330| 69 6e 67 20 61 20 70 6f | 6f 72 6c 79 2d 77 72 69 |ing a po|orly-wri|
|00001340| 74 74 65 6e 20 70 72 6f | 67 72 61 6d 20 74 68 61 |tten pro|gram tha|
|00001350| 74 0a 68 61 73 20 6e 6f | 20 70 72 6f 76 69 73 69 |t.has no| provisi|
|00001360| 6f 6e 20 66 6f 72 20 75 | 73 69 6e 67 20 73 74 64 |on for u|sing std|
|00001370| 69 6e 2f 73 74 64 6f 75 | 74 2e 20 20 46 6f 72 20 |in/stdou|t. For |
|00001380| 65 78 61 6d 70 6c 65 3a | 0a 58 0a 58 09 66 69 6e |example:|.X.X.fin|
|00001390| 64 20 2e 20 2d 63 70 69 | 6f 20 2f 64 65 76 2f 73 |d . -cpi|o /dev/s|
|000013a0| 74 64 6f 75 74 20 7c 20 | 63 6f 6d 70 72 65 73 73 |tdout | |compress|
|000013b0| 20 3e 20 2f 64 65 76 2f | 72 66 70 30 32 31 0a 58 | > /dev/|rfp021.X|
|000013c0| 0a 58 28 54 68 65 20 22 | 2d 63 70 69 6f 22 20 6f |.X(The "|-cpio" o|
|000013d0| 70 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 22 66 69 |ption of| the "fi|
|000013e0| 6e 64 22 20 63 6f 6d 6d | 61 6e 64 20 64 65 6d 61 |nd" comm|and dema|
|000013f0| 6e 64 73 20 61 20 66 69 | 6c 65 20 6e 61 6d 65 20 |nds a fi|le name |
|00001400| 61 6e 64 0a 6e 6f 72 6d | 61 6c 6c 79 20 63 61 6e |and.norm|ally can|
|00001410| 20 6e 6f 74 20 77 72 69 | 74 65 20 74 6f 20 73 74 | not wri|te to st|
|00001420| 61 6e 64 61 72 64 20 6f | 75 74 70 75 74 2e 20 20 |andard o|utput. |
|00001430| 54 68 69 73 20 65 78 61 | 6d 70 6c 65 20 67 69 76 |This exa|mple giv|
|00001440| 65 73 20 69 74 0a 74 68 | 65 20 6e 61 6d 65 20 22 |es it.th|e name "|
|00001450| 2f 64 65 76 2f 73 74 64 | 6f 75 74 22 20 61 6c 6c |/dev/std|out" all|
|00001460| 6f 77 69 6e 67 20 69 74 | 20 74 6f 20 62 65 20 70 |owing it| to be p|
|00001470| 69 70 65 64 20 64 69 72 | 65 63 74 6c 79 20 74 6f |iped dir|ectly to|
|00001480| 20 63 6f 6d 70 72 65 73 | 73 0a 72 61 74 68 65 72 | compres|s.rather|
|00001490| 20 74 68 61 6e 20 77 72 | 69 74 69 6e 67 20 74 6f | than wr|iting to|
|000014a0| 20 61 20 74 65 6d 70 6f | 72 61 72 79 20 66 69 6c | a tempo|rary fil|
|000014b0| 65 2e 29 0a 58 0a 4e 6f | 74 65 20 74 68 61 74 20 |e.).X.No|te that |
|000014c0| 73 6f 6d 65 20 70 72 6f | 67 72 61 6d 73 20 77 68 |some pro|grams wh|
|000014d0| 69 63 68 20 64 65 6d 61 | 6e 64 20 61 20 66 69 6c |ich dema|nd a fil|
|000014e0| 65 20 6e 61 6d 65 20 64 | 6f 20 73 6f 20 62 65 63 |e name d|o so bec|
|000014f0| 61 75 73 65 0a 74 68 65 | 79 20 6d 75 73 74 20 6c |ause.the|y must l|
|00001500| 73 65 65 6b 28 32 29 20 | 6f 6e 20 74 68 65 20 66 |seek(2) |on the f|
|00001510| 69 6c 65 2c 20 61 6e 64 | 20 74 68 75 73 20 77 69 |ile, and| thus wi|
|00001520| 6c 6c 20 6e 6f 74 20 77 | 6f 72 6b 20 69 66 20 74 |ll not w|ork if t|
|00001530| 6f 6c 64 0a 74 6f 20 70 | 72 6f 63 65 73 73 20 73 |old.to p|rocess s|
|00001540| 74 64 69 6e 20 61 6e 64 | 20 73 74 64 69 6e 20 69 |tdin and| stdin i|
|00001550| 73 20 61 20 70 69 70 65 | 2e 0a 58 0a 54 68 65 20 |s a pipe|..X.The |
|00001560| 6d 6f 73 74 20 63 6f 6d | 6d 6f 6e 20 75 73 65 20 |most com|mon use |
|00001570| 66 6f 72 20 74 68 65 20 | 2f 64 65 76 2f 66 64 20 |for the |/dev/fd |
|00001580| 64 72 69 76 65 72 20 74 | 68 61 74 20 49 20 68 61 |driver t|hat I ha|
|00001590| 76 65 20 66 6f 75 6e 64 | 20 69 73 0a 66 6f 72 20 |ve found| is.for |
|000015a0| 22 70 72 6f 63 65 73 73 | 20 73 75 62 73 74 69 74 |"process| substit|
|000015b0| 75 74 69 6f 6e 22 20 75 | 6e 64 65 72 20 74 68 65 |ution" u|nder the|
|000015c0| 20 73 68 65 6c 6c 20 72 | 63 2c 20 61 6e 64 20 74 | shell r|c, and t|
|000015d0| 68 6f 73 65 0a 76 65 72 | 73 69 6f 6e 73 20 6f 66 |hose.ver|sions of|
|000015e0| 20 74 68 65 20 4b 6f 72 | 6e 20 73 68 65 6c 6c 20 | the Kor|n shell |
|000015f0| 74 68 61 74 20 73 75 70 | 70 6f 72 74 20 69 74 2e |that sup|port it.|
|00001600| 20 20 46 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 74 | For ex|ample, t|
|00001610| 6f 0a 75 73 65 20 6a 6f | 76 65 27 73 20 22 70 61 |o.use jo|ve's "pa|
|00001620| 72 73 65 2d 65 72 72 6f | 72 2d 66 69 6c 65 22 20 |rse-erro|r-file" |
|00001630| 66 75 6e 63 74 69 6f 6e | 2c 20 79 6f 75 20 63 6f |function|, you co|
|00001640| 75 6c 64 20 73 61 79 0a | 58 0a 58 09 3b 20 6a 6f |uld say.|X.X.; jo|
|00001650| 76 65 20 2d 70 20 3c 7b | 65 67 72 65 70 20 2d 6e |ve -p <{|egrep -n|
|00001660| 20 66 75 6e 63 4e 61 6d | 65 20 2a 2e 63 7d 0a 45 | funcNam|e *.c}.E|
|00001670| 4e 44 5f 4f 46 5f 46 49 | 4c 45 0a 69 66 20 74 65 |ND_OF_FI|LE.if te|
|00001680| 73 74 20 31 37 37 37 20 | 2d 6e 65 20 60 77 63 20 |st 1777 |-ne `wc |
|00001690| 2d 63 20 3c 27 52 45 41 | 44 4d 45 27 60 3b 20 74 |-c <'REA|DME'`; t|
|000016a0| 68 65 6e 0a 20 20 20 20 | 65 63 68 6f 20 73 68 61 |hen. |echo sha|
|000016b0| 72 3a 20 5c 22 27 52 45 | 41 44 4d 45 27 5c 22 20 |r: \"'RE|ADME'\" |
|000016c0| 75 6e 70 61 63 6b 65 64 | 20 77 69 74 68 20 77 72 |unpacked| with wr|
|000016d0| 6f 6e 67 20 73 69 7a 65 | 21 0a 66 69 0a 23 20 65 |ong size|!.fi.# e|
|000016e0| 6e 64 20 6f 66 20 27 52 | 45 41 44 4d 45 27 0a 66 |nd of 'R|EADME'.f|
|000016f0| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 64 75 |i.if tes|t -f 'du|
|00001700| 70 2e 63 27 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |p.c' -a |"${1}" !|
|00001710| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|00001720| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|00001730| 20 6e 6f 74 20 63 6c 6f | 62 62 65 72 20 65 78 69 | not clo|bber exi|
|00001740| 73 74 69 6e 67 20 66 69 | 6c 65 20 5c 22 27 64 75 |sting fi|le \"'du|
|00001750| 70 2e 63 27 5c 22 0a 65 | 6c 73 65 0a 65 63 68 6f |p.c'\".e|lse.echo|
|00001760| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|00001770| 67 20 5c 22 27 64 75 70 | 2e 63 27 5c 22 20 5c 28 |g \"'dup|.c'\" \(|
|00001780| 32 37 35 30 20 63 68 61 | 72 61 63 74 65 72 73 5c |2750 cha|racters\|
|00001790| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|000017a0| 27 64 75 70 2e 63 27 20 | 3c 3c 27 45 4e 44 5f 4f |'dup.c' |<<'END_O|
|000017b0| 46 5f 46 49 4c 45 27 0a | 58 2f 2a 0a 58 20 2a 20 |F_FILE'.|X/*.X * |
|000017c0| 64 75 70 2e 63 20 2d 20 | 2f 64 65 76 2f 66 64 20 |dup.c - |/dev/fd |
|000017d0| 64 72 69 76 65 72 0a 58 | 20 2a 0a 58 20 2a 20 6f |driver.X| *.X * o|
|000017e0| 70 65 6e 28 22 2f 64 65 | 76 2f 66 64 2f 4e 22 29 |pen("/de|v/fd/N")|
|000017f0| 20 69 73 20 28 74 68 65 | 6f 72 65 74 69 63 61 6c | is (the|oretical|
|00001800| 6c 79 29 20 65 71 75 69 | 76 61 6c 65 6e 74 20 74 |ly) equi|valent t|
|00001810| 6f 20 64 75 70 28 4e 29 | 2e 0a 58 20 2a 0a 58 20 |o dup(N)|..X *.X |
|00001820| 2a 0a 58 20 2a 20 54 68 | 65 20 44 69 74 74 6f 20 |*.X * Th|e Ditto |
|00001830| 76 65 72 73 69 6f 6e 20 | 6f 66 20 74 68 69 73 20 |version |of this |
|00001840| 64 72 69 76 65 72 20 77 | 61 73 20 70 6f 72 74 65 |driver w|as porte|
|00001850| 64 20 74 6f 20 53 43 4f | 20 58 45 4e 49 58 20 62 |d to SCO| XENIX b|
|00001860| 79 0a 58 20 2a 20 44 61 | 76 69 64 20 4a 2e 20 46 |y.X * Da|vid J. F|
|00001870| 69 61 6e 64 65 72 2c 20 | 77 69 74 68 20 73 65 76 |iander, |with sev|
|00001880| 65 72 61 6c 20 65 6e 68 | 61 6e 63 65 6d 65 6e 74 |eral enh|ancement|
|00001890| 73 20 61 64 64 65 64 20 | 6f 6e 20 74 68 65 20 77 |s added |on the w|
|000018a0| 61 79 2e 0a 58 20 2a 20 | 54 68 69 73 20 76 65 72 |ay..X * |This ver|
|000018b0| 73 69 6f 6e 20 69 73 20 | 5f 6e 6f 74 5f 20 69 6e |sion is |_not_ in|
|000018c0| 20 74 68 65 20 70 75 62 | 6c 69 63 20 64 6f 6d 61 | the pub|lic doma|
|000018d0| 69 6e 2e 20 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |in. The| followi|
|000018e0| 6e 67 0a 58 20 2a 20 63 | 6f 70 79 72 69 67 68 74 |ng.X * c|opyright|
|000018f0| 20 6e 6f 74 69 63 65 20 | 6e 6f 77 20 61 70 70 6c | notice |now appl|
|00001900| 69 65 73 2e 0a 58 20 2a | 0a 58 20 2a 20 43 6f 70 |ies..X *|.X * Cop|
|00001910| 79 72 69 67 68 74 20 31 | 39 39 32 2c 20 44 61 76 |yright 1|992, Dav|
|00001920| 69 64 20 4a 2e 20 20 46 | 69 61 6e 64 65 72 2e 20 |id J. F|iander. |
|00001930| 20 46 72 65 65 20 64 69 | 73 74 72 69 62 75 74 69 | Free di|stributi|
|00001940| 6f 6e 20 6f 66 0a 58 20 | 2a 20 75 6e 6d 6f 64 69 |on of.X |* unmodi|
|00001950| 66 69 65 64 20 76 65 72 | 73 69 6f 6e 73 20 6f 66 |fied ver|sions of|
|00001960| 20 74 68 69 73 20 73 6f | 75 72 63 65 20 69 73 20 | this so|urce is |
|00001970| 70 65 72 6d 69 74 74 65 | 64 2e 0a 58 20 2a 0a 58 |permitte|d..X *.X|
|00001980| 20 2a 20 52 65 64 69 73 | 74 72 69 62 75 74 69 6f | * Redis|tributio|
|00001990| 6e 20 61 6e 64 20 75 73 | 65 20 69 6e 20 73 6f 75 |n and us|e in sou|
|000019a0| 72 63 65 20 61 6e 64 20 | 62 69 6e 61 72 79 20 66 |rce and |binary f|
|000019b0| 6f 72 6d 73 20 61 72 65 | 20 70 65 72 6d 69 74 74 |orms are| permitt|
|000019c0| 65 64 0a 58 20 2a 20 70 | 72 6f 76 69 64 65 64 20 |ed.X * p|rovided |
|000019d0| 74 68 61 74 20 74 68 65 | 20 61 62 6f 76 65 20 63 |that the| above c|
|000019e0| 6f 70 79 72 69 67 68 74 | 20 6e 6f 74 69 63 65 20 |opyright| notice |
|000019f0| 69 73 20 64 75 70 6c 69 | 63 61 74 65 64 20 69 6e |is dupli|cated in|
|00001a00| 20 61 6c 6c 0a 58 20 2a | 20 73 75 63 68 20 66 6f | all.X *| such fo|
|00001a10| 72 6d 73 20 61 6e 64 20 | 74 68 61 74 20 61 6e 79 |rms and |that any|
|00001a20| 20 64 6f 63 75 6d 65 6e | 74 61 74 69 6f 6e 20 72 | documen|tation r|
|00001a30| 65 6c 61 74 65 64 20 74 | 6f 20 73 75 63 68 0a 58 |elated t|o such.X|
|00001a40| 20 2a 20 64 69 73 74 72 | 69 62 75 74 69 6f 6e 20 | * distr|ibution |
|00001a50| 61 6e 64 20 75 73 65 20 | 61 63 6b 6e 6f 77 6c 65 |and use |acknowle|
|00001a60| 67 65 20 74 68 61 74 20 | 74 68 65 20 73 6f 66 74 |ge that |the soft|
|00001a70| 77 61 72 65 20 77 61 73 | 0a 58 20 2a 20 64 65 76 |ware was|.X * dev|
|00001a80| 65 6c 6f 70 65 64 20 62 | 79 20 44 61 76 69 64 20 |eloped b|y David |
|00001a90| 4a 2e 20 46 69 61 6e 64 | 65 72 2e 0a 58 20 2a 0a |J. Fiand|er..X *.|
|00001aa0| 58 20 2a 20 54 48 49 53 | 20 53 4f 46 54 57 41 52 |X * THIS| SOFTWAR|
|00001ab0| 45 20 49 53 20 50 52 4f | 56 49 44 45 44 20 22 41 |E IS PRO|VIDED "A|
|00001ac0| 53 20 49 53 22 20 41 4e | 44 20 57 49 54 48 4f 55 |S IS" AN|D WITHOU|
|00001ad0| 54 20 41 4e 59 20 45 58 | 50 52 45 53 53 20 4f 52 |T ANY EX|PRESS OR|
|00001ae0| 0a 58 20 2a 20 49 4d 50 | 4c 49 45 44 20 57 41 52 |.X * IMP|LIED WAR|
|00001af0| 52 41 4e 54 49 45 53 2c | 20 49 4e 43 4c 55 44 49 |RANTIES,| INCLUDI|
|00001b00| 4e 47 2c 20 57 49 54 48 | 4f 55 54 20 4c 49 4d 49 |NG, WITH|OUT LIMI|
|00001b10| 54 41 54 49 4f 4e 2c 20 | 54 48 45 20 49 4d 50 4c |TATION, |THE IMPL|
|00001b20| 49 45 44 0a 58 20 2a 20 | 57 41 52 52 41 4e 54 49 |IED.X * |WARRANTI|
|00001b30| 45 53 20 4f 46 20 4d 45 | 52 43 48 41 4e 54 49 42 |ES OF ME|RCHANTIB|
|00001b40| 49 4c 49 54 59 20 41 4e | 44 20 46 49 54 4e 45 53 |ILITY AN|D FITNES|
|00001b50| 53 20 46 4f 52 20 41 20 | 50 41 52 54 49 43 55 4c |S FOR A |PARTICUL|
|00001b60| 41 52 0a 58 20 2a 20 50 | 55 52 50 4f 53 45 2e 0a |AR.X * P|URPOSE..|
|00001b70| 58 20 2a 0a 58 20 2a 20 | 28 48 65 79 2c 20 69 74 |X *.X * |(Hey, it|
|00001b80| 20 77 6f 72 6b 65 64 20 | 66 6f 72 20 4d 61 72 6b | worked |for Mark|
|00001b90| 20 43 6f 6c 62 75 72 6e | 2c 20 64 69 64 6e 27 74 | Colburn|, didn't|
|00001ba0| 20 69 74 3f 29 0a 58 20 | 2a 0a 58 20 2a 20 54 68 | it?).X |*.X * Th|
|00001bb0| 69 73 20 70 72 6f 67 72 | 61 6d 20 77 61 73 20 77 |is progr|am was w|
|00001bc0| 72 69 74 74 65 6e 20 62 | 79 20 6d 65 2c 20 4d 69 |ritten b|y me, Mi|
|00001bd0| 6b 65 20 22 46 6f 72 64 | 22 20 44 69 74 74 6f 2c |ke "Ford|" Ditto,|
|00001be0| 20 61 6e 64 0a 58 20 2a | 20 49 20 68 65 72 65 62 | and.X *| I hereb|
|00001bf0| 79 20 72 65 6c 65 61 73 | 65 20 69 74 20 69 6e 74 |y releas|e it int|
|00001c00| 6f 20 74 68 65 20 70 75 | 62 6c 69 63 20 64 6f 6d |o the pu|blic dom|
|00001c10| 61 69 6e 20 69 6e 20 74 | 68 65 20 69 6e 74 65 72 |ain in t|he inter|
|00001c20| 65 73 74 0a 58 20 2a 20 | 6f 66 20 70 72 6f 6d 6f |est.X * |of promo|
|00001c30| 74 69 6e 67 20 74 68 65 | 20 64 65 76 65 6c 6f 70 |ting the| develop|
|00001c40| 6d 65 6e 74 20 6f 66 20 | 66 72 65 65 2c 20 71 75 |ment of |free, qu|
|00001c50| 61 6c 69 74 79 20 73 6f | 66 74 77 61 72 65 0a 58 |ality so|ftware.X|
|00001c60| 20 2a 20 66 6f 72 20 74 | 68 65 20 68 61 63 6b 65 | * for t|he hacke|
|00001c70| 72 73 20 61 6e 64 20 75 | 73 65 72 73 20 6f 66 20 |rs and u|sers of |
|00001c80| 74 68 65 20 77 6f 72 6c | 64 2e 0a 58 20 2a 0a 58 |the worl|d..X *.X|
|00001c90| 20 2a 20 46 65 65 6c 20 | 66 72 65 65 20 74 6f 20 | * Feel |free to |
|00001ca0| 75 73 65 2c 20 63 6f 70 | 79 2c 20 6d 6f 64 69 66 |use, cop|y, modif|
|00001cb0| 79 2c 20 69 6d 70 72 6f | 76 65 2c 20 61 6e 64 20 |y, impro|ve, and |
|00001cc0| 72 65 64 69 73 74 72 69 | 62 75 74 65 0a 58 20 2a |redistri|bute.X *|
|00001cd0| 20 74 68 69 73 20 70 72 | 6f 67 72 61 6d 2c 20 62 | this pr|ogram, b|
|00001ce0| 75 74 20 70 6c 65 61 73 | 65 20 6b 65 65 70 20 69 |ut pleas|e keep i|
|00001cf0| 6e 20 6d 69 6e 64 20 74 | 68 65 20 73 70 69 72 69 |n mind t|he spiri|
|00001d00| 74 20 6f 66 20 74 68 69 | 73 0a 58 20 2a 20 63 6f |t of thi|s.X * co|
|00001d10| 6e 74 72 69 62 75 74 69 | 6f 6e 3b 20 61 6c 77 61 |ntributi|on; alwa|
|00001d20| 79 73 20 70 72 6f 76 69 | 64 65 20 73 6f 75 72 63 |ys provi|de sourc|
|00001d30| 65 2c 20 61 6e 64 20 61 | 6c 77 61 79 73 20 61 6c |e, and a|lways al|
|00001d40| 6c 6f 77 0a 58 20 2a 20 | 66 72 65 65 20 72 65 64 |low.X * |free red|
|00001d50| 69 73 74 72 69 62 75 74 | 69 6f 6e 20 28 73 68 61 |istribut|ion (sha|
|00001d60| 72 65 77 61 72 65 20 69 | 73 20 66 69 6e 65 20 77 |reware i|s fine w|
|00001d70| 69 74 68 20 6d 65 29 2e | 0a 58 20 2a 0a 58 20 2a |ith me).|.X *.X *|
|00001d80| 09 09 09 09 2d 3d 5d 20 | 46 6f 72 64 20 5b 3d 2d |....-=] |Ford [=-|
|00001d90| 0a 58 20 2a 2f 0a 58 0a | 58 23 64 65 66 69 6e 65 |.X */.X.|X#define|
|00001da0| 20 4b 45 52 4e 45 4c 09 | 09 31 0a 58 0a 58 23 69 | KERNEL.|.1.X.X#i|
|00001db0| 6e 63 6c 75 64 65 20 22 | 73 79 73 2f 74 79 70 65 |nclude "|sys/type|
|00001dc0| 73 2e 68 22 0a 58 23 69 | 6e 63 6c 75 64 65 20 22 |s.h".X#i|nclude "|
|00001dd0| 73 79 73 2f 70 61 72 61 | 6d 2e 68 22 0a 58 23 69 |sys/para|m.h".X#i|
|00001de0| 6e 63 6c 75 64 65 20 22 | 73 79 73 2f 73 79 73 6d |nclude "|sys/sysm|
|00001df0| 61 63 72 6f 73 2e 68 22 | 0a 58 23 69 6e 63 6c 75 |acros.h"|.X#inclu|
|00001e00| 64 65 20 22 73 79 73 2f | 64 69 72 2e 68 22 0a 58 |de "sys/|dir.h".X|
|00001e10| 23 69 6e 63 6c 75 64 65 | 20 22 73 79 73 2f 73 69 |#include| "sys/si|
|00001e20| 67 6e 61 6c 2e 68 22 0a | 58 23 69 6e 63 6c 75 64 |gnal.h".|X#includ|
|00001e30| 65 20 22 73 79 73 2f 70 | 61 67 65 2e 68 22 0a 58 |e "sys/p|age.h".X|
|00001e40| 23 69 6e 63 6c 75 64 65 | 20 22 73 79 73 2f 73 65 |#include| "sys/se|
|00001e50| 67 2e 68 22 0a 58 23 69 | 6e 63 6c 75 64 65 20 22 |g.h".X#i|nclude "|
|00001e60| 73 79 73 2f 75 73 65 72 | 2e 68 22 0a 58 23 69 6e |sys/user|.h".X#in|
|00001e70| 63 6c 75 64 65 20 22 73 | 79 73 2f 66 69 6c 65 2e |clude "s|ys/file.|
|00001e80| 68 22 0a 58 23 69 6e 63 | 6c 75 64 65 20 22 73 79 |h".X#inc|lude "sy|
|00001e90| 73 2f 73 79 73 74 6d 2e | 68 22 0a 58 23 69 6e 63 |s/systm.|h".X#inc|
|00001ea0| 6c 75 64 65 20 22 73 79 | 73 2f 65 72 72 6e 6f 2e |lude "sy|s/errno.|
|00001eb0| 68 22 0a 58 0a 76 6f 69 | 64 20 64 75 70 6f 70 65 |h".X.voi|d dupope|
|00001ec0| 6e 28 64 65 76 2c 20 66 | 6c 61 67 2c 20 69 64 29 |n(dev, f|lag, id)|
|00001ed0| 0a 72 65 67 69 73 74 65 | 72 20 64 65 76 5f 74 09 |.registe|r dev_t.|
|00001ee0| 64 65 76 3b 0a 69 6e 74 | 09 09 66 6c 61 67 3b 0a |dev;.int|..flag;.|
|00001ef0| 69 6e 74 09 09 69 64 3b | 0a 58 7b 0a 58 20 20 20 |int..id;|.X{.X |
|00001f00| 20 72 65 67 69 73 74 65 | 72 20 73 74 72 75 63 74 | registe|r struct|
|00001f10| 20 66 69 6c 65 20 2a 66 | 70 3b 0a 58 20 20 20 20 | file *f|p;.X |
|00001f20| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 66 64 3b |register| int fd;|
|00001f30| 0a 58 0a 58 20 20 20 20 | 2f 2a 20 46 69 72 73 74 |.X.X |/* First|
|00001f40| 2c 20 76 61 6c 69 64 61 | 74 65 20 74 68 65 20 65 |, valida|te the e|
|00001f50| 78 69 73 74 69 6e 67 20 | 66 64 20 74 6f 20 62 65 |xisting |fd to be|
|00001f60| 20 64 75 70 65 64 20 2a | 2f 0a 58 20 20 20 20 69 | duped *|/.X i|
|00001f70| 66 20 28 21 28 66 70 20 | 3d 20 67 65 74 66 28 6d |f (!(fp |= getf(m|
|00001f80| 69 6e 6f 72 28 64 65 76 | 29 29 29 29 0a 58 09 72 |inor(dev|)))).X.r|
|00001f90| 65 74 75 72 6e 3b 0a 58 | 0a 58 20 20 20 20 2f 2a |eturn;.X|.X /*|
|00001fa0| 20 4d 61 6b 65 20 73 75 | 72 65 20 77 65 20 61 72 | Make su|re we ar|
|00001fb0| 65 20 6e 6f 74 20 61 62 | 6f 75 74 20 74 6f 20 72 |e not ab|out to r|
|00001fc0| 65 74 75 72 6e 20 74 68 | 65 20 73 61 6d 65 20 66 |eturn th|e same f|
|00001fd0| 64 20 74 68 61 74 20 77 | 61 73 20 72 65 71 75 65 |d that w|as reque|
|00001fe0| 73 74 65 64 20 2a 2f 0a | 58 20 20 20 20 66 64 20 |sted */.|X fd |
|00001ff0| 3d 20 75 2e 75 5f 72 76 | 61 6c 31 3b 0a 58 20 20 |= u.u_rv|al1;.X |
|00002000| 20 20 69 66 20 28 6d 69 | 6e 6f 72 28 64 65 76 29 | if (mi|nor(dev)|
|00002010| 20 3d 3d 20 66 64 29 0a | 58 20 20 20 20 7b 0a 58 | == fd).|X {.X|
|00002020| 09 75 2e 75 5f 65 72 72 | 6f 72 20 3d 20 45 42 41 |.u.u_err|or = EBA|
|00002030| 44 46 3b 0a 58 09 72 65 | 74 75 72 6e 3b 0a 58 20 |DF;.X.re|turn;.X |
|00002040| 20 20 20 7d 0a 58 0a 58 | 20 20 20 20 2f 2a 0a 58 | }.X.X| /*.X|
|00002050| 20 20 20 20 20 2a 20 4d | 61 6b 65 20 73 75 72 65 | * M|ake sure|
|00002060| 20 74 68 61 74 20 74 68 | 65 20 66 6c 61 67 73 20 | that th|e flags |
|00002070| 72 65 71 75 65 73 74 65 | 64 20 61 72 65 20 61 20 |requeste|d are a |
|00002080| 73 75 62 73 65 74 20 6f | 66 20 74 68 65 0a 58 20 |subset o|f the.X |
|00002090| 20 20 20 20 2a 20 66 6c | 61 67 73 20 61 6c 72 65 | * fl|ags alre|
|000020a0| 61 64 79 20 6f 70 65 6e | 2e 20 54 68 61 74 20 69 |ady open|. That i|
|000020b0| 73 20 6d 61 6b 65 20 73 | 75 72 65 20 74 68 61 74 |s make s|ure that|
|000020c0| 20 74 68 65 0a 58 20 20 | 20 20 20 2a 20 69 6e 74 | the.X | * int|
|000020d0| 65 72 73 65 63 74 69 6f | 6e 20 6f 66 20 74 68 65 |ersectio|n of the|
|000020e0| 20 72 65 71 75 65 73 74 | 65 64 20 66 6c 61 67 73 | request|ed flags|
|000020f0| 20 61 6e 64 20 74 68 65 | 20 65 78 69 73 74 69 6e | and the| existin|
|00002100| 67 20 66 6c 61 67 73 0a | 58 20 20 20 20 20 2a 20 |g flags.|X * |
|00002110| 3d 3d 20 74 68 65 20 72 | 65 71 75 65 73 74 65 64 |== the r|equested|
|00002120| 20 66 6c 61 67 73 0a 58 | 20 20 20 20 20 2a 2f 0a | flags.X| */.|
|00002130| 58 20 20 20 20 69 66 20 | 28 28 28 66 70 2d 3e 66 |X if |(((fp->f|
|00002140| 5f 66 6c 61 67 20 26 20 | 28 46 52 45 41 44 7c 46 |_flag & |(FREAD|F|
|00002150| 57 52 49 54 45 29 29 20 | 26 20 66 6c 61 67 29 20 |WRITE)) |& flag) |
|00002160| 21 3d 20 28 66 6c 61 67 | 20 26 20 28 46 52 45 41 |!= (flag| & (FREA|
|00002170| 44 7c 46 57 52 49 54 45 | 29 29 29 0a 58 20 20 20 |D|FWRITE|))).X |
|00002180| 20 7b 0a 58 09 75 2e 75 | 5f 65 72 72 6f 72 20 3d | {.X.u.u|_error =|
|00002190| 20 45 42 41 44 46 3b 0a | 58 09 72 65 74 75 72 6e | EBADF;.|X.return|
|000021a0| 3b 0a 58 20 20 20 20 7d | 0a 58 20 20 20 20 0a 58 |;.X }|.X .X|
|000021b0| 20 20 20 20 2f 2a 20 4e | 65 78 74 2c 20 66 69 6e | /* N|ext, fin|
|000021c0| 64 20 28 61 6e 64 20 75 | 6e 64 6f 29 20 74 68 65 |d (and u|ndo) the|
|000021d0| 20 68 61 6c 66 2d 6f 70 | 65 6e 20 6e 65 77 20 66 | half-op|en new f|
|000021e0| 64 20 2a 2f 0a 58 20 20 | 20 20 69 66 20 28 66 70 |d */.X | if (fp|
|000021f0| 20 3d 20 67 65 74 66 28 | 66 64 29 29 20 0a 58 20 | = getf(|fd)) .X |
|00002200| 20 20 20 7b 0a 58 09 70 | 6c 6f 63 6b 28 66 70 2d | {.X.p|lock(fp-|
|00002210| 3e 66 5f 69 6e 6f 64 65 | 29 3b 0a 58 09 69 70 75 |>f_inode|);.X.ipu|
|00002220| 74 28 66 70 2d 3e 66 5f | 69 6e 6f 64 65 29 3b 0a |t(fp->f_|inode);.|
|00002230| 58 09 69 66 20 28 2d 2d | 66 70 2d 3e 66 5f 63 6f |X.if (--|fp->f_co|
|00002240| 75 6e 74 20 3c 3d 20 30 | 29 0a 58 09 7b 0a 58 09 |unt <= 0|).X.{.X.|
|00002250| 09 66 70 2d 3e 66 5f 69 | 6e 6f 64 65 20 3d 20 4e |.fp->f_i|node = N|
|00002260| 55 4c 4c 3b 0a 58 09 7d | 0a 58 20 20 20 20 7d 0a |ULL;.X.}|.X }.|
|00002270| 58 0a 58 20 20 20 20 2f | 2a 20 46 69 6e 61 6c 6c |X.X /|* Finall|
|00002280| 79 2c 20 64 75 70 20 74 | 68 65 20 65 78 69 73 74 |y, dup t|he exist|
|00002290| 69 6e 67 20 66 64 20 2a | 2f 0a 58 20 20 20 20 2b |ing fd *|/.X +|
|000022a0| 2b 28 75 2e 75 5f 6f 66 | 69 6c 65 5b 66 64 5d 20 |+(u.u_of|ile[fd] |
|000022b0| 3d 20 75 2e 75 5f 6f 66 | 69 6c 65 5b 6d 69 6e 6f |= u.u_of|ile[mino|
|000022c0| 72 28 64 65 76 29 5d 29 | 2d 3e 66 5f 63 6f 75 6e |r(dev)])|->f_coun|
|000022d0| 74 3b 0a 58 7d 0a 45 4e | 44 5f 4f 46 5f 46 49 4c |t;.X}.EN|D_OF_FIL|
|000022e0| 45 0a 69 66 20 74 65 73 | 74 20 32 37 35 30 20 2d |E.if tes|t 2750 -|
|000022f0| 6e 65 20 60 77 63 20 2d | 63 20 3c 27 64 75 70 2e |ne `wc -|c <'dup.|
|00002300| 63 27 60 3b 20 74 68 65 | 6e 0a 20 20 20 20 65 63 |c'`; the|n. ec|
|00002310| 68 6f 20 73 68 61 72 3a | 20 5c 22 27 64 75 70 2e |ho shar:| \"'dup.|
|00002320| 63 27 5c 22 20 75 6e 70 | 61 63 6b 65 64 20 77 69 |c'\" unp|acked wi|
|00002330| 74 68 20 77 72 6f 6e 67 | 20 73 69 7a 65 21 0a 66 |th wrong| size!.f|
|00002340| 69 0a 23 20 65 6e 64 20 | 6f 66 20 27 64 75 70 2e |i.# end |of 'dup.|
|00002350| 63 27 0a 66 69 0a 65 63 | 68 6f 20 73 68 61 72 3a |c'.fi.ec|ho shar:|
|00002360| 20 45 6e 64 20 6f 66 20 | 61 72 63 68 69 76 65 20 | End of |archive |
|00002370| 31 20 5c 28 6f 66 20 31 | 5c 29 2e 0a 63 70 20 2f |1 \(of 1|\)..cp /|
|00002380| 64 65 76 2f 6e 75 6c 6c | 20 61 72 6b 31 69 73 64 |dev/null| ark1isd|
|00002390| 6f 6e 65 0a 4d 49 53 53 | 49 4e 47 3d 22 22 0a 66 |one.MISS|ING="".f|
|000023a0| 6f 72 20 49 20 69 6e 20 | 31 20 3b 20 64 6f 0a 20 |or I in |1 ; do. |
|000023b0| 20 20 20 69 66 20 74 65 | 73 74 20 21 20 2d 66 20 | if te|st ! -f |
|000023c0| 61 72 6b 24 7b 49 7d 69 | 73 64 6f 6e 65 20 3b 20 |ark${I}i|sdone ; |
|000023d0| 74 68 65 6e 0a 09 4d 49 | 53 53 49 4e 47 3d 22 24 |then..MI|SSING="$|
|000023e0| 7b 4d 49 53 53 49 4e 47 | 7d 20 24 7b 49 7d 22 0a |{MISSING|} ${I}".|
|000023f0| 20 20 20 20 66 69 0a 64 | 6f 6e 65 0a 69 66 20 74 | fi.d|one.if t|
|00002400| 65 73 74 20 22 24 7b 4d | 49 53 53 49 4e 47 7d 22 |est "${M|ISSING}"|
|00002410| 20 3d 20 22 22 20 3b 20 | 74 68 65 6e 0a 20 20 20 | = "" ; |then. |
|00002420| 20 65 63 68 6f 20 59 6f | 75 20 68 61 76 65 20 74 | echo Yo|u have t|
|00002430| 68 65 20 61 72 63 68 69 | 76 65 2e 0a 20 20 20 20 |he archi|ve.. |
|00002440| 72 6d 20 2d 66 20 61 72 | 6b 5b 31 2d 39 5d 69 73 |rm -f ar|k[1-9]is|
|00002450| 64 6f 6e 65 0a 65 6c 73 | 65 0a 20 20 20 20 65 63 |done.els|e. ec|
|00002460| 68 6f 20 59 6f 75 20 73 | 74 69 6c 6c 20 6e 65 65 |ho You s|till nee|
|00002470| 64 20 74 6f 20 75 6e 70 | 61 63 6b 20 74 68 65 20 |d to unp|ack the |
|00002480| 66 6f 6c 6c 6f 77 69 6e | 67 20 61 72 63 68 69 76 |followin|g archiv|
|00002490| 65 73 3a 0a 20 20 20 20 | 65 63 68 6f 20 22 20 20 |es:. |echo " |
|000024a0| 20 20 20 20 20 20 22 20 | 24 7b 4d 49 53 53 49 4e | " |${MISSIN|
|000024b0| 47 7d 0a 66 69 0a 23 23 | 20 20 45 6e 64 20 6f 66 |G}.fi.##| End of|
|000024c0| 20 73 68 65 6c 6c 20 61 | 72 63 68 69 76 65 2e 0a | shell a|rchive..|
|000024d0| 65 78 69 74 20 30 0a | |exit 0. | |
+--------+-------------------------+-------------------------+--------+--------+