xref: /original-bsd/local/toolchest/ksh/sh/msg.c (revision 418903ec)
1 /* @(#)msg.c	1.1 */
2 /*
3  *	UNIX shell
4  *	S. R. Bourne
5  *	Rewritten by David Korn
6  *
7  *	AT&T Bell Laboratories
8  *
9  */
10 
11 
12 #include	<errno.h>
13 #include	"flags.h"
14 #include	"name.h"
15 #include	"defs.h"
16 #include	"sym.h"
17 #include	"builtins.h"
18 #include	"brkincr.h"
19 #include	"test.h"
20 #include	"timeout.h"
21 #include	"history.h"
22 
23 #ifdef MULTIBYTE
24 #include	"national.h"
25 const MSG version 	= "@(#)Version M-06/03/86a";
26 
27 #else
28 const MSG version 	= "@(#)Version 06/03/86a";
29 #endif /* MULTIBYTE */
30 
31 extern struct Bfunction randnum;
32 extern struct Bfunction seconds;
33 
34 /* error messages */
35 const MSG	time_warn	= "\r\n\007shell time out in 60 seconds";
36 const MSG	timed_out	= "timed out waiting for input";
37 const MSG	recursive	= "recursive call";
38 const MSG	noquery		= "no query process";
39 const MSG	nohistory	= "no history file";
40 const MSG	badopt		= "bad option(s)";
41 const MSG	mailmsg		= "you have mail in $_";
42 const MSG	nospace		= "no space";
43 const MSG	synmsg		= "syntax error";
44 
45 const MSG	parexp		= ") expected";
46 const MSG	argexp		= "argument expected";
47 const MSG	endmatch	= "] missing";
48 const MSG	badnum		= "bad number";
49 const MSG	badcooked	= "cannot reset tty to cooked mode";
50 const MSG	badparam	= "parameter null or not set";
51 const MSG	unset		= "parameter not set";
52 const MSG	badsub		= "bad substitution";
53 const MSG	badcreate	= "cannot create";
54 const MSG	restricted	= "restricted";
55 const MSG	nofork		= "cannot fork: too many processes";
56 const MSG	pexists		= "process already exists";
57 const MSG	noswap		= "cannot fork: no swap space";
58 const MSG	piperr		= "cannot make pipe";
59 const MSG	logout		= "Use 'exit' to logout";
60 const MSG	badopen		= "cannot open";
61 const MSG	coredump	= " - core dumped";
62 const MSG	ptrace		= "ptrace: ";
63 const MSG	arglist		= "arg list too long";
64 const MSG	txtbsy		= "text busy";
65 const MSG	toobig		= "too big";
66 const MSG	badexec		= "cannot execute";
67 const MSG	pwderr		= "cannot access parent directories";
68 const MSG	notfound	= " not found";
69 const MSG	nomorefiles	= "too many open files";
70 #ifdef ELIBACC
71 /* shared library error messages */
72 const MSG	libacc 		= "can't access a needed shared library";
73 const MSG	libbad		= "accessing a corrupted shared library";
74 const MSG	libscn		= ".lib section in a.out corrupted";
75 const MSG	libmax		= "attempting to link in too many libs";
76 #endif	/* ELIBACC */
77 const MSG	badfile		= "bad file unit number";
78 const MSG	baddir		= "bad directory";
79 const MSG	badtrap		= "bad trap";
80 const MSG	wtfailed	= "is read only";
81 const MSG	notid		= "invalid identifier";
82 const MSG	badop		= "unknown test operator";
83 const MSG	noalias		= " alias not found";
84 const MSG	is_reserved	= " is a reserved word";
85 const MSG	is_builtin	= " is a shell builtin";
86 const MSG	is_alias	= " is an alias for ";
87 const MSG	is_function	= " is a function";
88 const MSG	is_xalias	= " is an exported alias for ";
89 const MSG	is_talias	= " is a tracked alias for ";
90 const MSG	is_xfunction	= " is an exported function";
91 const MSG	is_		= " is ";
92 const MSG	on_		= "on";
93 const MSG	off_		= "off";
94 const MSG	divzero		= "division by zero";
95 const MSG	subscript	= "subscript out of range";
96 const MSG	argcount	= "bad argument count";
97 const MSG	fn_hdr		= "\n{\n";
98 #ifdef VSH
99 const MSG	big_vi		= "fc -e \"${VISUAL:-${EDITOR:-vi}}\" ";
100 #endif
101 #ifdef JOBS
102 #ifdef BSD
103 const MSG	j_not_tty	= "Warning: no access to tty; thus no job control in this shell...\n";
104 const MSG	j_newtty	= "Switching to new tty driver...\n";
105 const MSG	j_oldtty	= "Reverting to old tty driver...\n";
106 const MSG	j_no_start	= "Cannot start job control\n";
107 #endif
108 const MSG	j_Done		= " Done";
109 const MSG	j_amp		= " &\n";
110 const MSG	j_cpid		= "|&\n";
111 const MSG	j_space		= "|\n      ";
112 const MSG	j_Running	= " Running";
113 const MSG	j_coredump	= "(coredump)";
114 const MSG	j_terminate	= "You have stopped jobs\n";
115 const MSG	j_running	= "You have running jobs\n";
116 const MSG	j_no_job	= "No such job";
117 const MSG	j_no_proc	= "No such process";
118 const MSG	j_perm		= "Permission denied";
119 const MSG	j_kill		= "kill: ";
120 const MSG	kill_usage	= "Arguments should be jobs or process ids";
121 const MSG	j_no_jctl	= "No job control";
122 #endif
123 #ifdef DEVFD
124 const MSG	devfd		= "/dev/fd/";
125 #endif
126 
127 /* string constants */
128 const MSG	test_opts	= "rwxdcbfugkLpsnzt";
129 const MSG	opt_heading	= "Current option settings";
130 const MSG	nullstr		= "";
131 const MSG	sptbnl		= " \t\n";
132 const MSG	defpath		= "/bin:/usr/bin:";
133 const MSG	defedit		= "/bin/ed";
134 const MSG	colon		= ": ";
135 const MSG	minus		= "-";
136 const MSG	endoffile	= "end of file";
137 const MSG	unexpected 	= " unexpected";
138 const MSG	unmatched 	= " unmatched";
139 const MSG	unknown 	= "<job name unknown>";
140 const MSG	let_syntax	= "arithmetic expression ending in single ')' ";
141 const MSG	atline		= " at line ";
142 const MSG	devnull		= "/dev/null";
143 const MSG	execpmsg	= "+ ";
144 const MSG	supprompt	= "# ";
145 const MSG	stdprompt	= "$ ";
146 const MSG	profile		= "${HOME:-.}/.profile";
147 const MSG	sysprofile	= "/etc/profile";
148 const MSG	suid_profile	= "/etc/suid_profile";
149 #ifdef BSD_4_2
150 const MSG	prohibited	= "login setuid/setgid shells prohibited";
151 #endif /* BSD_4_2 */
152 #ifdef SUID_EXEC
153 const MSG	suid_exec	= "/etc/suid_exec";
154 const MSG	devfdNN		= "/dev/fd/??";
155 #endif /* SUID_EXEC */
156 const MSG	histfname	= "/.sh_history";
157 const MSG	unlimited	= "unlimited";
158 #ifdef ECHO_N
159 const MSG	echo_bin	= "/bin/echo";
160 const MSG	echo_opt	= "-R";
161 #endif	/* ECHO_N */
162 const MSG	btest		= "test";
163 const MSG	bkill		= "kill";
164 const MSG	bset		= "set";
165 const MSG	blet		= "let";
166 const MSG	bread		= "read";
167 const MSG	dot		= ".";
168 const MSG	bltfn		= "function ";
169 const MSG	intbase		= "base";
170 const MSG	setpwd		= "PWD=`/bin/pwd 2>/dev/null`";
171 const MSG	t_real		= "\nreal";
172 const MSG	t_user		= "user";
173 const MSG	t_sys		= "sys";
174 
175 #ifdef apollo
176 #undef NULL
177 #define NULL ""
178 #define nullstr	""
179 #endif	/* apollo */
180 
181 /* built in names */ struct name_value node_names[] =
182 {
183 	"PATH",		NULL,
184 	"PS1",		NULL,
185 	"PS2",		"> ",
186 #ifdef apollo
187 	"IFS",		" \t\n",
188 #else
189 	"IFS",		sptbnl,
190 #endif	/* apollo */
191 	"PWD",		NULL,
192 	"HOME",		NULL,
193 	"MAIL",		NULL,
194 	"REPLY",	NULL,
195 	"SHELL",	"/bin/sh",
196 	"EDITOR",	"/bin/ed",
197 #ifdef apollo
198 	"MAILCHECK",	NULL,
199 	"RANDOM",	NULL,
200 #else
201 	"MAILCHECK",	(char*)(&mailchk),
202 	"RANDOM",	(char*)(&randnum),
203 #endif	/* apollo */
204 	"ENV",		NULL,
205 	"HISTFILE",	NULL,
206 	"HISTSIZE",	NULL,
207 	"FCEDIT",	"/bin/ed",
208 	"CDPATH",	NULL,
209 	"MAILPATH",	NULL,
210 	"PS3",		"#? ",
211 	"OLDPWD",	NULL,
212 	"VISUAL",	NULL,
213 	"COLUMNS",	NULL,
214 	"LINES",	NULL,
215 #ifdef apollo
216 	"PPID",		NULL,
217 	"_",		NULL,
218 	"TMOUT",	NULL,
219 	"SECONDS",	NULL,
220 #else
221 	"PPID",		(char*)(&ppid),
222 	"_",		(char*)(&lastarg),
223 	"TMOUT",	(char*)(&timeout),
224 	"SECONDS",	(char*)(&seconds),
225 #endif	/* apollo */
226 #ifdef ACCT
227 	"SHACCT",	NULL,
228 #endif	/* ACCT */
229 	nullstr,	NULL
230 };
231 
232 
233 /* built in aliases - automatically exported */
234 struct name_value alias_names[] =
235 {
236 	"cat",		"/bin/cat",
237 	"chmod",	"/bin/chmod",
238 	"cc",		"/bin/cc",
239 	"cp",		"/bin/cp",
240 	"date",		"/bin/date",
241 	"ed",		"/bin/ed",
242 	"false",	"let 0",
243 	"functions",	"typeset -f",
244 #ifdef BSD
245 	"grep",		"/usr/ucb/grep",
246 #else
247 	"grep",		"/bin/grep",
248 #endif	/* BSD */
249 	"hash",		"alias -t",
250 	"history",	"fc -l",
251 	"integer",	"typeset -i",
252 	"lpr",		"/usr/bin/lpr",
253 	"ls",		"/bin/ls",
254 	"make",		"/bin/make",
255 	"mail",		"/bin/mail",
256 	"mv",		"/bin/mv",
257 	"nohup",	"nohup ",
258 	"pr",		"/bin/pr",
259 	"r",		"fc -e -",
260 	"rm",		"/bin/rm",
261 	"sed",		"/bin/sed",
262 	"sh",		"/bin/sh",
263 	"true",		":",
264 	"type",		"whence -v",
265 #ifdef BSD
266 	"vi",		"/usr/ucb/vi",
267 #else
268 	"vi",		"/usr/bin/vi",
269 #endif	/* BSD */
270 	"who",		"/bin/who",
271 #ifdef JOBS
272 #ifdef BSD
273 	"suspend",	"kill -STOP $$",
274 #endif	/* BSD */
275 #endif	/* JOBS */
276 	nullstr,	0
277 };
278 
279 /* tables */
280 SYSTAB reserved=
281 {
282 		{"case",	CASYM},
283 		{"do",		DOSYM},
284 		{"done",	ODSYM},
285 		{"elif",	EFSYM},
286 		{"else",	ELSYM},
287 		{"esac",	ESSYM},
288 		{"fi",		FISYM},
289 		{"for",		FORSYM},
290 		{"function",	PROCSYM},
291 		{"if",		IFSYM},
292 		{"in",		INSYM},
293 		{"select",	SELSYM},
294 		{"then",	THSYM},
295 		{"time",	TIMSYM},
296 		{"until",	UNSYM},
297 		{"while",	WHSYM},
298 		{"{",		BRSYM},
299 		{"}",		KTSYM},
300 		{nullstr,	0},
301 };
302 
303 /*
304  * The signal numbers go in the low bits and the attributes go in the high bits
305  */
306 
307 SYSTAB	signal_names =
308 {
309 		{"ALRM",	(SIGALRM+1)|(SIGCAUGHT<<SIGBITS)},
310 		{"BUS",		(SIGBUS+1)},
311 #ifdef SIGCHLD
312 		{"CHLD",	(SIGCHLD+1)|(SIGNOSET<<SIGBITS)},
313 #endif	/* SIGCHLD */
314 #ifdef SIGCLD
315 		{"CLD",		(SIGCLD+1)|(SIGNOSET<<SIGBITS)},
316 #endif	/* SIGCLD */
317 #ifdef SIGCONT
318 		{"CONT",	(SIGCONT+1)|(SIGNOSET<<SIGBITS)},
319 #endif	/* SIGCONT */
320 		{"EMT",		(SIGEMT+1)},
321 		{"ERR",		(MAXTRAP+1)|(SIGIGNORE<<SIGBITS)},
322 		{"EXIT",	1|(SIGIGNORE<<SIGBITS)},
323 		{"FPE",		(SIGFPE+1)},
324 		{"HUP",		(SIGHUP+1)},
325 		{"ILL",		(SIGILL+1)|(SIGNOSET<<SIGBITS)},
326 		{"INT",		(SIGINT+1)|(SIGCAUGHT<<SIGBITS)},
327 #ifdef SIGIO
328 		{"IO",		(SIGIO+1)|(SIGNOSET<<SIGBITS)},
329 #endif	/* SIGIO */
330 		{"IOT",		(SIGIOT+1)},
331 		{"KILL",	(SIGKILL+1)|(SIGIGNORE<<SIGBITS)},
332 #ifdef SIGPHONE
333 		{"PHONE",	(SIGPHONE+1)|((SIGNOSET|SIGCAUGHT)<<SIGBITS)},
334 #endif	/* SIGPHONE */
335 		{"PIPE",	(SIGPIPE+1)},
336 #ifdef SIGPOLL
337 		{"POLL",	(SIGPOLL+1)|((SIGNOSET|SIGCAUGHT)<<SIGBITS)},
338 #endif	/* SIGPOLL */
339 #ifdef SIGPROF
340 		{"PROF",	(SIGPROF+1)|(SIGNOSET<<SIGBITS)},
341 #endif	/* SIGPROF */
342 #ifdef SIGPWR
343 # if SIGPWR>0
344 		{"PWR",		(SIGPWR+1)|(SIGNOSET<<SIGBITS)},
345 # endif
346 #endif	/* SIGPWR */
347 		{"QUIT",	(SIGQUIT+1)|((SIGNOSET|SIGCAUGHT)<<SIGBITS)},
348 		{"SEGV",	(SIGSEGV+1)},
349 #ifdef SIGSTOP
350 		{"STOP",	(SIGSTOP+1)|(SIGNOSET<<SIGBITS)},
351 #endif	/* SIGSTOP */
352 		{"SYS",		(SIGSYS+1)|(SIGNOSET<<SIGBITS)},
353 		{"TERM",	(SIGTERM+1)|(SIGCAUGHT<<SIGBITS)},
354 #ifdef SIGTINT
355 		{"TINT",	(SIGTINT+1)|(SIGNOSET<<SIGBITS)},
356 #endif	/* SIGTINT */
357 		{"TRAP",	(SIGTRAP+1)|(SIGNOSET<<SIGBITS)},
358 #ifdef SIGTSTP
359 		{"TSTP",	(SIGTSTP+1)|(SIGNOSET<<SIGBITS)},
360 #endif	/* SIGTSTP */
361 #ifdef SIGTTIN
362 		{"TTIN",	(SIGTTIN+1)|(SIGNOSET<<SIGBITS)},
363 #endif	/* SIGTTIN */
364 #ifdef SIGTTOU
365 		{"TTOU",	(SIGTTOU+1)|(SIGNOSET<<SIGBITS)},
366 #endif	/* SIGTTOU */
367 #ifdef SIGURG
368 		{"URG",		(SIGURG+1)|(SIGNOSET<<SIGBITS)},
369 #endif	/* SIGURG */
370 #ifdef SIGUSR1
371 		{"USR1",	(SIGUSR1+1)},
372 #endif	/* SIGUSR1 */
373 #ifdef SIGUSR2
374 		{"USR2",	(SIGUSR2+1)},
375 #endif	/* SIGUSR2 */
376 #ifdef SIGVTALRM
377 		{"VTALRM",	(SIGVTALRM+1)|(SIGNOSET<<SIGBITS)},
378 #endif	/* SIGVTALRM */
379 #ifdef SIGWINCH
380 		{"WINCH",	(SIGWINCH+1)|((SIGNOSET|SIGCAUGHT)<<SIGBITS)},
381 #endif	/* SIGWINCH */
382 #ifdef SIGWIND
383 		{"WIND",	(SIGWIND+1)|((SIGNOSET|SIGCAUGHT)<<SIGBITS)},
384 #endif	/* SIGWIND */
385 #ifdef SIGXCPU
386 		{"XCPU",	(SIGXCPU+1)|(SIGNOSET<<SIGBITS)},
387 #endif	/* SIGXCPU */
388 #ifdef SIGXFSZ
389 		{"XFSZ",	(SIGXFSZ+1)|(SIGNOSET<<SIGBITS)},
390 #endif	/* SIGXFSZ */
391 		{nullstr,	0}
392 };
393 
394 SYSTAB	sig_messages =
395 {
396 		{"Alarm call",			(SIGALRM+1)},
397 		{"Bus error",			(SIGBUS+1)},
398 #ifdef SIGCHLD
399 		{"Child stopped or terminated",	(SIGCHLD+1)},
400 #endif	/* SIGCHLD */
401 #ifdef SIGCLD
402 		{"Death of Child", 		(SIGCLD+1)},
403 #endif	/* SIGCLD */
404 #ifdef SIGCONT
405 		{"Stopped process continued",	(SIGCONT+1)},
406 #endif	/* SIGCONT */
407 		{"EMT trap",			(SIGEMT+1)},
408 		{"Floating exception",		(SIGFPE+1)},
409 		{"Hangup",			(SIGHUP+1)},
410 		{"Illegal instruction",		(SIGILL+1)},
411 #ifdef JOBS
412 		{"Interrupt",			(SIGINT+1)},
413 #else
414 		{nullstr,			(SIGINT+1)},
415 #endif	/* JOBS */
416 #ifdef SIGIO
417 		{"IO signal",			(SIGIO+1)},
418 #endif	/* SIGIO */
419 		{"abort",			(SIGIOT+1)},
420 		{"Killed",			(SIGKILL+1)},
421 		{"Quit",			(SIGQUIT+1)},
422 #ifdef JOBS
423 		{"Broken Pipe",			(SIGPIPE+1)},
424 #else
425 		{nullstr,			(SIGPIPE+1)},
426 #endif	/* JOBS */
427 #ifdef SIGPROF
428 		{"Profiling time alarm",	(SIGPROF+1)},
429 #endif	/* SIGPROF */
430 #ifdef SIGPWR
431 # if SIGPWR>0
432 		{"Power fail",			(SIGPWR+1)},
433 # endif
434 #endif	/* SIGPWR */
435 		{"Memory fault",		(SIGSEGV+1)},
436 #ifdef SIGSTOP
437 		{"Stopped (signal)",		(SIGSTOP+1)},
438 #endif	/* SIGSTOP */
439 		{"Bad system call", 		(SIGSYS+1)},
440 		{"Terminated",			(SIGTERM+1)},
441 #ifdef SIGTINT
442 #ifdef JOBS
443 		{"Interrupt",			(SIGTINT+1)},
444 #else
445 		{nullstr,			(SIGTINT+1)},
446 #endif	/* JOBS */
447 #endif	/* SIGTINT */
448 		{"Trace/BPT trap",		(SIGTRAP+1)},
449 #ifdef SIGTSTP
450 		{"Stopped",			(SIGTSTP+1)},
451 #endif	/* SIGTSTP */
452 #ifdef SIGTTIN
453 		{"Stopped (tty input)",		(SIGTTIN+1)},
454 #endif	/* SIGTTIN */
455 #ifdef SIGTTOU
456 		{"Stopped(tty output)",		(SIGTTOU+1)},
457 #endif	/* SIGTTOU */
458 #ifdef SIGURG
459 		{"Socket interrupt",		(SIGURG+1)},
460 #endif	/* SIGURG */
461 #ifdef SIGUSR1
462 		{"User signal 1",		(SIGUSR1+1)},
463 #endif	/* SIGUSR1 */
464 #ifdef SIGUSR2
465 		{"User signal 2",		(SIGUSR2+1)},
466 #endif	/* SIGUSR2 */
467 #ifdef SIGVTALRM
468 		{"Virtual time alarm",		(SIGVTALRM+1)},
469 #endif	/* SIGVTALRM */
470 #ifdef SIGWINCH
471 		{"Window size change", 		(SIGWINCH+1)},
472 #endif	/* SIGWINCH */
473 #ifdef SIGXCPU
474 		{"Exceeded CPU time limit",	(SIGXCPU+1)},
475 #endif	/* SIGXCPU */
476 #ifdef SIGXFSZ
477 		{"Exceeded file size limit",	(SIGXFSZ+1)},
478 #endif	/* SIGXFSZ */
479 		{nullstr,	0}
480 };
481 
482 SYSTAB option_flags=
483 {
484 	{"allexport",		Allexp},
485 	{"bgnice",		Bgnice},
486 	{"emacs",		Emacs},
487 	{"errexit",		Errflg},
488 	{"gmacs",		Gmacs},
489 	{"ignoreeof",		Noeof},
490 #ifdef apollo
491 	{"inprocess",		Inproc},
492 #endif	/* apollo */
493 	{"interactive",		Intflg},
494 	{"keyword",		Keyflg},
495 	{"markdirs",		Markdir},
496 	{"monitor",		Monitor},
497 	{"noexec",		Noexec},
498 	{"noglob",		Noglob},
499 	{"nounset",		Noset},
500 	{"protected",		Privmod},
501 	{"restricted",		Rshflg},
502 	{"trackall",		Hashall},
503 	{"verbose",		Readpr},
504 	{"vi",			Editvi},
505 	{"viraw",		Viraw},
506 	{"xtrace",		Execpr},
507 	{nullstr,		0}
508 };
509 
510 #ifdef BSD
511 # ifndef apollo
512 char  *limit_names[] =
513 {
514 	"time(seconds)   ",
515 	"memory(kbytes)  ",
516 	"data(kbytes)    ",
517 	"stack(kbytes)   ",
518 	"file(blocks)    ",
519 	"coredump(blocks)"
520 };
521 # endif /* apollo */
522 #endif	/* BSD */
523 
524 SYSTAB	commands=
525 {
526 		{".",		SYSDOT},
527 		{":",		SYSNULL},
528 		{"[",		SYSTEST},
529 		{ "alias",	SYSALIAS},
530 #ifdef JOBS
531 #if BSD || SXT
532 		{ "bg",		SYSBG},
533 #endif	/* BSD */
534 #endif	/* JOBS */
535 		{"break",	SYSBREAK},
536 		{"cd",		SYSCD},
537 		{"continue",	SYSCONT},
538 		{"echo",	SYSECHO},
539 		{"exec",	SYSEXEC},
540 		{"exit",	SYSEXIT},
541 		{"export",	SYSXPORT},
542 		{"eval",	SYSEVAL},
543 		{"fc",		SYSFC},
544 #ifdef JOBS
545 # if BSD || SXT
546 		{"fg",		SYSFG},
547 # endif /* BSD */
548 #endif	/* JOBS */
549 #ifdef apollo
550 		{"inlib",	SYSINLIB},
551 		{"inprocess",	SYSINPROCESS},
552 #endif	/* apollo */
553 #ifdef JOBS
554 		{"jobs",	SYSJOBS},
555 		{"kill",	SYSKILL},
556 #endif	/* JOBS */
557 		{"let",		SYSLET},
558 		{"login",	SYSLOGIN},
559 #ifndef BSD
560 		{"newgrp",	SYSLOGIN},
561 #endif	/* BSD */
562 		{"print",	SYSPRINT},
563 		{"pwd",		SYSPWD},
564 		{"read",	SYSREAD},
565 		{"readonly",	SYSRDONLY},
566 		{"return",	SYSRETURN},
567 		{"set",		SYSSET},
568 		{"shift",	SYSSHFT},
569 		{"test",	SYSTEST},
570 		{"times",	SYSTIMES},
571 		{"trap",	SYSTRAP},
572 		{"typeset",	SYSTYPESET},
573 		{"ulimit",	SYSULIMIT},
574 		{"umask",	SYSUMASK},
575 		{"unalias",	SYSUNALIAS},
576 		{"unset",	SYSUNSET},
577 		{"wait",	SYSWAIT},
578 		{"whence",	SYSWHENCE},
579 		{nullstr,		0}
580 };
581 
582 SYSTAB	testops =
583 {
584 		{"!=",		TEST_SNE},
585 		{"-a",		TEST_AND},
586 		{"-ef",		TEST_EF},
587 		{"-eq",		TEST_EQ},
588 		{"-ge",		TEST_GE},
589 		{"-gt",		TEST_GT},
590 		{"-le",		TEST_LE},
591 		{"-lt",		TEST_LT},
592 		{"-ne",		TEST_NE},
593 		{"-nt",		TEST_NT},
594 		{"-o",		TEST_OR},
595 		{"-ot",		TEST_OT},
596 		{"=",		TEST_SEQ},
597 		{nullstr,	0}
598 };
599 
600 SYSTAB	attributes =
601 {
602 		{"export",	N_EXPORT},
603 		{"readonly",	N_RDONLY},
604 		{"tagged",	T_FORM},
605 #ifdef apollo
606 		{" filename",	A_FLAG},
607 #endif	/* apollo */
608 		{"long",	(L_FLAG|INT_GER)},
609 		{"unsigned",	(UN_SIGN|INT_GER)},
610 		{"function",	(BLT_NOD|INT_GER)},
611 		{"integer",	INT_GER},
612 		{"lowercase",	U_TO_L},
613 		{"zerofill",	Z_FILL},
614 		{"leftjust",	L_JUST},
615 		{"rightjust",	R_JUST},
616 		{"uppercase",	L_TO_U},
617 		{nullstr,	0}
618 };
619 
620 
621 #ifdef BSD
622 int tty_speeds[] = {0, 50, 75, 110, 134, 150, 200, 300,
623 			600,1200,1800,2400,9600,19200,0};
624 #endif /* BSD */
625 
626 #ifdef MULTIBYTE
627 char int_charsize[] =
628 {
629 	1, CCS1_IN_SIZE, CCS2_IN_SIZE, CCS3_IN_SIZE,	/* input sizes */
630 	1, CCS1_OUT_SIZE, CCS2_OUT_SIZE, CCS3_OUT_SIZE	/* output widths */
631 };
632 #endif /* MULTIBYTE */
633 
634