home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1879 < prev    next >
SHell self-extracting ARchive  |  1990-12-28  |  4.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: 1879

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 72 6f | 67 65 72 73 40 73 75 64 |From: ro|gers@sud|
|00000010| 35 30 39 2e 65 64 2e 72 | 61 79 2e 63 6f 6d 20 28 |509.ed.r|ay.com (|
|00000020| 41 6e 64 72 65 77 20 52 | 6f 67 65 72 73 29 0a 4e |Andrew R|ogers).N|
|00000030| 65 77 73 67 72 6f 75 70 | 73 3a 20 61 6c 74 2e 73 |ewsgroup|s: alt.s|
|00000040| 6f 75 72 63 65 73 0a 53 | 75 62 6a 65 63 74 3a 20 |ources.S|ubject: |
|00000050| 63 64 2c 20 64 69 72 73 | 2c 20 70 6f 70 64 2c 20 |cd, dirs|, popd, |
|00000060| 70 75 73 68 64 2c 20 70 | 77 64 20 66 6f 72 20 56 |pushd, p|wd for V|
|00000070| 4d 53 0a 4d 65 73 73 61 | 67 65 2d 49 44 3a 20 3c |MS.Messa|ge-ID: <|
|00000080| 32 36 30 36 40 73 75 64 | 35 30 39 2e 65 64 2e 72 |2606@sud|509.ed.r|
|00000090| 61 79 2e 63 6f 6d 3e 0a | 44 61 74 65 3a 20 32 38 |ay.com>.|Date: 28|
|000000a0| 20 53 65 70 20 39 30 20 | 31 35 3a 30 35 3a 33 38 | Sep 90 |15:05:38|
|000000b0| 20 47 4d 54 0a 0a 0a 54 | 6f 64 61 79 20 69 73 20 | GMT...T|oday is |
|000000c0| 28 68 6f 70 65 66 75 6c | 6c 79 29 20 74 68 65 20 |(hopeful|ly) the |
|000000d0| 6c 61 73 74 20 64 61 79 | 20 49 20 77 69 6c 6c 20 |last day| I will |
|000000e0| 65 76 65 72 20 68 61 76 | 65 20 74 6f 20 75 73 65 |ever hav|e to use|
|000000f0| 20 61 20 56 4d 53 20 73 | 79 73 74 65 6d 2e 20 20 | a VMS s|ystem. |
|00000100| 41 73 0a 61 20 70 61 72 | 74 69 6e 67 20 67 69 66 |As.a par|ting gif|
|00000110| 74 20 74 6f 20 74 68 6f | 73 65 20 6c 65 73 73 20 |t to tho|se less |
|00000120| 66 6f 72 74 75 6e 61 74 | 65 2c 20 68 65 72 65 20 |fortunat|e, here |
|00000130| 61 72 65 20 6d 79 20 56 | 4d 53 20 69 6d 70 6c 65 |are my V|MS imple|
|00000140| 6d 65 6e 74 61 74 69 6f | 6e 73 20 66 6f 72 0a 74 |mentatio|ns for.t|
|00000150| 68 65 20 63 73 68 20 63 | 6f 6d 6d 61 6e 64 73 20 |he csh c|ommands |
|00000160| 63 64 20 28 63 68 61 6e | 67 65 20 64 69 72 65 63 |cd (chan|ge direc|
|00000170| 74 6f 72 79 29 2c 20 64 | 69 72 73 20 28 70 72 69 |tory), d|irs (pri|
|00000180| 6e 74 20 64 69 72 65 63 | 74 6f 72 79 20 73 74 61 |nt direc|tory sta|
|00000190| 63 6b 29 2c 20 70 6f 70 | 64 0a 28 70 6f 70 20 64 |ck), pop|d.(pop d|
|000001a0| 69 72 65 63 74 6f 72 79 | 20 73 74 61 63 6b 29 2c |irectory| stack),|
|000001b0| 20 70 75 73 68 64 20 28 | 70 75 73 68 20 64 69 72 | pushd (|push dir|
|000001c0| 65 63 74 6f 72 79 20 6f | 6e 74 6f 20 73 74 61 63 |ectory o|nto stac|
|000001d0| 6b 20 61 6e 64 20 27 63 | 64 27 20 74 68 65 72 65 |k and 'c|d' there|
|000001e0| 29 20 61 6e 64 0a 70 77 | 64 20 28 70 72 69 6e 74 |) and.pw|d (print|
|000001f0| 20 77 6f 72 6b 69 6e 67 | 20 64 69 72 65 63 74 6f | working| directo|
|00000200| 72 79 29 2e 20 20 53 6f | 6d 65 20 63 61 6c 6c 20 |ry). So|me call |
|00000210| 6f 74 68 65 72 73 20 62 | 79 20 73 79 6d 62 6f 6c |others b|y symbol|
|00000220| 69 63 20 6e 61 6d 65 2c | 20 73 6f 20 69 74 0a 69 |ic name,| so it.i|
|00000230| 73 20 62 65 73 74 20 74 | 6f 20 64 65 66 69 6e 65 |s best t|o define|
|00000240| 20 61 6c 6c 20 66 69 76 | 65 20 61 73 20 67 6c 6f | all fiv|e as glo|
|00000250| 62 61 6c 20 73 79 6d 62 | 6f 6c 73 2e 20 20 41 6c |bal symb|ols. Al|
|00000260| 73 6f 2c 20 74 68 65 20 | 6d 61 67 69 63 20 74 6f |so, the |magic to|
|00000270| 20 68 69 67 68 6c 69 67 | 68 74 0a 74 68 65 20 63 | highlig|ht.the c|
|00000280| 75 72 72 65 6e 74 20 64 | 69 72 65 63 74 6f 72 79 |urrent d|irectory|
|00000290| 20 69 73 20 68 69 67 68 | 6c 79 20 56 54 2d 58 58 | is high|ly VT-XX|
|000002a0| 58 20 73 70 65 63 69 66 | 69 63 20 61 6e 64 20 6d |X specif|ic and m|
|000002b0| 61 79 20 6e 6f 74 20 77 | 6f 72 6b 20 77 69 74 68 |ay not w|ork with|
|000002c0| 20 6f 74 68 65 72 0a 74 | 65 72 6d 69 6e 61 6c 73 | other.t|erminals|
|000002d0| 2e 0a 0a 41 6e 64 72 65 | 77 0a 0a 2d 2d 2d 2d 2d |...Andre|w..-----|
|000002e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000002f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 20 63 75 74 20 |--------|--- cut |
|00000300| 68 65 72 65 20 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |here ---|--------|
|00000310| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000320| 2d 2d 2d 2d 2d 0a 23 21 | 20 2f 62 69 6e 2f 73 68 |-----.#!| /bin/sh|
|00000330| 0a 23 20 54 68 69 73 20 | 69 73 20 61 20 73 68 65 |.# This |is a she|
|00000340| 6c 6c 20 61 72 63 68 69 | 76 65 2c 20 6d 65 61 6e |ll archi|ve, mean|
|00000350| 69 6e 67 3a 0a 23 20 31 | 2e 20 52 65 6d 6f 76 65 |ing:.# 1|. Remove|
|00000360| 20 65 76 65 72 79 74 68 | 69 6e 67 20 61 62 6f 76 | everyth|ing abov|
|00000370| 65 20 74 68 65 20 23 21 | 20 2f 62 69 6e 2f 73 68 |e the #!| /bin/sh|
|00000380| 20 6c 69 6e 65 2e 0a 23 | 20 32 2e 20 53 61 76 65 | line..#| 2. Save|
|00000390| 20 74 68 65 20 72 65 73 | 75 6c 74 69 6e 67 20 74 | the res|ulting t|
|000003a0| 65 78 74 20 69 6e 20 61 | 20 66 69 6c 65 2e 0a 23 |ext in a| file..#|
|000003b0| 20 33 2e 20 45 78 65 63 | 75 74 65 20 74 68 65 20 | 3. Exec|ute the |
|000003c0| 66 69 6c 65 20 77 69 74 | 68 20 2f 62 69 6e 2f 73 |file wit|h /bin/s|
|000003d0| 68 20 28 6e 6f 74 20 63 | 73 68 29 20 74 6f 20 63 |h (not c|sh) to c|
|000003e0| 72 65 61 74 65 3a 0a 23 | 09 20 63 64 2e 63 6f 6d |reate:.#|. cd.com|
|000003f0| 0a 23 09 20 64 69 72 73 | 2e 63 6f 6d 0a 23 09 20 |.#. dirs|.com.#. |
|00000400| 70 6f 70 64 2e 63 6f 6d | 0a 23 09 20 70 75 73 68 |popd.com|.#. push|
|00000410| 64 2e 63 6f 6d 0a 23 09 | 20 70 77 64 2e 63 6f 6d |d.com.#.| pwd.com|
|00000420| 0a 23 20 54 68 69 73 20 | 61 72 63 68 69 76 65 20 |.# This |archive |
|00000430| 63 72 65 61 74 65 64 3a | 20 46 72 69 20 53 65 70 |created:| Fri Sep|
|00000440| 20 32 38 20 31 31 3a 30 | 30 3a 33 30 20 45 44 54 | 28 11:0|0:30 EDT|
|00000450| 20 31 39 39 30 0a 65 78 | 70 6f 72 74 20 50 41 54 | 1990.ex|port PAT|
|00000460| 48 3b 20 50 41 54 48 3d | 2f 62 69 6e 3a 2f 75 73 |H; PATH=|/bin:/us|
|00000470| 72 2f 62 69 6e 3a 24 50 | 41 54 48 0a 69 66 20 74 |r/bin:$P|ATH.if t|
|00000480| 65 73 74 20 2d 66 20 27 | 63 64 2e 63 6f 6d 27 0a |est -f '|cd.com'.|
|00000490| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|000004a0| 20 77 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | will no|t over-w|
|000004b0| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|000004c0| 6c 65 20 27 63 64 2e 63 | 6f 6d 27 0a 65 6c 73 65 |le 'cd.c|om'.else|
|000004d0| 0a 63 61 74 20 3c 3c 20 | 5c 53 48 41 52 5f 45 4f |.cat << |\SHAR_EO|
|000004e0| 46 20 3e 20 27 63 64 2e | 63 6f 6d 27 0a 24 21 20 |F > 'cd.|com'.$! |
|000004f0| 63 64 2e 63 6f 6d 20 2d | 20 73 69 6d 75 6c 61 74 |cd.com -| simulat|
|00000500| 65 20 55 6e 2a 78 20 27 | 63 64 27 20 63 6f 6d 6d |e Un*x '|cd' comm|
|00000510| 61 6e 64 0a 24 0a 24 20 | 69 66 20 70 31 20 2e 65 |and.$.$ |if p1 .e|
|00000520| 71 73 2e 20 22 22 20 74 | 68 65 6e 20 70 31 20 3d |qs. "" t|hen p1 =|
|00000530| 20 66 24 6c 6f 67 69 63 | 61 6c 28 22 73 79 73 24 | f$logic|al("sys$|
|00000540| 6c 6f 67 69 6e 22 29 0a | 24 0a 24 21 20 74 72 61 |login").|$.$! tra|
|00000550| 6e 73 6c 61 74 65 20 64 | 69 73 6b 3a 5b 64 69 72 |nslate d|isk:[dir|
|00000560| 31 2e 64 69 72 32 2e 64 | 69 72 4e 5d 20 74 6f 20 |1.dir2.d|irN] to |
|00000570| 64 69 73 6b 3a 5b 64 69 | 72 31 2e 64 69 72 32 2e |disk:[di|r1.dir2.|
|00000580| 2d 5d 64 69 72 4e 2e 64 | 69 72 0a 24 0a 24 20 64 |-]dirN.d|ir.$.$ d|
|00000590| 69 72 20 3d 20 66 24 70 | 61 72 73 65 28 70 31 2c |ir = f$p|arse(p1,|
|000005a0| 2c 2c 22 44 49 52 45 43 | 54 4f 52 59 22 29 20 2d |,,"DIREC|TORY") -|
|000005b0| 20 22 5b 22 20 2d 20 22 | 5d 22 0a 24 6c 31 3a 0a | "[" - "|]".$l1:.|
|000005c0| 24 20 20 6e 20 3d 20 66 | 24 6c 6f 63 61 74 65 28 |$ n = f|$locate(|
|000005d0| 22 2e 22 2c 20 64 69 72 | 29 0a 24 20 20 69 66 20 |".", dir|).$ if |
|000005e0| 6e 20 2e 67 65 2e 20 66 | 24 6c 65 6e 67 74 68 28 |n .ge. f|$length(|
|000005f0| 64 69 72 29 20 74 68 65 | 6e 20 67 6f 74 6f 20 6c |dir) the|n goto l|
|00000600| 32 0a 24 20 20 64 69 72 | 20 3d 20 66 24 65 78 74 |2.$ dir| = f$ext|
|00000610| 72 61 63 74 28 6e 20 2b | 20 31 2c 20 39 39 39 2c |ract(n +| 1, 999,|
|00000620| 20 64 69 72 29 0a 24 20 | 20 67 6f 74 6f 20 6c 31 | dir).$ | goto l1|
|00000630| 0a 24 6c 32 3a 0a 24 20 | 64 69 72 20 3d 20 70 31 |.$l2:.$ |dir = p1|
|00000640| 20 2d 20 22 5d 22 20 2b | 20 22 2e 2d 5d 22 20 2b | - "]" +| ".-]" +|
|00000650| 20 64 69 72 20 2b 20 22 | 2e 64 69 72 22 0a 24 0a | dir + "|.dir".$.|
|00000660| 24 20 69 66 20 66 24 73 | 65 61 72 63 68 28 64 69 |$ if f$s|earch(di|
|00000670| 72 29 20 2e 6e 65 73 2e | 20 22 22 20 74 68 65 6e |r) .nes.| "" then|
|00000680| 20 67 6f 74 6f 20 4f 4b | 09 09 21 20 6c 6f 6f 6b | goto OK|..! look|
|00000690| 20 66 6f 72 20 64 69 72 | 65 63 74 6f 72 79 0a 24 | for dir|ectory.$|
|000006a0| 20 69 66 20 66 24 74 72 | 6e 6c 6f 67 28 70 31 20 | if f$tr|nlog(p1 |
|000006b0| 2d 20 22 3a 22 29 20 2e | 6e 65 73 2e 20 22 22 20 |- ":") .|nes. "" |
|000006c0| 74 68 65 6e 20 67 6f 74 | 6f 20 4f 4b 09 09 21 20 |then got|o OK..! |
|000006d0| 74 72 79 20 6c 6f 67 69 | 63 61 6c 20 6e 61 6d 65 |try logi|cal name|
|000006e0| 0a 24 20 20 77 72 69 74 | 65 20 73 79 73 24 6f 75 |.$ writ|e sys$ou|
|000006f0| 74 70 75 74 20 22 44 69 | 72 65 63 74 6f 72 79 20 |tput "Di|rectory |
|00000700| 22 2c 20 70 31 2c 20 22 | 20 64 6f 65 73 20 6e 6f |", p1, "| does no|
|00000710| 74 20 65 78 69 73 74 22 | 0a 24 20 20 65 78 69 74 |t exist"|.$ exit|
|00000720| 0a 24 0a 24 4f 4b 3a 0a | 24 20 73 65 74 20 64 65 |.$.$OK:.|$ set de|
|00000730| 66 20 27 70 31 0a 24 20 | 69 66 20 66 24 74 79 70 |f 'p1.$ |if f$typ|
|00000740| 65 28 70 77 64 29 20 2e | 65 71 73 2e 20 22 22 20 |e(pwd) .|eqs. "" |
|00000750| 74 68 65 6e 20 70 77 64 | 20 3a 3d 3d 20 73 68 6f |then pwd| :== sho|
|00000760| 77 20 64 65 66 61 75 6c | 74 0a 24 20 70 77 64 0a |w defaul|t.$ pwd.|
|00000770| 53 48 41 52 5f 45 4f 46 | 0a 66 69 0a 69 66 20 74 |SHAR_EOF|.fi.if t|
|00000780| 65 73 74 20 2d 66 20 27 | 64 69 72 73 2e 63 6f 6d |est -f '|dirs.com|
|00000790| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|000007a0| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|000007b0| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|000007c0| 66 69 6c 65 20 27 64 69 | 72 73 2e 63 6f 6d 27 0a |file 'di|rs.com'.|
|000007d0| 65 6c 73 65 0a 63 61 74 | 20 3c 3c 20 5c 53 48 41 |else.cat| << \SHA|
|000007e0| 52 5f 45 4f 46 20 3e 20 | 27 64 69 72 73 2e 63 6f |R_EOF > |'dirs.co|
|000007f0| 6d 27 0a 24 21 20 64 69 | 72 73 2e 63 6f 6d 20 2d |m'.$! di|rs.com -|
|00000800| 20 70 72 69 6e 74 20 64 | 69 72 65 63 74 6f 72 79 | print d|irectory|
|00000810| 20 73 74 61 63 6b 20 28 | 63 75 72 72 65 6e 74 20 | stack (|current |
|00000820| 64 69 72 65 63 74 6f 72 | 79 20 62 6f 6c 64 29 0a |director|y bold).|
|00000830| 24 0a 24 20 69 66 20 66 | 24 74 79 70 65 28 64 69 |$.$ if f|$type(di|
|00000840| 72 5f 73 74 61 63 6b 29 | 20 2e 65 71 73 2e 20 22 |r_stack)| .eqs. "|
|00000850| 22 20 74 68 65 6e 20 64 | 69 72 5f 73 74 61 63 6b |" then d|ir_stack|
|00000860| 20 3a 3d 3d 20 22 22 0a | 24 20 65 73 63 5b 30 2c | :== "".|$ esc[0,|
|00000870| 38 5d 20 3d 20 25 44 32 | 37 0a 24 20 77 72 69 74 |8] = %D2|7.$ writ|
|00000880| 65 20 73 79 73 24 6f 75 | 74 70 75 74 20 65 73 63 |e sys$ou|tput esc|
|00000890| 2c 22 5b 31 6d 22 2c 66 | 24 65 6e 76 69 72 6f 6e |,"[1m",f|$environ|
|000008a0| 6d 65 6e 74 28 22 64 65 | 66 61 75 6c 74 22 29 2c |ment("de|fault"),|
|000008b0| 65 73 63 2c 22 5b 32 32 | 6d 20 22 2c 64 69 72 5f |esc,"[22|m ",dir_|
|000008c0| 73 74 61 63 6b 0a 53 48 | 41 52 5f 45 4f 46 0a 66 |stack.SH|AR_EOF.f|
|000008d0| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 70 6f |i.if tes|t -f 'po|
|000008e0| 70 64 2e 63 6f 6d 27 0a | 74 68 65 6e 0a 09 65 63 |pd.com'.|then..ec|
|000008f0| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|00000900| 74 20 6f 76 65 72 2d 77 | 72 69 74 65 20 65 78 69 |t over-w|rite exi|
|00000910| 73 74 69 6e 67 20 66 69 | 6c 65 20 27 70 6f 70 64 |sting fi|le 'popd|
|00000920| 2e 63 6f 6d 27 0a 65 6c | 73 65 0a 63 61 74 20 3c |.com'.el|se.cat <|
|00000930| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 70 |< \SHAR_|EOF > 'p|
|00000940| 6f 70 64 2e 63 6f 6d 27 | 0a 24 21 20 70 6f 70 64 |opd.com'|.$! popd|
|00000950| 2e 63 6f 6d 20 2d 20 70 | 6f 70 20 6f 6e 65 20 6f |.com - p|op one o|
|00000960| 72 20 6d 6f 72 65 20 64 | 69 72 65 63 74 6f 72 69 |r more d|irectori|
|00000970| 65 73 20 66 72 6f 6d 20 | 73 74 61 63 6b 0a 24 0a |es from |stack.$.|
|00000980| 24 20 69 66 20 66 24 74 | 79 70 65 28 64 69 72 5f |$ if f$t|ype(dir_|
|00000990| 73 74 61 63 6b 29 20 2e | 65 71 73 2e 20 22 22 20 |stack) .|eqs. "" |
|000009a0| 74 68 65 6e 20 64 69 72 | 5f 73 74 61 63 6b 20 3a |then dir|_stack :|
|000009b0| 3d 3d 20 22 22 0a 24 20 | 69 66 20 66 24 74 79 70 |== "".$ |if f$typ|
|000009c0| 65 28 70 31 29 20 2e 6e | 65 73 2e 20 22 49 4e 54 |e(p1) .n|es. "INT|
|000009d0| 45 47 45 52 22 20 74 68 | 65 6e 20 70 31 20 3d 20 |EGER" th|en p1 = |
|000009e0| 31 09 21 20 64 65 66 61 | 75 6c 74 20 23 20 74 6f |1.! defa|ult # to|
|000009f0| 20 70 6f 70 3a 20 31 0a | 24 20 69 66 20 70 31 20 | pop: 1.|$ if p1 |
|00000a00| 2e 6c 74 2e 20 30 20 74 | 68 65 6e 20 70 31 20 3d |.lt. 0 t|hen p1 =|
|00000a10| 20 2d 20 70 31 0a 24 20 | 69 66 20 64 69 72 5f 73 | - p1.$ |if dir_s|
|00000a20| 74 61 63 6b 20 2e 6e 65 | 73 2e 20 22 22 20 74 68 |tack .ne|s. "" th|
|00000a30| 65 6e 20 67 6f 74 6f 20 | 6c 6f 6f 70 0a 24 20 20 |en goto |loop.$ |
|00000a40| 20 77 72 69 74 65 20 73 | 79 73 24 6f 75 74 70 75 | write s|ys$outpu|
|00000a50| 74 20 22 44 69 72 65 63 | 74 6f 72 79 20 73 74 61 |t "Direc|tory sta|
|00000a60| 63 6b 20 65 6d 70 74 79 | 22 0a 24 20 20 20 65 78 |ck empty|".$ ex|
|00000a70| 69 74 0a 24 6c 6f 6f 70 | 3a 0a 24 20 20 20 6e 65 |it.$loop|:.$ ne|
|00000a80| 77 64 69 72 20 3d 20 66 | 24 65 6c 65 6d 65 6e 74 |wdir = f|$element|
|00000a90| 28 30 2c 22 20 22 2c 64 | 69 72 5f 73 74 61 63 6b |(0," ",d|ir_stack|
|00000aa0| 29 0a 24 20 20 20 64 69 | 72 5f 73 74 61 63 6b 20 |).$ di|r_stack |
|00000ab0| 3d 3d 20 64 69 72 5f 73 | 74 61 63 6b 20 2d 20 6e |== dir_s|tack - n|
|00000ac0| 65 77 64 69 72 20 2d 20 | 22 20 22 0a 24 20 20 20 |ewdir - |" ".$ |
|00000ad0| 70 31 20 3d 20 70 31 20 | 2d 20 31 0a 24 20 20 20 |p1 = p1 |- 1.$ |
|00000ae0| 69 66 20 70 31 20 2e 67 | 74 2e 20 30 20 2e 61 6e |if p1 .g|t. 0 .an|
|00000af0| 64 2e 20 64 69 72 5f 73 | 74 61 63 6b 20 2e 6e 65 |d. dir_s|tack .ne|
|00000b00| 73 2e 20 22 22 20 74 68 | 65 6e 20 67 6f 74 6f 20 |s. "" th|en goto |
|00000b10| 6c 6f 6f 70 0a 24 20 73 | 65 74 20 64 65 66 20 27 |loop.$ s|et def '|
|00000b20| 6e 65 77 64 69 72 0a 24 | 20 69 66 20 66 24 74 79 |newdir.$| if f$ty|
|00000b30| 70 65 28 64 69 72 73 29 | 20 2e 65 71 73 2e 20 22 |pe(dirs)| .eqs. "|
|00000b40| 22 20 74 68 65 6e 20 64 | 69 72 73 20 3a 3d 3d 20 |" then d|irs :== |
|00000b50| 73 68 6f 77 20 64 65 66 | 61 75 6c 74 0a 24 20 64 |show def|ault.$ d|
|00000b60| 69 72 73 0a 53 48 41 52 | 5f 45 4f 46 0a 66 69 0a |irs.SHAR|_EOF.fi.|
|00000b70| 69 66 20 74 65 73 74 20 | 2d 66 20 27 70 75 73 68 |if test |-f 'push|
|00000b80| 64 2e 63 6f 6d 27 0a 74 | 68 65 6e 0a 09 65 63 68 |d.com'.t|hen..ech|
|00000b90| 6f 20 73 68 61 72 3a 20 | 77 69 6c 6c 20 6e 6f 74 |o shar: |will not|
|00000ba0| 20 6f 76 65 72 2d 77 72 | 69 74 65 20 65 78 69 73 | over-wr|ite exis|
|00000bb0| 74 69 6e 67 20 66 69 6c | 65 20 27 70 75 73 68 64 |ting fil|e 'pushd|
|00000bc0| 2e 63 6f 6d 27 0a 65 6c | 73 65 0a 63 61 74 20 3c |.com'.el|se.cat <|
|00000bd0| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 70 |< \SHAR_|EOF > 'p|
|00000be0| 75 73 68 64 2e 63 6f 6d | 27 0a 24 21 20 70 75 73 |ushd.com|'.$! pus|
|00000bf0| 68 64 2e 63 6f 6d 20 2d | 20 70 75 73 68 20 64 69 |hd.com -| push di|
|00000c00| 72 65 63 74 6f 72 79 20 | 6f 6e 74 6f 20 73 74 61 |rectory |onto sta|
|00000c10| 63 6b 0a 24 0a 24 20 69 | 66 20 66 24 74 79 70 65 |ck.$.$ i|f f$type|
|00000c20| 28 64 69 72 5f 73 74 61 | 63 6b 29 20 2e 65 71 73 |(dir_sta|ck) .eqs|
|00000c30| 2e 20 22 22 20 74 68 65 | 6e 20 64 69 72 5f 73 74 |. "" the|n dir_st|
|00000c40| 61 63 6b 20 3a 3d 3d 20 | 22 22 0a 24 20 69 66 20 |ack :== |"".$ if |
|00000c50| 70 31 20 2e 65 71 73 2e | 20 22 22 20 74 68 65 6e |p1 .eqs.| "" then|
|00000c60| 20 70 31 20 3d 20 66 24 | 6c 6f 67 69 63 61 6c 28 | p1 = f$|logical(|
|00000c70| 22 73 79 73 24 6c 6f 67 | 69 6e 22 29 0a 24 0a 24 |"sys$log|in").$.$|
|00000c80| 21 20 63 68 65 63 6b 20 | 74 68 61 74 20 6e 65 77 |! check |that new|
|00000c90| 20 64 69 72 65 63 74 6f | 72 79 20 65 78 69 73 74 | directo|ry exist|
|00000ca0| 73 20 28 64 65 72 69 76 | 65 64 20 66 72 6f 6d 20 |s (deriv|ed from |
|00000cb0| 63 64 2e 63 6f 6d 29 0a | 24 0a 24 20 64 69 72 20 |cd.com).|$.$ dir |
|00000cc0| 3d 20 66 24 70 61 72 73 | 65 28 70 31 2c 2c 2c 22 |= f$pars|e(p1,,,"|
|00000cd0| 44 49 52 45 43 54 4f 52 | 59 22 29 20 2d 20 22 5b |DIRECTOR|Y") - "[|
|00000ce0| 22 20 2d 20 22 5d 22 0a | 24 6c 31 3a 0a 24 20 20 |" - "]".|$l1:.$ |
|00000cf0| 6e 20 3d 20 66 24 6c 6f | 63 61 74 65 28 22 2e 22 |n = f$lo|cate("."|
|00000d00| 2c 20 64 69 72 29 0a 24 | 20 20 69 66 20 6e 20 2e |, dir).$| if n .|
|00000d10| 67 65 2e 20 66 24 6c 65 | 6e 67 74 68 28 64 69 72 |ge. f$le|ngth(dir|
|00000d20| 29 20 74 68 65 6e 20 67 | 6f 74 6f 20 6c 32 0a 24 |) then g|oto l2.$|
|00000d30| 20 20 64 69 72 20 3d 20 | 66 24 65 78 74 72 61 63 | dir = |f$extrac|
|00000d40| 74 28 6e 20 2b 20 31 2c | 20 39 39 39 2c 20 64 69 |t(n + 1,| 999, di|
|00000d50| 72 29 0a 24 20 20 67 6f | 74 6f 20 6c 31 0a 24 6c |r).$ go|to l1.$l|
|00000d60| 32 3a 0a 24 20 64 69 72 | 20 3d 20 70 31 20 2d 20 |2:.$ dir| = p1 - |
|00000d70| 22 5d 22 20 2b 20 22 2e | 2d 5d 22 20 2b 20 64 69 |"]" + ".|-]" + di|
|00000d80| 72 20 2b 20 22 2e 64 69 | 72 22 0a 24 0a 24 20 69 |r + ".di|r".$.$ i|
|00000d90| 66 20 66 24 73 65 61 72 | 63 68 28 64 69 72 29 20 |f f$sear|ch(dir) |
|00000da0| 2e 6e 65 73 2e 20 22 22 | 20 74 68 65 6e 20 67 6f |.nes. ""| then go|
|00000db0| 74 6f 20 4f 4b 09 09 21 | 20 6c 6f 6f 6b 20 66 6f |to OK..!| look fo|
|00000dc0| 72 20 64 69 72 65 63 74 | 6f 72 79 0a 24 20 69 66 |r direct|ory.$ if|
|00000dd0| 20 66 24 74 72 6e 6c 6f | 67 28 70 31 20 2d 20 22 | f$trnlo|g(p1 - "|
|00000de0| 3a 22 29 20 2e 6e 65 73 | 2e 20 22 22 20 74 68 65 |:") .nes|. "" the|
|00000df0| 6e 20 67 6f 74 6f 20 4f | 4b 09 09 21 20 74 72 79 |n goto O|K..! try|
|00000e00| 20 6c 6f 67 69 63 61 6c | 20 6e 61 6d 65 0a 24 20 | logical| name.$ |
|00000e10| 20 77 72 69 74 65 20 73 | 79 73 24 6f 75 74 70 75 | write s|ys$outpu|
|00000e20| 74 20 22 44 69 72 65 63 | 74 6f 72 79 20 22 2c 20 |t "Direc|tory ", |
|00000e30| 70 31 2c 20 22 20 64 6f | 65 73 20 6e 6f 74 20 65 |p1, " do|es not e|
|00000e40| 78 69 73 74 22 0a 24 20 | 20 65 78 69 74 0a 24 4f |xist".$ | exit.$O|
|00000e50| 4b 3a 0a 24 0a 24 20 68 | 65 72 65 20 3d 20 66 24 |K:.$.$ h|ere = f$|
|00000e60| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 28 22 64 65 66 |environm|ent("def|
|00000e70| 61 75 6c 74 22 29 09 09 | 21 20 70 75 73 68 20 64 |ault")..|! push d|
|00000e80| 69 72 65 63 74 6f 72 79 | 20 6f 6e 20 73 74 61 63 |irectory| on stac|
|00000e90| 6b 0a 24 20 64 69 72 5f | 73 74 61 63 6b 20 3d 3d |k.$ dir_|stack ==|
|00000ea0| 20 68 65 72 65 20 2b 20 | 22 20 22 20 2b 20 64 69 | here + |" " + di|
|00000eb0| 72 5f 73 74 61 63 6b 0a | 24 20 73 65 74 20 64 65 |r_stack.|$ set de|
|00000ec0| 66 20 27 70 31 09 09 09 | 09 09 21 20 63 68 61 6e |f 'p1...|..! chan|
|00000ed0| 67 65 20 74 6f 20 64 69 | 72 65 63 74 6f 72 79 0a |ge to di|rectory.|
|00000ee0| 24 20 69 66 20 66 24 74 | 79 70 65 28 64 69 72 73 |$ if f$t|ype(dirs|
|00000ef0| 29 20 2e 65 71 73 2e 20 | 22 22 20 74 68 65 6e 20 |) .eqs. |"" then |
|00000f00| 64 69 72 73 20 3a 3d 3d | 20 73 68 6f 77 20 64 65 |dirs :==| show de|
|00000f10| 66 61 75 6c 74 0a 24 20 | 64 69 72 73 0a 53 48 41 |fault.$ |dirs.SHA|
|00000f20| 52 5f 45 4f 46 0a 66 69 | 0a 69 66 20 74 65 73 74 |R_EOF.fi|.if test|
|00000f30| 20 2d 66 20 27 70 77 64 | 2e 63 6f 6d 27 0a 74 68 | -f 'pwd|.com'.th|
|00000f40| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 77 |en..echo| shar: w|
|00000f50| 69 6c 6c 20 6e 6f 74 20 | 6f 76 65 72 2d 77 72 69 |ill not |over-wri|
|00000f60| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00000f70| 20 27 70 77 64 2e 63 6f | 6d 27 0a 65 6c 73 65 0a | 'pwd.co|m'.else.|
|00000f80| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|00000f90| 20 3e 20 27 70 77 64 2e | 63 6f 6d 27 0a 24 21 20 | > 'pwd.|com'.$! |
|00000fa0| 70 77 64 2e 63 6f 6d 20 | 2d 20 70 72 69 6e 74 20 |pwd.com |- print |
|00000fb0| 63 75 72 72 65 6e 74 20 | 64 69 72 65 63 74 6f 72 |current |director|
|00000fc0| 79 20 28 62 6f 6c 64 29 | 0a 24 0a 24 20 65 73 63 |y (bold)|.$.$ esc|
|00000fd0| 5b 30 2c 38 5d 20 3d 20 | 25 44 32 37 0a 24 20 77 |[0,8] = |%D27.$ w|
|00000fe0| 72 69 74 65 20 73 79 73 | 24 6f 75 74 70 75 74 20 |rite sys|$output |
|00000ff0| 65 73 63 2c 22 5b 31 6d | 22 2c 66 24 65 6e 76 69 |esc,"[1m|",f$envi|
|00001000| 72 6f 6e 6d 65 6e 74 28 | 22 64 65 66 61 75 6c 74 |ronment(|"default|
|00001010| 22 29 2c 65 73 63 2c 22 | 5b 32 32 6d 22 0a 53 48 |"),esc,"|[22m".SH|
|00001020| 41 52 5f 45 4f 46 0a 66 | 69 0a 65 78 69 74 20 30 |AR_EOF.f|i.exit 0|
|00001030| 0a 23 09 45 6e 64 20 6f | 66 20 73 68 65 6c 6c 20 |.#.End o|f shell |
|00001040| 61 72 63 68 69 76 65 0a | |archive.| |
+--------+-------------------------+-------------------------+--------+--------+