xref: /titanic_44/usr/src/lib/libshell/common/data/msg.c (revision 01ef659d9b1ead333ef0adc346e7051f7eae7520)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1982-2008 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                  Common Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *            http://www.opensource.org/licenses/cpl1.0.txt             *
11 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                  David Korn <dgk@research.att.com>                   *
18 *                                                                      *
19 ***********************************************************************/
20 #pragma prototyped
21 /*
22  *	UNIX shell
23  *	S. R. Bourne
24  *	Rewritten by David Korn
25  *
26  *	AT&T Labs
27  *
28  */
29 
30 #include	<ast.h>
31 #include	<errno.h>
32 #include	"defs.h"
33 #include	"path.h"
34 #include	"io.h"
35 #include	"shlex.h"
36 #include	"timeout.h"
37 #include	"history.h"
38 #include	"builtins.h"
39 #include	"jobs.h"
40 #include	"edit.h"
41 
42 /* error messages */
43 const char e_timewarn[]		= "\r\n\ashell will timeout in 60 seconds due to inactivity";
44 const char e_runvi[]		= "\\hist -e \"${VISUAL:-${EDITOR:-vi}}\" ";
45 const char e_timeout[]		= "timed out waiting for input";
46 const char e_mailmsg[]		= "you have mail in $_";
47 const char e_query[]		= "no query process";
48 const char e_history[]		= "no history file";
49 const char e_histopen[]		= "history file cannot open";
50 const char e_option[]		= "%s: bad option(s)";
51 const char e_toomany[]		= "open file limit exceeded";
52 const char e_argtype[]		= "invalid argument of type %c";
53 const char e_formspec[]		= "%c: unknown format specifier";
54 const char e_badregexp[]	= "%s: invalid regular expression";
55 const char e_number[]		= "%s: bad number";
56 const char e_badlocale[]	= "%s: unknown locale";
57 const char e_nullset[]		= "%s: parameter null";
58 const char e_notset[]		= "%s: parameter not set";
59 const char e_noparent[]		= "%s: no parent";
60 const char e_subst[]		= "%s: bad substitution";
61 const char e_create[]		= "%s: cannot create";
62 const char e_tmpcreate[]	= "cannot create temporary file";
63 const char e_restricted[]	= "%s: restricted";
64 const char e_pfsh[]		= "%s: disabled in profile shell";
65 const char e_pexists[]		= "process already exists";
66 const char e_exists[]		= "%s: file already exists";
67 const char e_pipe[]		= "cannot create pipe";
68 const char e_alarm[]		= "cannot set alarm";
69 const char e_open[]		= "%s: cannot open";
70 const char e_notseek[]		= "%s: not seekable";
71 const char e_badseek[]		= "%s: invalid seek offset";
72 const char e_badpattern[]	= "%s: invalid shell pattern";
73 const char e_noread[]		= "%s: pattern seek requires read access";
74 const char e_logout[]		= "Use 'exit' to terminate this shell";
75 const char e_exec[]		= "%s: cannot execute";
76 const char e_pwd[]		= "cannot access parent directories";
77 const char e_found[]		= "%s: not found";
78 const char e_defined[]		= "%s: function not defined";
79 const char e_nointerp[]		= "%s: interpreter not found";
80 const char e_subscript[]	= "%s: subscript out of range";
81 const char e_toodeep[]		= "%s: recursion too deep";
82 const char e_access[]		= "permission denied";
83 #ifdef _cmd_universe
84     const char e_nouniverse[]	= "universe not accessible";
85 #endif /* _cmd_universe */
86 const char e_direct[]		= "bad directory";
87 const char e_file[]		= "%s: bad file unit number";
88 const char e_trap[]		= "%s: bad trap";
89 const char e_readonly[]		= "%s: is read only";
90 const char e_badfield[]		= "%d: negative field size";
91 const char e_ident[]		= "%s: is not an identifier";
92 const char e_badname[]		= "%s: invalid name";
93 const char e_varname[]		= "%s: invalid variable name";
94 const char e_badfun[]		= "%s: invalid function name";
95 const char e_aliname[]		= "%s: invalid alias name";
96 const char e_badexport[]	= "%s: invalid export name";
97 const char e_badref[]		= "%s: reference variable cannot be an array";
98 const char e_noarray[]		= "%s: cannot be an array";
99 const char e_badappend[]	= "%s: invalid append to associative array";
100 const char e_noref[]		= "%s: no reference name";
101 const char e_selfref[]		= "%s: invalid self reference";
102 const char e_noalias[]		= "%s: alias not found\n";
103 const char e_format[]		= "%s: bad format";
104 const char e_redef[]		= "%s: type cannot be redefined";
105 const char e_required[]		= "%s: is a required element of %s";
106 const char e_badtformat[]	= "%c: bad format character in time format";
107 const char e_nolabels[]		= "%s: label not implemented";
108 const char e_notimp[]		= "%s: not implemented";
109 const char e_notelem[]		= "%.*s: is not an element of %s";
110 const char e_notenum[]		= "%s: not an enumeration type";
111 const char e_unknowntype[]	= "%.*s: unknown type";
112 const char e_nosupport[]	= "not supported";
113 const char e_badrange[]		= "%d-%d: invalid range";
114 const char e_eneedsarg[]	= "-e - requires single argument";
115 const char e_badbase[]		= "%s unknown base";
116 const char e_loop[]		= "%s: would cause loop";
117 const char e_overlimit[]	= "%s: limit exceeded";
118 const char e_badsyntax[]	= "incorrect syntax";
119 const char e_badwrite[]		= "write to %d failed";
120 const char e_on	[]		= "on";
121 const char e_off[]		= "off";
122 const char is_reserved[]	= " is a keyword";
123 const char is_builtin[]		= " is a shell builtin";
124 const char is_spcbuiltin[]	= " is a special shell builtin";
125 const char is_builtver[]	= "is a shell builtin version of";
126 const char is_alias[]		= "%s is an alias for ";
127 const char is_xalias[]		= "%s is an exported alias for ";
128 const char is_talias[]		= "is a tracked alias for";
129 const char is_function[]	= " is a function";
130 const char is_ufunction[]	= " is an undefined function";
131 #ifdef JOBS
132 #   ifdef SIGTSTP
133 	const char e_newtty[]	= "Switching to new tty driver...";
134 	const char e_oldtty[]	= "Reverting to old tty driver...";
135 	const char e_no_start[]	= "Cannot start job control";
136 #   endif /*SIGTSTP */
137     const char e_no_jctl[]	= "No job control";
138     const char e_terminate[]	= "You have stopped jobs";
139     const char e_done[]		= " Done";
140     const char e_nlspace[]	= "\n      ";
141     const char e_running[]	= " Running";
142     const char e_ambiguous[]	= "%s: Ambiguous";
143     const char e_jobsrunning[]	= "You have running jobs";
144     const char e_no_job[]	= "no such job";
145     const char e_no_proc[]	= "no such process";
146     const char e_jobusage[]	= "%s: Arguments must be %%job or process ids";
147 #endif /* JOBS */
148 const char e_coredump[]		= "(coredump)";
149 const char e_alphanum[]		= "[_[:alpha:]]*([_[:alnum:]])";
150 const char e_devfdNN[]		= "/dev/fd/+([0-9])";
151 const char e_devfdstd[]		= "/dev/@(fd/+([0-9])|std@(in|out|err))";
152 const char e_signo[]		= "Signal %d";
153 #if SHOPT_FS_3D
154     const char e_cantget[]	= "cannot get %s";
155     const char e_cantset[]	= "cannot set %s";
156     const char e_mapping[]	= "mapping";
157     const char e_versions[]	= "versions";
158 #endif /* SHOPT_FS_3D */
159 
160 /* string constants */
161 const char e_heading[]		= "Current option settings";
162 const char e_sptbnl[]		= " \t\n";
163 const char e_defpath[]		= "/bin:/usr/bin:";
164 const char e_defedit[]		= "/bin/ed";
165 const char e_unknown []		= "<command unknown>";
166 const char e_devnull[]		= "/dev/null";
167 const char e_traceprompt[]	= "+ ";
168 const char e_supprompt[]	= "# ";
169 const char e_stdprompt[]	= "$ ";
170 const char e_profile[]		= "$HOME/.profile";
171 const char e_sysprofile[]	= "/etc/profile";
172 const char e_suidprofile[]	= "/etc/suid_profile";
173 #if SHOPT_SYSRC
174 const char e_sysrc[]		= "/etc/ksh.kshrc";
175 #endif
176 #if SHOPT_BASH
177 #if SHOPT_SYSRC
178 const char e_bash_sysrc[]	= "/etc/bash.bashrc";
179 #endif
180 const char e_bash_rc[]		= "$HOME/.bashrc";
181 const char e_bash_login[]	= "$HOME/.bash_login";
182 const char e_bash_logout[]	= "$HOME/.bash_logout";
183 const char e_bash_profile[]	= "$HOME/.bash_profile";
184 #endif
185 const char e_crondir[]		= "/usr/spool/cron/atjobs";
186 const char e_prohibited[]	= "login setuid/setgid shells prohibited";
187 #if SHOPT_SUID_EXEC
188    const char e_suidexec[]	= "/etc/suid_exec";
189 #endif /* SHOPT_SUID_EXEC */
190 const char hist_fname[]		= "/.sh_history";
191 const char e_dot[]		= ".";
192 const char e_envmarker[]	= "A__z";
193 const char e_timeformat[]	= "\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS";
194 const char e_dict[]		= "libshell";
195