home *** CD-ROM | disk | FTP | other *** search
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: newgetty
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| makefile script text
| default
| |
99%
| file
| C source, 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)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 53 75 62 6a 65 63 74 3a | 20 20 76 31 35 69 30 32 |Subject:| v15i02|
|00000010| 36 3a 20 20 41 6c 74 65 | 72 6e 61 74 65 20 67 65 |6: Alte|rnate ge|
|00000020| 74 74 79 20 66 72 6f 6e | 74 2d 65 6e 64 2c 20 77 |tty fron|t-end, w|
|00000030| 69 74 68 20 73 70 65 65 | 64 20 64 65 74 65 63 74 |ith spee|d detect|
|00000040| 69 6f 6e 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |ion.News|groups: |
|00000050| 63 6f 6d 70 2e 73 6f 75 | 72 63 65 73 2e 75 6e 69 |comp.sou|rces.uni|
|00000060| 78 0a 53 65 6e 64 65 72 | 3a 20 73 6f 75 72 63 65 |x.Sender|: source|
|00000070| 73 0a 41 70 70 72 6f 76 | 65 64 3a 20 72 73 61 6c |s.Approv|ed: rsal|
|00000080| 7a 40 75 75 6e 65 74 2e | 55 55 2e 4e 45 54 0a 0a |z@uunet.|UU.NET..|
|00000090| 53 75 62 6d 69 74 74 65 | 64 2d 62 79 3a 20 6d 69 |Submitte|d-by: mi|
|000000a0| 63 68 61 65 6c 40 73 74 | 62 2e 55 55 43 50 20 28 |chael@st|b.UUCP (|
|000000b0| 4d 69 63 68 61 65 6c 20 | 47 65 72 73 74 65 6e 29 |Michael |Gersten)|
|000000c0| 0a 50 6f 73 74 69 6e 67 | 2d 6e 75 6d 62 65 72 3a |.Posting|-number:|
|000000d0| 20 56 6f 6c 75 6d 65 20 | 31 35 2c 20 49 73 73 75 | Volume |15, Issu|
|000000e0| 65 20 32 36 0a 41 72 63 | 68 69 76 65 2d 6e 61 6d |e 26.Arc|hive-nam|
|000000f0| 65 3a 20 6e 65 77 67 65 | 74 74 79 0a 0a 5b 20 20 |e: newge|tty..[ |
|00000100| 54 68 69 73 20 70 6c 61 | 79 73 20 61 72 6f 75 6e |This pla|ys aroun|
|00000110| 64 20 77 69 74 68 20 74 | 68 65 20 69 6e 73 69 64 |d with t|he insid|
|00000120| 65 20 6f 66 20 74 68 65 | 20 46 49 4c 45 20 73 74 |e of the| FILE st|
|00000130| 72 75 63 74 75 72 65 2e | 0a 20 20 20 49 20 77 72 |ructure.|. I wr|
|00000140| 6f 74 65 20 74 68 65 20 | 4d 61 6b 65 66 69 6c 65 |ote the |Makefile|
|00000150| 20 61 6e 64 20 65 64 69 | 74 65 64 20 4d 69 63 68 | and edi|ted Mich|
|00000160| 61 65 6c 27 73 20 6d 61 | 6e 75 61 6c 20 70 61 67 |ael's ma|nual pag|
|00000170| 65 2e 20 20 2d 72 24 20 | 20 5d 0a 0a 54 68 69 73 |e. -r$ | ]..This|
|00000180| 20 69 73 20 61 6e 20 61 | 6c 74 65 72 6e 61 74 69 | is an a|lternati|
|00000190| 76 65 20 66 72 6f 6e 74 | 20 65 6e 64 20 74 6f 20 |ve front| end to |
|000001a0| 67 65 74 74 79 2e 20 49 | 74 20 64 6f 65 73 20 6e |getty. I|t does n|
|000001b0| 6f 74 20 72 65 70 6c 61 | 63 65 20 67 65 74 74 79 |ot repla|ce getty|
|000001c0| 3b 0a 69 74 20 77 69 6c | 6c 20 63 61 6c 6c 20 67 |;.it wil|l call g|
|000001d0| 65 74 74 79 20 69 66 20 | 6e 65 65 64 65 64 20 28 |etty if |needed (|
|000001e0| 61 73 73 75 6d 65 64 20 | 74 6f 20 62 65 20 70 6c |assumed |to be pl|
|000001f0| 61 63 65 64 20 69 6e 20 | 2f 65 74 63 2f 6c 69 62 |aced in |/etc/lib|
|00000200| 2f 67 65 74 74 79 29 2e | 0a 0a 49 74 20 64 6f 65 |/getty).|..It doe|
|00000210| 73 20 68 61 76 65 20 74 | 68 65 20 66 6f 6c 6c 6f |s have t|he follo|
|00000220| 77 69 6e 67 20 66 65 61 | 74 75 72 65 73 3a 0a 31 |wing fea|tures:.1|
|00000230| 2e 20 41 75 74 6f 6d 61 | 74 69 63 20 72 65 63 6f |. Automa|tic reco|
|00000240| 67 6e 69 74 69 6f 6e 20 | 6f 66 20 33 30 30 2f 31 |gnition |of 300/1|
|00000250| 32 30 30 2f 32 34 30 30 | 2f 39 36 30 30 20 62 61 |200/2400|/9600 ba|
|00000260| 75 64 0a 32 2e 20 54 68 | 65 20 61 62 69 6c 69 74 |ud.2. Th|e abilit|
|00000270| 79 20 74 6f 20 72 75 6e | 20 61 6e 79 20 70 72 6f |y to run| any pro|
|00000280| 67 72 61 6d 20 6f 72 20 | 73 68 65 6c 6c 20 73 63 |gram or |shell sc|
|00000290| 72 69 70 74 2c 20 6e 6f | 74 20 6a 75 73 74 20 2f |ript, no|t just /|
|000002a0| 65 74 63 2f 6c 6f 67 69 | 6e 2e 0a 33 2e 20 56 61 |etc/logi|n..3. Va|
|000002b0| 72 69 61 62 6c 65 20 70 | 72 6f 6d 70 74 69 6e 67 |riable p|rompting|
|000002c0| 2e 0a 0a 48 65 72 65 20 | 49 20 68 61 76 65 20 61 |...Here |I have a|
|000002d0| 20 70 75 62 6c 69 63 20 | 61 63 63 65 73 73 20 42 | public |access B|
|000002e0| 42 53 20 6f 6e 20 74 68 | 65 20 73 61 6d 65 20 6c |BS on th|e same l|
|000002f0| 69 6e 65 2e 20 4d 6f 73 | 74 20 6f 66 20 6d 79 20 |ine. Mos|t of my |
|00000300| 75 73 65 72 73 20 77 6f | 75 6c 64 6e 27 74 0a 6b |users wo|uldn't.k|
|00000310| 6e 6f 77 20 77 68 61 74 | 20 74 6f 20 64 6f 20 69 |now what| to do i|
|00000320| 66 20 74 6f 6c 64 20 22 | 4c 6f 67 69 6e 3a 22 20 |f told "|Login:" |
|00000330| 28 65 76 65 6e 20 74 68 | 6f 75 67 68 20 62 62 73 |(even th|ough bbs|
|00000340| 2c 20 68 65 6c 70 2c 20 | 61 6e 64 20 22 3f 22 20 |, help, |and "?" |
|00000350| 61 6c 6c 20 77 6f 72 6b | 29 2e 0a 0a 49 66 20 61 |all work|)...If a|
|00000360| 6e 20 75 70 70 65 72 20 | 63 61 73 65 20 6c 65 74 |n upper |case let|
|00000370| 74 65 72 20 69 73 20 67 | 69 76 65 6e 2c 20 74 68 |ter is g|iven, th|
|00000380| 69 73 20 70 72 6f 67 72 | 61 6d 20 73 65 74 73 20 |is progr|am sets |
|00000390| 74 68 65 20 4c 43 41 53 | 45 20 62 69 74 20 62 65 |the LCAS|E bit be|
|000003a0| 66 6f 72 65 0a 67 6f 69 | 6e 67 20 74 6f 20 74 68 |fore.goi|ng to th|
|000003b0| 65 20 6e 65 78 74 20 70 | 72 6f 67 72 61 6d 2e 0a |e next p|rogram..|
|000003c0| 0a 3a 20 4d 69 63 68 61 | 65 6c 20 47 65 72 73 74 |.: Micha|el Gerst|
|000003d0| 65 6e 0a 3a 09 09 09 09 | 20 69 68 6e 70 34 21 68 |en.:....| ihnp4!h|
|000003e0| 65 72 6d 69 78 21 75 63 | 6c 61 2d 61 6e 21 64 65 |ermix!uc|la-an!de|
|000003f0| 6e 77 61 21 73 74 62 21 | 6d 69 63 68 61 65 6c 0a |nwa!stb!|michael.|
|00000400| 3a 09 09 09 09 73 64 63 | 73 76 61 78 21 63 72 61 |:....sdc|svax!cra|
|00000410| 73 68 21 67 72 79 70 68 | 6f 6e 21 64 65 6e 77 61 |sh!gryph|on!denwa|
|00000420| 21 73 74 62 21 6d 69 63 | 68 61 65 6c 0a 3a 20 22 |!stb!mic|hael.: "|
|00000430| 41 20 68 61 63 6b 65 72 | 20 6c 69 76 65 73 20 66 |A hacker| lives f|
|00000440| 6f 72 65 76 65 72 2c 20 | 62 75 74 20 6e 6f 74 20 |orever, |but not |
|00000450| 73 6f 20 68 69 73 20 66 | 72 65 65 20 74 69 6d 65 |so his f|ree time|
|00000460| 22 0a 0a 23 21 20 2f 62 | 69 6e 2f 73 68 0a 23 20 |"..#! /b|in/sh.# |
|00000470| 54 68 69 73 20 69 73 20 | 61 20 73 68 65 6c 6c 20 |This is |a shell |
|00000480| 61 72 63 68 69 76 65 2e | 20 20 52 65 6d 6f 76 65 |archive.| Remove|
|00000490| 20 61 6e 79 74 68 69 6e | 67 20 62 65 66 6f 72 65 | anythin|g before|
|000004a0| 20 74 68 69 73 20 6c 69 | 6e 65 2c 20 74 68 65 6e | this li|ne, then|
|000004b0| 20 75 6e 70 61 63 6b 0a | 23 20 69 74 20 62 79 20 | unpack.|# it by |
|000004c0| 73 61 76 69 6e 67 20 69 | 74 20 69 6e 74 6f 20 61 |saving i|t into a|
|000004d0| 20 66 69 6c 65 20 61 6e | 64 20 74 79 70 69 6e 67 | file an|d typing|
|000004e0| 20 22 73 68 20 66 69 6c | 65 22 2e 20 20 54 6f 20 | "sh fil|e". To |
|000004f0| 6f 76 65 72 77 72 69 74 | 65 20 65 78 69 73 74 69 |overwrit|e existi|
|00000500| 6e 67 0a 23 20 66 69 6c | 65 73 2c 20 74 79 70 65 |ng.# fil|es, type|
|00000510| 20 22 73 68 20 66 69 6c | 65 20 2d 63 22 2e 20 20 | "sh fil|e -c". |
|00000520| 59 6f 75 20 63 61 6e 20 | 61 6c 73 6f 20 66 65 65 |You can |also fee|
|00000530| 64 20 74 68 69 73 20 61 | 73 20 73 74 61 6e 64 61 |d this a|s standa|
|00000540| 72 64 20 69 6e 70 75 74 | 20 76 69 61 0a 23 20 75 |rd input| via.# u|
|00000550| 6e 73 68 61 72 2c 20 6f | 72 20 62 79 20 74 79 70 |nshar, o|r by typ|
|00000560| 69 6e 67 20 22 73 68 20 | 3c 66 69 6c 65 22 2c 20 |ing "sh |<file", |
|00000570| 65 2e 67 2e 2e 20 20 49 | 66 20 74 68 69 73 20 61 |e.g.. I|f this a|
|00000580| 72 63 68 69 76 65 20 69 | 73 20 63 6f 6d 70 6c 65 |rchive i|s comple|
|00000590| 74 65 2c 20 79 6f 75 0a | 23 20 77 69 6c 6c 20 73 |te, you.|# will s|
|000005a0| 65 65 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |ee the f|ollowing|
|000005b0| 20 6d 65 73 73 61 67 65 | 20 61 74 20 74 68 65 20 | message| at the |
|000005c0| 65 6e 64 3a 0a 23 09 09 | 22 45 6e 64 20 6f 66 20 |end:.#..|"End of |
|000005d0| 73 68 65 6c 6c 20 61 72 | 63 68 69 76 65 2e 22 0a |shell ar|chive.".|
|000005e0| 23 20 43 6f 6e 74 65 6e | 74 73 3a 20 20 4d 61 6b |# Conten|ts: Mak|
|000005f0| 65 66 69 6c 65 20 6e 65 | 77 67 65 74 74 79 2e 6d |efile ne|wgetty.m|
|00000600| 61 6e 20 6e 65 77 67 65 | 74 74 79 2e 63 0a 23 20 |an newge|tty.c.# |
|00000610| 57 72 61 70 70 65 64 20 | 62 79 20 72 73 61 6c 7a |Wrapped |by rsalz|
|00000620| 40 66 69 67 2e 62 62 6e | 2e 63 6f 6d 20 6f 6e 20 |@fig.bbn|.com on |
|00000630| 54 68 75 20 4a 75 6e 20 | 20 32 20 31 34 3a 35 39 |Thu Jun | 2 14:59|
|00000640| 3a 31 38 20 31 39 38 38 | 0a 50 41 54 48 3d 2f 62 |:18 1988|.PATH=/b|
|00000650| 69 6e 3a 2f 75 73 72 2f | 62 69 6e 3a 2f 75 73 72 |in:/usr/|bin:/usr|
|00000660| 2f 75 63 62 20 3b 20 65 | 78 70 6f 72 74 20 50 41 |/ucb ; e|xport PA|
|00000670| 54 48 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 4d |TH.if te|st -f 'M|
|00000680| 61 6b 65 66 69 6c 65 27 | 20 2d 61 20 22 24 7b 31 |akefile'| -a "${1|
|00000690| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|000006a0| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|000006b0| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|000006c0| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|000006d0| 22 27 4d 61 6b 65 66 69 | 6c 65 27 5c 22 0a 65 6c |"'Makefi|le'\".el|
|000006e0| 73 65 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 45 78 |se.echo |shar: Ex|
|000006f0| 74 72 61 63 74 69 6e 67 | 20 5c 22 27 4d 61 6b 65 |tracting| \"'Make|
|00000700| 66 69 6c 65 27 5c 22 20 | 5c 28 32 34 30 20 63 68 |file'\" |\(240 ch|
|00000710| 61 72 61 63 74 65 72 73 | 5c 29 0a 73 65 64 20 22 |aracters|\).sed "|
|00000720| 73 2f 5e 58 2f 2f 22 20 | 3e 27 4d 61 6b 65 66 69 |s/^X//" |>'Makefi|
|00000730| 6c 65 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |le' <<'E|ND_OF_FI|
|00000740| 4c 45 27 0a 58 23 23 0a | 58 23 23 0a 58 0a 58 23 |LE'.X##.|X##.X.X#|
|00000750| 20 41 70 70 61 72 65 6e | 74 6c 79 20 74 68 69 73 | Apparen|tly this|
|00000760| 20 69 73 20 6e 65 65 64 | 65 64 20 66 6f 72 20 58 | is need|ed for X|
|00000770| 65 6e 69 78 3a 0a 58 23 | 4c 49 42 53 3d 2d 6c 78 |enix:.X#|LIBS=-lx|
|00000780| 0a 43 46 4c 41 47 53 3d | 2d 4f 0a 58 0a 61 6c 6c |.CFLAGS=|-O.X.all|
|00000790| 3a 09 09 6e 65 77 67 65 | 74 74 79 20 6e 65 77 67 |:..newge|tty newg|
|000007a0| 65 74 74 79 2e 6d 61 6e | 0a 69 6e 73 74 61 6c 6c |etty.man|.install|
|000007b0| 3a 09 61 6c 6c 0a 58 09 | 40 65 63 68 6f 20 49 6e |:.all.X.|@echo In|
|000007c0| 73 74 61 6c 6c 20 61 63 | 63 6f 72 64 69 6e 67 20 |stall ac|cording |
|000007d0| 74 6f 20 6c 6f 63 61 6c | 20 63 6f 6e 76 65 6e 74 |to local| convent|
|000007e0| 69 6f 6e 0a 58 0a 6e 65 | 77 67 65 74 74 79 3a 09 |ion.X.ne|wgetty:.|
|000007f0| 6e 65 77 67 65 74 74 79 | 2e 63 0a 58 09 40 72 6d |newgetty|.c.X.@rm|
|00000800| 20 2d 66 20 6e 65 77 67 | 65 74 74 79 0a 58 09 24 | -f newg|etty.X.$|
|00000810| 28 43 43 29 20 2d 6f 20 | 6e 65 77 67 65 74 74 79 |(CC) -o |newgetty|
|00000820| 20 24 28 43 46 4c 41 47 | 53 29 20 6e 65 77 67 65 | $(CFLAG|S) newge|
|00000830| 74 74 79 2e 63 20 24 28 | 4c 49 42 53 29 0a 45 4e |tty.c $(|LIBS).EN|
|00000840| 44 5f 4f 46 5f 46 49 4c | 45 0a 69 66 20 74 65 73 |D_OF_FIL|E.if tes|
|00000850| 74 20 32 34 30 20 2d 6e | 65 20 60 77 63 20 2d 63 |t 240 -n|e `wc -c|
|00000860| 20 3c 27 4d 61 6b 65 66 | 69 6c 65 27 60 3b 20 74 | <'Makef|ile'`; t|
|00000870| 68 65 6e 0a 20 20 20 20 | 65 63 68 6f 20 73 68 61 |hen. |echo sha|
|00000880| 72 3a 20 5c 22 27 4d 61 | 6b 65 66 69 6c 65 27 5c |r: \"'Ma|kefile'\|
|00000890| 22 20 75 6e 70 61 63 6b | 65 64 20 77 69 74 68 20 |" unpack|ed with |
|000008a0| 77 72 6f 6e 67 20 73 69 | 7a 65 21 0a 66 69 0a 23 |wrong si|ze!.fi.#|
|000008b0| 20 65 6e 64 20 6f 66 20 | 27 4d 61 6b 65 66 69 6c | end of |'Makefil|
|000008c0| 65 27 0a 66 69 0a 69 66 | 20 74 65 73 74 20 2d 66 |e'.fi.if| test -f|
|000008d0| 20 27 6e 65 77 67 65 74 | 74 79 2e 6d 61 6e 27 20 | 'newget|ty.man' |
|000008e0| 2d 61 20 22 24 7b 31 7d | 22 20 21 3d 20 22 2d 63 |-a "${1}|" != "-c|
|000008f0| 22 20 3b 20 74 68 65 6e | 20 0a 20 20 65 63 68 6f |" ; then| . echo|
|00000900| 20 73 68 61 72 3a 20 57 | 69 6c 6c 20 6e 6f 74 20 | shar: W|ill not |
|00000910| 63 6c 6f 62 62 65 72 20 | 65 78 69 73 74 69 6e 67 |clobber |existing|
|00000920| 20 66 69 6c 65 20 5c 22 | 27 6e 65 77 67 65 74 74 | file \"|'newgett|
|00000930| 79 2e 6d 61 6e 27 5c 22 | 0a 65 6c 73 65 0a 65 63 |y.man'\"|.else.ec|
|00000940| 68 6f 20 73 68 61 72 3a | 20 45 78 74 72 61 63 74 |ho shar:| Extract|
|00000950| 69 6e 67 20 5c 22 27 6e | 65 77 67 65 74 74 79 2e |ing \"'n|ewgetty.|
|00000960| 6d 61 6e 27 5c 22 20 5c | 28 31 37 30 30 20 63 68 |man'\" \|(1700 ch|
|00000970| 61 72 61 63 74 65 72 73 | 5c 29 0a 73 65 64 20 22 |aracters|\).sed "|
|00000980| 73 2f 5e 58 2f 2f 22 20 | 3e 27 6e 65 77 67 65 74 |s/^X//" |>'newget|
|00000990| 74 79 2e 6d 61 6e 27 20 | 3c 3c 27 45 4e 44 5f 4f |ty.man' |<<'END_O|
|000009a0| 46 5f 46 49 4c 45 27 0a | 58 2e 54 48 20 4e 45 57 |F_FILE'.|X.TH NEW|
|000009b0| 47 45 54 54 59 20 38 20 | 0a 58 2e 53 48 20 4e 41 |GETTY 8 |.X.SH NA|
|000009c0| 4d 45 0a 6e 65 77 67 65 | 74 74 79 20 5c 2d 20 62 |ME.newge|tty \- b|
|000009d0| 61 75 64 20 72 61 74 65 | 20 64 65 74 65 63 74 69 |aud rate| detecti|
|000009e0| 6e 67 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 67 65 |ng versi|on of ge|
|000009f0| 74 74 79 20 28 61 6e 64 | 20 6d 6f 72 65 29 0a 58 |tty (and| more).X|
|00000a00| 2e 53 48 20 53 59 4e 54 | 41 58 0a 58 2e 42 20 22 |.SH SYNT|AX.X.B "|
|00000a10| 67 65 74 74 79 20 62 22 | 0a 58 2e 62 72 0a 58 2e |getty b"|.X.br.X.|
|00000a20| 42 20 22 67 65 74 74 79 | 20 3c 61 6e 79 74 68 69 |B "getty| <anythi|
|00000a30| 6e 67 20 65 6c 73 65 3e | 22 0a 58 2e 53 48 20 44 |ng else>|".X.SH D|
|00000a40| 45 53 43 52 49 50 54 49 | 4f 4e 0a 58 2e 49 20 6e |ESCRIPTI|ON.X.I n|
|00000a50| 65 77 67 65 74 74 79 0a | 69 73 20 61 20 66 72 6f |ewgetty.|is a fro|
|00000a60| 6e 74 20 65 6e 64 20 74 | 6f 0a 58 2e 49 52 20 2f |nt end t|o.X.IR /|
|00000a70| 65 74 63 2f 67 65 74 74 | 79 20 2e 0a 49 74 20 61 |etc/gett|y ..It a|
|00000a80| 73 73 75 6d 65 73 20 74 | 68 61 74 20 74 68 65 20 |ssumes t|hat the |
|00000a90| 6f 6c 64 20 73 79 73 74 | 65 6d 20 73 75 70 70 6c |old syst|em suppl|
|00000aa0| 69 65 64 20 67 65 74 74 | 79 20 69 73 20 69 6e 0a |ied gett|y is in.|
|00000ab0| 58 2e 49 52 20 2f 65 74 | 63 2f 6c 69 62 2f 67 65 |X.IR /et|c/lib/ge|
|00000ac0| 74 74 79 20 3b 20 69 66 | 20 74 68 65 20 61 72 67 |tty ; if| the arg|
|00000ad0| 75 6d 65 6e 74 20 69 73 | 20 61 6e 79 74 68 69 6e |ument is| anythin|
|00000ae0| 67 20 6f 74 68 65 72 20 | 74 68 61 6e 0a 58 2e 42 |g other |than.X.B|
|00000af0| 20 62 0a 69 74 20 63 61 | 6c 6c 73 20 74 68 61 74 | b.it ca|lls that|
|00000b00| 20 70 72 6f 67 72 61 6d | 20 77 69 74 68 20 74 68 | program| with th|
|00000b10| 65 20 61 72 67 75 6d 65 | 6e 74 2e 0a 58 2e 50 50 |e argume|nt..X.PP|
|00000b20| 0a 49 66 20 74 68 65 20 | 61 72 67 75 6d 65 6e 74 |.If the |argument|
|00000b30| 20 69 73 0a 58 2e 42 52 | 20 62 20 2c 0a 69 74 20 | is.X.BR| b ,.it |
|00000b40| 74 72 79 73 20 74 6f 20 | 6f 70 65 6e 0a 58 2e 49 |trys to |open.X.I|
|00000b50| 52 20 2f 65 74 63 2f 64 | 65 66 61 75 6c 74 2f 67 |R /etc/d|efault/g|
|00000b60| 65 74 74 79 20 2c 0a 77 | 68 69 63 68 20 6d 75 73 |etty ,.w|hich mus|
|00000b70| 74 20 63 6f 6e 74 61 69 | 6e 20 61 20 6c 69 6e 65 |t contai|n a line|
|00000b80| 20 6c 69 6b 65 3a 0a 58 | 2e 52 53 0a 70 72 6f 6d | like:.X|.RS.prom|
|00000b90| 70 74 3d 41 6e 79 20 73 | 74 72 69 6e 67 20 74 68 |pt=Any s|tring th|
|00000ba0| 61 74 20 79 6f 75 20 77 | 61 6e 74 20 74 6f 20 6f |at you w|ant to o|
|00000bb0| 75 74 70 75 74 0a 58 2e | 52 45 0a 58 2e 50 50 0a |utput.X.|RE.X.PP.|
|00000bc0| 58 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 0a 58 2e |XFor exa|mple,.X.|
|00000bd0| 52 53 0a 70 72 6f 6d 70 | 74 3d 3c 62 3e 62 73 20 |RS.promp|t=<b>bs |
|00000be0| 6f 72 20 3c 75 3e 6e 69 | 78 0a 58 2e 52 45 0a 49 |or <u>ni|x.X.RE.I|
|00000bf0| 74 20 77 69 6c 6c 20 74 | 68 65 6e 20 77 61 69 74 |t will t|hen wait|
|00000c00| 20 66 6f 72 20 61 20 63 | 68 61 72 61 63 74 65 72 | for a c|haracter|
|00000c10| 20 28 77 69 74 68 20 61 | 20 74 69 6d 65 6f 75 74 | (with a| timeout|
|00000c20| 2c 20 63 75 72 72 65 6e | 74 6c 79 20 6f 66 20 33 |, curren|tly of 3|
|00000c30| 20 73 65 63 6f 6e 64 73 | 29 2c 0a 61 74 20 77 68 | seconds|),.at wh|
|00000c40| 69 63 68 20 70 6f 69 6e | 74 20 69 74 20 77 69 6c |ich poin|t it wil|
|00000c50| 6c 20 63 68 61 6e 67 65 | 20 62 61 75 64 20 72 61 |l change| baud ra|
|00000c60| 74 65 73 20 28 63 75 72 | 72 65 6e 74 6c 79 20 39 |tes (cur|rently 9|
|00000c70| 36 30 30 2f 32 34 30 30 | 2f 31 32 30 30 2f 33 30 |600/2400|/1200/30|
|00000c80| 30 29 2c 0a 61 6e 64 20 | 74 72 79 20 61 67 61 69 |0),.and |try agai|
|00000c90| 6e 2e 0a 58 2e 50 50 0a | 58 45 76 65 6e 74 75 61 |n..X.PP.|XEventua|
|00000ca0| 6c 6c 79 20 69 74 20 77 | 69 6c 6c 20 67 65 74 20 |lly it w|ill get |
|00000cb0| 61 20 63 68 61 72 61 63 | 74 65 72 2c 20 77 68 69 |a charac|ter, whi|
|00000cc0| 63 68 20 69 74 20 77 69 | 6c 6c 20 74 68 65 6e 20 |ch it wi|ll then |
|00000cd0| 74 72 79 20 74 6f 20 66 | 69 6e 64 20 61 0a 6c 69 |try to f|ind a.li|
|00000ce0| 6e 65 20 66 6f 72 20 69 | 6e 0a 58 2e 49 52 20 2f |ne for i|n.X.IR /|
|00000cf0| 65 74 63 2f 64 65 66 61 | 75 6c 74 2f 67 65 74 74 |etc/defa|ult/gett|
|00000d00| 79 20 2e 0a 54 68 69 73 | 20 6c 69 6e 65 20 73 68 |y ..This| line sh|
|00000d10| 6f 75 6c 64 20 63 6f 6e | 74 61 69 6e 20 74 68 65 |ould con|tain the|
|00000d20| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 70 72 6f | name of| the pro|
|00000d30| 67 72 61 6d 20 6f 72 20 | 73 68 65 6c 6c 20 73 63 |gram or |shell sc|
|00000d40| 72 69 70 74 20 74 6f 20 | 65 78 65 63 75 74 65 2e |ript to |execute.|
|00000d50| 0a 41 73 20 61 6e 20 65 | 78 61 6d 70 6c 65 3a 0a |.As an e|xample:.|
|00000d60| 58 2e 52 53 0a 58 2e 6e | 66 0a 70 72 6f 6d 70 74 |X.RS.X.n|f.prompt|
|00000d70| 3d 3c 62 3e 62 73 20 6f | 72 20 3c 75 3e 6e 69 78 |=<b>bs o|r <u>nix|
|00000d80| 0a 62 3d 2f 62 62 73 2f | 6c 6f 67 69 6e 0a 42 3d |.b=/bbs/|login.B=|
|00000d90| 2f 62 62 73 2f 6c 6f 67 | 69 6e 0a 75 3d 2f 65 74 |/bbs/log|in.u=/et|
|00000da0| 63 2f 6c 6f 67 69 6e 0a | 55 3d 2f 65 74 63 2f 6c |c/login.|U=/etc/l|
|00000db0| 6f 67 69 6e 0a 78 3d 2f | 65 74 63 2f 6c 6f 67 69 |ogin.x=/|etc/logi|
|00000dc0| 6e 0a 58 58 3d 2f 65 74 | 63 2f 6c 6f 67 69 6e 0a |n.XX=/et|c/login.|
|00000dd0| 58 2e 66 69 0a 58 2e 52 | 45 0a 58 2e 50 50 0a 58 |X.fi.X.R|E.X.PP.X|
|00000de0| 2e 49 20 4e 65 77 67 65 | 74 74 79 0a 69 73 20 73 |.I Newge|tty.is s|
|00000df0| 6d 61 72 74 20 65 6e 6f | 75 67 68 20 74 6f 20 73 |mart eno|ugh to s|
|00000e00| 65 74 20 74 68 65 20 75 | 70 70 65 72 63 61 73 65 |et the u|ppercase|
|00000e10| 20 66 6c 61 67 20 69 66 | 20 61 6e 20 75 70 70 65 | flag if| an uppe|
|00000e20| 72 63 61 73 65 20 6c 65 | 74 74 65 72 20 63 6f 6d |rcase le|tter com|
|00000e30| 65 73 20 69 6e 3b 0a 6f | 74 68 65 72 20 74 68 61 |es in;.o|ther tha|
|00000e40| 6e 20 74 68 61 74 20 69 | 74 20 61 73 73 75 6d 65 |n that i|t assume|
|00000e50| 73 20 61 20 6e 6f 72 6d | 61 6c 20 28 72 65 74 75 |s a norm|al (retu|
|00000e60| 72 6e 2f 6e 65 77 6c 69 | 6e 65 20 65 78 63 68 61 |rn/newli|ne excha|
|00000e70| 6e 67 65 2c 20 65 74 63 | 29 20 74 65 72 6d 69 6e |nge, etc|) termin|
|00000e80| 61 6c 2e 0a 49 74 20 64 | 6f 65 73 20 6e 6f 74 20 |al..It d|oes not |
|00000e90| 64 6f 20 61 73 20 6d 75 | 63 68 20 63 68 65 63 6b |do as mu|ch check|
|00000ea0| 69 6e 67 20 61 73 20 74 | 68 65 20 73 74 61 6e 64 |ing as t|he stand|
|00000eb0| 61 72 64 20 67 65 74 74 | 79 2c 20 62 75 74 20 69 |ard gett|y, but i|
|00000ec0| 74 27 73 20 6f 6e 6c 79 | 20 6c 6f 6f 6b 69 6e 67 |t's only| looking|
|00000ed0| 0a 61 74 20 6f 6e 65 20 | 63 68 61 72 61 63 74 65 |.at one |characte|
|00000ee0| 72 2e 0a 58 2e 50 50 0a | 58 2e 49 20 4e 65 77 67 |r..X.PP.|X.I Newg|
|00000ef0| 65 74 74 79 0a 61 73 73 | 75 6d 65 73 20 61 20 66 |etty.ass|umes a f|
|00000f00| 61 69 72 6c 79 20 73 74 | 61 6e 64 61 72 64 20 73 |airly st|andard s|
|00000f10| 74 64 69 6f 2c 20 61 6e | 64 20 75 73 65 73 20 6f |tdio, an|d uses o|
|00000f20| 6e 65 20 6e 6f 6e 70 6f | 72 74 61 62 6c 65 20 63 |ne nonpo|rtable c|
|00000f30| 61 6c 6c 2e 0a 54 68 65 | 20 72 6f 75 74 69 6e 65 |all..The| routine|
|00000f40| 0a 58 2e 49 52 20 66 69 | 6e 6b 65 79 20 28 29 0a |.X.IR fi|nkey ().|
|00000f50| 72 65 74 75 72 6e 73 20 | 61 20 73 69 6e 67 6c 65 |returns |a single|
|00000f60| 20 63 68 61 72 61 63 74 | 65 72 20 66 72 6f 6d 20 | charact|er from |
|00000f70| 61 20 73 74 61 6e 64 61 | 72 64 20 49 2f 4f 20 46 |a standa|rd I/O F|
|00000f80| 49 4c 45 3b 20 69 74 20 | 75 73 65 73 0a 58 2e 49 |ILE; it |uses.X.I|
|00000f90| 52 20 72 64 63 68 6b 20 | 28 29 0a 74 6f 20 73 65 |R rdchk |().to se|
|00000fa0| 65 20 69 66 20 61 20 63 | 68 61 72 61 63 74 65 72 |e if a c|haracter|
|00000fb0| 20 69 73 20 61 76 61 69 | 6c 61 62 6c 65 2e 0a 42 | is avai|lable..B|
|00000fc0| 53 44 20 75 73 65 72 73 | 20 63 61 6e 20 73 75 62 |SD users| can sub|
|00000fd0| 73 74 69 74 75 74 65 20 | 46 49 4f 4e 52 45 41 44 |stitute |FIONREAD|
|00000fe0| 3b 20 70 75 72 65 20 53 | 79 73 74 65 6d 5c 2d 35 |; pure S|ystem\-5|
|00000ff0| 20 75 73 65 72 73 20 77 | 69 6c 6c 20 68 61 76 65 | users w|ill have|
|00001000| 20 74 6f 20 63 68 61 6e | 67 65 0a 74 68 65 20 74 | to chan|ge.the t|
|00001010| 65 72 6d 69 6e 61 6c 20 | 63 6f 64 65 73 20 75 73 |erminal |codes us|
|00001020| 65 64 20 61 6e 79 77 61 | 79 73 2c 20 73 6f 20 74 |ed anywa|ys, so t|
|00001030| 68 65 79 20 63 61 6e 20 | 70 75 74 20 74 68 65 20 |hey can |put the |
|00001040| 74 69 6d 65 6f 75 74 20 | 63 6f 64 65 73 20 69 6e |timeout |codes in|
|00001050| 2e 0a 56 37 20 73 68 6f | 75 6c 64 20 6a 75 73 74 |..V7 sho|uld just|
|00001060| 20 66 6f 72 67 65 74 20 | 74 68 69 73 2e 0a 45 4e | forget |this..EN|
|00001070| 44 5f 4f 46 5f 46 49 4c | 45 0a 69 66 20 74 65 73 |D_OF_FIL|E.if tes|
|00001080| 74 20 31 37 30 30 20 2d | 6e 65 20 60 77 63 20 2d |t 1700 -|ne `wc -|
|00001090| 63 20 3c 27 6e 65 77 67 | 65 74 74 79 2e 6d 61 6e |c <'newg|etty.man|
|000010a0| 27 60 3b 20 74 68 65 6e | 0a 20 20 20 20 65 63 68 |'`; then|. ech|
|000010b0| 6f 20 73 68 61 72 3a 20 | 5c 22 27 6e 65 77 67 65 |o shar: |\"'newge|
|000010c0| 74 74 79 2e 6d 61 6e 27 | 5c 22 20 75 6e 70 61 63 |tty.man'|\" unpac|
|000010d0| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|000010e0| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|000010f0| 20 27 6e 65 77 67 65 74 | 74 79 2e 6d 61 6e 27 0a | 'newget|ty.man'.|
|00001100| 66 69 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 6e |fi.if te|st -f 'n|
|00001110| 65 77 67 65 74 74 79 2e | 63 27 20 2d 61 20 22 24 |ewgetty.|c' -a "$|
|00001120| 7b 31 7d 22 20 21 3d 20 | 22 2d 63 22 20 3b 20 74 |{1}" != |"-c" ; t|
|00001130| 68 65 6e 20 0a 20 20 65 | 63 68 6f 20 73 68 61 72 |hen . e|cho shar|
|00001140| 3a 20 57 69 6c 6c 20 6e | 6f 74 20 63 6c 6f 62 62 |: Will n|ot clobb|
|00001150| 65 72 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |er exist|ing file|
|00001160| 20 5c 22 27 6e 65 77 67 | 65 74 74 79 2e 63 27 5c | \"'newg|etty.c'\|
|00001170| 22 0a 65 6c 73 65 0a 65 | 63 68 6f 20 73 68 61 72 |".else.e|cho shar|
|00001180| 3a 20 45 78 74 72 61 63 | 74 69 6e 67 20 5c 22 27 |: Extrac|ting \"'|
|00001190| 6e 65 77 67 65 74 74 79 | 2e 63 27 5c 22 20 5c 28 |newgetty|.c'\" \(|
|000011a0| 32 36 36 30 20 63 68 61 | 72 61 63 74 65 72 73 5c |2660 cha|racters\|
|000011b0| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|000011c0| 27 6e 65 77 67 65 74 74 | 79 2e 63 27 20 3c 3c 27 |'newgett|y.c' <<'|
|000011d0| 45 4e 44 5f 4f 46 5f 46 | 49 4c 45 27 0a 58 2f 2a |END_OF_F|ILE'.X/*|
|000011e0| 20 40 28 23 29 6e 65 77 | 67 65 74 74 79 2e 63 09 | @(#)new|getty.c.|
|000011f0| 32 2e 32 20 34 2f 31 38 | 2f 38 38 20 31 37 3a 35 |2.2 4/18|/88 17:5|
|00001200| 35 3a 32 39 20 28 20 34 | 2f 31 38 2f 38 38 20 31 |5:29 ( 4|/18/88 1|
|00001210| 37 3a 33 33 3a 30 31 20 | 29 20 2a 2f 0a 58 2f 2a |7:33:01 |) */.X/*|
|00001220| 20 4e 65 77 20 67 65 74 | 74 79 20 70 72 6f 67 72 | New get|ty progr|
|00001230| 61 6d 2e 20 49 66 20 63 | 61 6c 6c 65 64 20 77 69 |am. If c|alled wi|
|00001240| 74 68 20 61 6e 20 61 72 | 67 75 6d 65 6e 74 20 6f |th an ar|gument o|
|00001250| 74 68 65 72 20 74 68 61 | 6e 20 27 62 27 2c 20 69 |ther tha|n 'b', i|
|00001260| 74 20 69 6e 76 6f 6b 65 | 73 0a 58 09 74 68 65 20 |t invoke|s.X.the |
|00001270| 6f 6c 64 20 67 65 74 74 | 79 20 70 72 6f 67 72 61 |old gett|y progra|
|00001280| 6d 20 28 61 73 73 75 6d | 65 64 20 74 6f 20 62 65 |m (assum|ed to be|
|00001290| 20 61 74 20 2f 65 74 63 | 2f 6c 69 62 2f 67 65 74 | at /etc|/lib/get|
|000012a0| 74 79 29 2c 20 6f 74 68 | 65 72 77 69 73 65 0a 58 |ty), oth|erwise.X|
|000012b0| 09 69 74 20 72 65 61 64 | 73 20 74 68 65 20 64 65 |.it read|s the de|
|000012c0| 66 61 75 6c 74 20 66 69 | 6c 65 20 28 2f 65 74 63 |fault fi|le (/etc|
|000012d0| 2f 64 65 66 61 75 6c 74 | 73 2f 67 65 74 74 79 29 |/default|s/getty)|
|000012e0| 20 66 6f 72 20 27 70 72 | 6f 6d 70 74 3d 27 2c 0a | for 'pr|ompt=',.|
|000012f0| 58 09 64 69 73 70 6c 61 | 79 73 20 74 68 65 20 72 |X.displa|ys the r|
|00001300| 65 73 75 6c 74 2c 20 72 | 65 61 64 73 20 61 20 63 |esult, r|eads a c|
|00001310| 68 61 72 61 63 74 65 72 | 2c 20 6c 6f 6f 70 73 20 |haracter|, loops |
|00001320| 69 66 20 6e 6f 6e 2d 61 | 73 63 69 69 2c 20 63 68 |if non-a|scii, ch|
|00001330| 65 63 6b 73 0a 58 09 74 | 68 65 20 64 65 66 61 75 |ecks.X.t|he defau|
|00001340| 6c 74 20 66 69 6c 65 20 | 66 6f 72 20 3c 63 68 61 |lt file |for <cha|
|00001350| 72 3e 3d 2c 20 65 78 65 | 63 75 74 65 73 20 74 68 |r>=, exe|cutes th|
|00001360| 61 74 20 70 72 6f 67 72 | 61 6d 20 69 66 20 66 6f |at progr|am if fo|
|00001370| 75 6e 64 2c 20 6f 74 68 | 65 72 77 69 73 65 0a 58 |und, oth|erwise.X|
|00001380| 09 6c 6f 6f 70 73 2e 20 | 2a 2f 0a 58 0a 58 2f 2a |.loops. |*/.X.X/*|
|00001390| 20 30 2e 34 20 53 79 73 | 20 33 20 6d 6f 64 73 3a | 0.4 Sys| 3 mods:|
|000013a0| 20 73 65 74 20 65 63 68 | 6f 2c 20 63 6f 6f 6b 65 | set ech|o, cooke|
|000013b0| 64 20 2a 2f 0a 58 2f 2a | 20 47 61 76 65 20 75 70 |d */.X/*| Gave up|
|000013c0| 20 6f 6e 20 67 65 74 74 | 69 6e 67 20 69 74 20 74 | on gett|ing it t|
|000013d0| 6f 20 77 6f 72 6b 20 77 | 69 74 68 20 74 68 65 20 |o work w|ith the |
|000013e0| 73 79 73 33 20 73 74 72 | 75 63 74 75 72 65 73 2e |sys3 str|uctures.|
|000013f0| 20 57 69 6c 6c 20 77 6f | 72 6b 20 66 69 6e 65 0a | Will wo|rk fine.|
|00001400| 66 6f 72 20 42 53 44 20 | 73 79 73 74 65 6d 73 2c |for BSD |systems,|
|00001410| 20 6f 72 20 58 65 6e 69 | 78 20 73 79 73 74 65 6d | or Xeni|x system|
|00001420| 73 2e 20 49 66 20 79 6f | 75 20 61 72 65 20 70 75 |s. If yo|u are pu|
|00001430| 72 65 20 55 53 47 2c 20 | 65 69 74 68 65 72 20 6c |re USG, |either l|
|00001440| 69 6e 6b 20 66 6f 72 0a | 76 65 72 73 69 6f 6e 20 |ink for.|version |
|00001450| 37 20 6d 6f 64 65 20 28 | 74 68 65 20 6b 65 72 6e |7 mode (|the kern|
|00001460| 65 6c 20 73 74 69 6c 6c | 20 68 61 73 20 74 68 65 |el still| has the|
|00001470| 20 76 65 72 73 69 6f 6e | 20 37 20 73 74 75 66 66 | version| 7 stuff|
|00001480| 20 68 69 64 64 65 6e 20 | 69 6e 73 69 64 65 0a 66 | hidden |inside.f|
|00001490| 6f 72 20 63 6f 6d 70 61 | 74 69 62 69 6c 69 74 79 |or compa|tibility|
|000014a0| 29 2c 20 6f 72 20 63 6f | 6e 76 65 72 74 20 69 74 |), or co|nvert it|
|000014b0| 20 79 6f 75 72 73 65 6c | 66 2e 0a 58 2a 2f 0a 58 | yoursel|f..X*/.X|
|000014c0| 0a 58 23 69 6e 63 6c 75 | 64 65 20 3c 63 74 79 70 |.X#inclu|de <ctyp|
|000014d0| 65 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |e.h>.X#i|nclude <|
|000014e0| 73 74 64 69 6f 2e 68 3e | 0a 58 23 69 6e 63 6c 75 |stdio.h>|.X#inclu|
|000014f0| 64 65 20 3c 73 67 74 74 | 79 2e 68 3e 0a 58 0a 58 |de <sgtt|y.h>.X.X|
|00001500| 2f 2a 20 30 2e 33 20 44 | 6f 65 73 20 6e 6f 74 20 |/* 0.3 D|oes not |
|00001510| 61 63 74 75 61 6c 6c 79 | 20 70 61 73 73 20 61 72 |actually| pass ar|
|00001520| 67 20 74 6f 20 6e 65 78 | 74 20 70 72 6f 67 72 61 |g to nex|t progra|
|00001530| 6d 20 2a 2f 0a 58 2f 2a | 20 57 69 6c 6c 20 6e 6f |m */.X/*| Will no|
|00001540| 74 20 77 6f 72 6b 20 61 | 74 20 32 34 30 30 20 2a |t work a|t 2400 *|
|00001550| 2f 0a 58 23 64 65 66 69 | 6e 65 20 53 50 45 45 44 |/.X#defi|ne SPEED|
|00001560| 09 28 74 65 72 6d 2e 73 | 67 5f 69 73 70 65 65 64 |.(term.s|g_ispeed|
|00001570| 20 3e 3d 20 42 31 32 30 | 30 20 3f 20 22 33 22 3a | >= B120|0 ? "3":|
|00001580| 22 35 22 29 0a 58 23 64 | 65 66 69 6e 65 20 66 6e |"5").X#d|efine fn|
|00001590| 73 6c 65 65 70 28 78 29 | 20 20 28 33 29 09 2f 2a |sleep(x)| (3)./*|
|000015a0| 20 52 65 74 75 72 6e 20 | 74 69 6d 65 20 66 6f 72 | Return |time for|
|000015b0| 20 73 6c 65 65 70 20 2a | 2f 0a 58 0a 63 68 61 72 | sleep *|/.X.char|
|000015c0| 20 2a 64 65 66 72 65 61 | 64 28 29 2c 20 2a 6d 6b | *defrea|d(), *mk|
|000015d0| 73 74 72 28 29 3b 0a 6d | 61 69 6e 28 61 72 67 63 |str();.m|ain(argc|
|000015e0| 2c 20 61 72 67 76 29 0a | 63 68 61 72 20 2a 61 72 |, argv).|char *ar|
|000015f0| 67 76 5b 5d 3b 0a 58 7b | 0a 58 09 69 6e 74 20 63 |gv[];.X{|.X.int c|
|00001600| 3b 0a 58 09 63 68 61 72 | 20 2a 78 3b 0a 58 09 73 |;.X.char| *x;.X.s|
|00001610| 74 72 75 63 74 20 73 67 | 74 74 79 62 20 74 65 72 |truct sg|ttyb ter|
|00001620| 6d 3b 0a 58 09 69 66 20 | 28 61 72 67 63 20 21 3d |m;.X.if |(argc !=|
|00001630| 20 32 20 7c 7c 20 73 74 | 72 63 6d 70 20 28 61 72 | 2 || st|rcmp (ar|
|00001640| 67 76 5b 31 5d 2c 20 22 | 62 22 29 20 21 3d 20 30 |gv[1], "|b") != 0|
|00001650| 29 0a 65 72 72 6f 72 3a | 09 09 65 78 65 63 76 20 |).error:|..execv |
|00001660| 28 22 2f 65 74 63 2f 6c | 69 62 2f 67 65 74 74 79 |("/etc/l|ib/getty|
|00001670| 22 2c 20 61 72 67 76 29 | 3b 0a 58 09 69 66 20 28 |", argv)|;.X.if (|
|00001680| 64 65 66 6f 70 65 6e 28 | 22 2f 65 74 63 2f 64 65 |defopen(|"/etc/de|
|00001690| 66 61 75 6c 74 2f 67 65 | 74 74 79 22 29 20 21 3d |fault/ge|tty") !=|
|000016a0| 20 30 29 0a 58 09 7b 0a | 58 09 09 70 65 72 72 6f | 0).X.{.|X..perro|
|000016b0| 72 28 22 6e 65 77 20 67 | 65 74 74 79 3a 22 29 3b |r("new g|etty:");|
|000016c0| 0a 58 09 09 67 6f 74 6f | 20 65 72 72 6f 72 3b 0a |.X..goto| error;.|
|000016d0| 58 09 7d 0a 58 09 69 6f | 63 74 6c 20 28 31 2c 20 |X.}.X.io|ctl (1, |
|000016e0| 54 49 4f 43 47 45 54 50 | 2c 20 26 74 65 72 6d 29 |TIOCGETP|, &term)|
|000016f0| 3b 20 20 0a 58 09 74 65 | 72 6d 2e 73 67 5f 69 73 |; .X.te|rm.sg_is|
|00001700| 70 65 65 64 20 3d 20 74 | 65 72 6d 2e 73 67 5f 6f |peed = t|erm.sg_o|
|00001710| 73 70 65 65 64 20 3d 20 | 42 39 36 30 30 3b 0a 58 |speed = |B9600;.X|
|00001720| 09 74 65 72 6d 2e 73 67 | 5f 66 6c 61 67 73 20 7c |.term.sg|_flags ||
|00001730| 3d 20 43 42 52 45 41 4b | 20 7c 20 45 43 48 4f 20 |= CBREAK| | ECHO |
|00001740| 7c 20 43 52 4d 4f 44 3b | 0a 58 09 74 65 72 6d 2e || CRMOD;|.X.term.|
|00001750| 73 67 5f 66 6c 61 67 73 | 20 26 3d 20 7e 52 41 57 |sg_flags| &= ~RAW|
|00001760| 3b 0a 58 09 69 6f 63 74 | 6c 20 28 31 2c 20 54 49 |;.X.ioct|l (1, TI|
|00001770| 4f 43 4e 58 43 4c 29 3b | 0a 58 09 66 6f 72 20 28 |OCNXCL);|.X.for (|
|00001780| 3b 3b 29 0a 58 09 7b 0a | 58 09 09 69 6f 63 74 6c |;;).X.{.|X..ioctl|
|00001790| 20 28 31 2c 20 54 49 4f | 43 53 45 54 50 2c 20 26 | (1, TIO|CSETP, &|
|000017a0| 74 65 72 6d 29 3b 0a 58 | 09 09 70 75 74 73 20 28 |term);.X|..puts (|
|000017b0| 22 5c 72 22 29 3b 0a 58 | 09 09 66 70 75 74 73 28 |"\r");.X|..fputs(|
|000017c0| 64 65 66 72 65 61 64 28 | 22 70 72 6f 6d 70 74 3d |defread(|"prompt=|
|000017d0| 22 29 2c 20 73 74 64 6f | 75 74 29 3b 0a 58 09 09 |"), stdo|ut);.X..|
|000017e0| 2f 2a 20 46 6c 75 73 68 | 20 69 6e 70 75 74 20 2a |/* Flush| input *|
|000017f0| 2f 0a 58 09 09 77 68 69 | 6c 65 20 28 28 63 3d 66 |/.X..whi|le ((c=f|
|00001800| 69 6e 6b 65 79 28 73 74 | 64 69 6e 29 29 20 21 3d |inkey(st|din)) !=|
|00001810| 20 27 5c 30 27 20 26 26 | 20 63 21 3d 20 45 4f 46 | '\0' &&| c!= EOF|
|00001820| 29 0a 58 09 09 09 3b 0a | 58 09 09 73 6c 65 65 70 |).X...;.|X..sleep|
|00001830| 28 66 6e 73 6c 65 65 70 | 28 74 65 72 6d 2e 73 67 |(fnsleep|(term.sg|
|00001840| 5f 69 73 70 65 65 64 29 | 29 3b 0a 58 09 09 69 66 |_ispeed)|);.X..if|
|00001850| 20 28 69 73 61 6c 70 68 | 61 28 63 3d 66 69 6e 6b | (isalph|a(c=fink|
|00001860| 65 79 28 73 74 64 69 6e | 29 29 20 26 26 20 28 78 |ey(stdin|)) && (x|
|00001870| 3d 64 65 66 72 65 61 64 | 28 6d 6b 73 74 72 28 63 |=defread|(mkstr(c|
|00001880| 29 29 29 20 21 3d 4e 55 | 4c 4c 29 0a 58 09 09 7b |))) !=NU|LL).X..{|
|00001890| 0a 58 09 09 09 70 75 74 | 63 68 61 72 28 27 5c 6e |.X...put|char('\n|
|000018a0| 27 29 3b 0a 58 09 09 09 | 74 65 72 6d 2e 73 67 5f |');.X...|term.sg_|
|000018b0| 66 6c 61 67 73 20 3d 20 | 74 65 72 6d 2e 73 67 5f |flags = |term.sg_|
|000018c0| 66 6c 61 67 73 20 26 7e | 20 43 42 52 45 41 4b 3b |flags &~| CBREAK;|
|000018d0| 0a 58 09 09 09 69 66 20 | 28 69 73 75 70 70 65 72 |.X...if |(isupper|
|000018e0| 28 63 29 29 0a 58 09 09 | 09 09 74 65 72 6d 2e 73 |(c)).X..|..term.s|
|000018f0| 67 5f 66 6c 61 67 73 20 | 7c 3d 20 4c 43 41 53 45 |g_flags ||= LCASE|
|00001900| 3b 0a 58 09 09 09 69 6f | 63 74 6c 20 28 31 2c 20 |;.X...io|ctl (1, |
|00001910| 54 49 4f 43 53 45 54 50 | 2c 20 26 74 65 72 6d 29 |TIOCSETP|, &term)|
|00001920| 3b 0a 58 09 09 09 2f 2a | 20 4e 6f 20 6d 6f 72 65 |;.X.../*| No more|
|00001930| 20 61 6c 61 72 6d 20 63 | 6c 6f 63 6b 20 2a 2f 0a | alarm c|lock */.|
|00001940| 58 09 09 09 65 78 65 63 | 6c 70 20 28 78 2c 20 78 |X...exec|lp (x, x|
|00001950| 2c 20 4e 55 4c 4c 29 3b | 0a 58 09 2f 2a 20 53 70 |, NULL);|.X./* Sp|
|00001960| 65 65 64 20 69 73 20 6e | 6f 20 6c 6f 6e 67 65 72 |eed is n|o longer|
|00001970| 20 70 61 73 73 65 64 20 | 2a 2f 0a 58 09 09 09 70 | passed |*/.X...p|
|00001980| 65 72 72 6f 72 20 28 78 | 29 3b 0a 58 09 09 09 74 |error (x|);.X...t|
|00001990| 65 72 6d 2e 73 67 5f 66 | 6c 61 67 73 20 7c 3d 20 |erm.sg_f|lags |= |
|000019a0| 43 42 52 45 41 4b 3b 0a | 58 09 09 7d 0a 58 09 09 |CBREAK;.|X..}.X..|
|000019b0| 74 65 72 6d 2e 73 67 5f | 69 73 70 65 65 64 20 3d |term.sg_|ispeed =|
|000019c0| 20 74 65 72 6d 2e 73 67 | 5f 6f 73 70 65 65 64 20 | term.sg|_ospeed |
|000019d0| 3d 20 6e 65 78 74 73 70 | 65 65 64 20 28 74 65 72 |= nextsp|eed (ter|
|000019e0| 6d 2e 73 67 5f 69 73 70 | 65 65 64 29 3b 0a 58 09 |m.sg_isp|eed);.X.|
|000019f0| 09 09 09 09 2f 2a 20 43 | 68 61 6e 67 65 20 73 70 |..../* C|hange sp|
|00001a00| 65 65 64 20 26 20 74 72 | 79 20 61 67 61 69 6e 20 |eed & tr|y again |
|00001a10| 2a 2f 0a 58 09 7d 0a 58 | 7d 0a 58 0a 63 68 61 72 |*/.X.}.X|}.X.char|
|00001a20| 20 2a 6d 6b 73 74 72 28 | 63 29 0a 63 68 61 72 20 | *mkstr(|c).char |
|00001a30| 63 3b 0a 58 7b 0a 58 09 | 73 74 61 74 69 63 20 63 |c;.X{.X.|static c|
|00001a40| 68 61 72 20 63 68 72 5b | 5d 3d 22 78 3d 22 3b 0a |har chr[|]="x=";.|
|00001a50| 58 09 63 68 72 5b 30 5d | 3d 63 3b 0a 58 09 72 65 |X.chr[0]|=c;.X.re|
|00001a60| 74 75 72 6e 20 63 68 72 | 3b 0a 58 7d 0a 58 0a 6e |turn chr|;.X}.X.n|
|00001a70| 65 78 74 73 70 65 65 64 | 28 6f 6c 64 73 70 65 65 |extspeed|(oldspee|
|00001a80| 64 29 0a 58 7b 0a 58 09 | 73 77 69 74 63 68 20 28 |d).X{.X.|switch (|
|00001a90| 6f 6c 64 73 70 65 65 64 | 29 0a 58 09 7b 09 63 61 |oldspeed|).X.{.ca|
|00001aa0| 73 65 20 42 33 30 30 3a | 20 72 65 74 75 72 6e 20 |se B300:| return |
|00001ab0| 42 39 36 30 30 3b 0a 58 | 09 09 63 61 73 65 20 42 |B9600;.X|..case B|
|00001ac0| 31 32 30 30 3a 20 72 65 | 74 75 72 6e 20 42 33 30 |1200: re|turn B30|
|00001ad0| 30 3b 0a 58 09 09 63 61 | 73 65 20 42 32 34 30 30 |0;.X..ca|se B2400|
|00001ae0| 3a 20 72 65 74 75 72 6e | 20 42 31 32 30 30 3b 0a |: return| B1200;.|
|00001af0| 58 09 09 63 61 73 65 20 | 42 39 36 30 30 3a 20 72 |X..case |B9600: r|
|00001b00| 65 74 75 72 6e 20 42 32 | 34 30 30 3b 0a 58 09 7d |eturn B2|400;.X.}|
|00001b10| 0a 58 7d 0a 58 0a 58 2f | 2a 20 40 28 23 29 69 6e |.X}.X.X/|* @(#)in|
|00001b20| 6b 65 79 2e 63 09 31 2e | 31 20 34 2f 31 38 2f 38 |key.c.1.|1 4/18/8|
|00001b30| 38 20 31 37 3a 35 37 3a | 34 38 20 28 20 31 30 2f |8 17:57:|48 ( 10/|
|00001b40| 32 2f 38 36 20 31 38 3a | 35 31 3a 35 34 20 29 20 |2/86 18:|51:54 ) |
|00001b50| 2a 2f 0a 58 23 20 69 6e | 63 6c 75 64 65 20 3c 73 |*/.X# in|clude <s|
|00001b60| 74 64 69 6f 2e 68 3e 0a | 69 6e 6b 65 79 28 66 64 |tdio.h>.|inkey(fd|
|00001b70| 29 0a 69 6e 74 20 66 64 | 3b 0a 58 7b 0a 58 09 63 |).int fd|;.X{.X.c|
|00001b80| 68 61 72 20 63 3b 0a 58 | 09 69 6e 74 20 74 65 6d |har c;.X|.int tem|
|00001b90| 70 3b 0a 58 09 69 66 20 | 28 74 65 6d 70 3d 72 64 |p;.X.if |(temp=rd|
|00001ba0| 63 68 6b 28 66 64 29 20 | 3e 20 30 29 0a 58 09 09 |chk(fd) |> 0).X..|
|00001bb0| 69 66 20 28 72 65 61 64 | 20 28 66 64 2c 20 26 63 |if (read| (fd, &c|
|00001bc0| 2c 20 31 29 20 3e 30 29 | 0a 58 09 09 09 72 65 74 |, 1) >0)|.X...ret|
|00001bd0| 75 72 6e 20 63 3b 0a 58 | 09 09 65 6c 73 65 20 72 |urn c;.X|..else r|
|00001be0| 65 74 75 72 6e 20 28 63 | 68 61 72 29 20 2d 31 3b |eturn (c|har) -1;|
|00001bf0| 0a 58 09 65 6c 73 65 20 | 72 65 74 75 72 6e 20 28 |.X.else |return (|
|00001c00| 74 65 6d 70 20 3d 3d 20 | 30 20 3f 20 30 20 3a 20 |temp == |0 ? 0 : |
|00001c10| 2d 31 29 3b 0a 58 7d 0a | 58 0a 66 69 6e 6b 65 79 |-1);.X}.|X.finkey|
|00001c20| 28 66 70 29 0a 58 46 49 | 4c 45 20 2a 66 70 3b 0a |(fp).XFI|LE *fp;.|
|00001c30| 58 7b 0a 58 09 69 66 20 | 28 28 66 70 2d 3e 5f 63 |X{.X.if |((fp->_c|
|00001c40| 6e 74 20 3e 20 30 29 20 | 7c 7c 20 72 64 63 68 6b |nt > 0) ||| rdchk|
|00001c50| 28 66 69 6c 65 6e 6f 28 | 66 70 29 29 20 3e 20 30 |(fileno(|fp)) > 0|
|00001c60| 29 0a 58 09 09 72 65 74 | 75 72 6e 20 67 65 74 63 |).X..ret|urn getc|
|00001c70| 20 28 66 70 29 3b 0a 58 | 09 69 66 20 66 65 6f 66 | (fp);.X|.if feof|
|00001c80| 28 66 70 29 0a 58 09 09 | 72 65 74 75 72 6e 20 45 |(fp).X..|return E|
|00001c90| 4f 46 3b 0a 58 09 72 65 | 74 75 72 6e 20 30 3b 0a |OF;.X.re|turn 0;.|
|00001ca0| 58 7d 0a 45 4e 44 5f 4f | 46 5f 46 49 4c 45 0a 69 |X}.END_O|F_FILE.i|
|00001cb0| 66 20 74 65 73 74 20 32 | 36 36 30 20 2d 6e 65 20 |f test 2|660 -ne |
|00001cc0| 60 77 63 20 2d 63 20 3c | 27 6e 65 77 67 65 74 74 |`wc -c <|'newgett|
|00001cd0| 79 2e 63 27 60 3b 20 74 | 68 65 6e 0a 20 20 20 20 |y.c'`; t|hen. |
|00001ce0| 65 63 68 6f 20 73 68 61 | 72 3a 20 5c 22 27 6e 65 |echo sha|r: \"'ne|
|00001cf0| 77 67 65 74 74 79 2e 63 | 27 5c 22 20 75 6e 70 61 |wgetty.c|'\" unpa|
|00001d00| 63 6b 65 64 20 77 69 74 | 68 20 77 72 6f 6e 67 20 |cked wit|h wrong |
|00001d10| 73 69 7a 65 21 0a 66 69 | 0a 23 20 65 6e 64 20 6f |size!.fi|.# end o|
|00001d20| 66 20 27 6e 65 77 67 65 | 74 74 79 2e 63 27 0a 66 |f 'newge|tty.c'.f|
|00001d30| 69 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 6e 64 |i.echo s|har: End|
|00001d40| 20 6f 66 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 | of shel|l archiv|
|00001d50| 65 2e 0a 65 78 69 74 20 | 30 0a |e..exit |0. |
+--------+-------------------------+-------------------------+--------+--------+