if (strcmp (input_filename, "-") == 0)
{
- input_filename = "standard input";
+ input_filename = _("standard input");
in_stream = stdin;
have_read_stdin = 1;
}
{
if (line[line_length - 1] == '\n')
line[line_length - 1] = '\0';
- error (0, 0, "invalid date `%s'", line);
+ error (0, 0, _("invalid date `%s'"), line);
status = 1;
}
else
}
if (have_read_stdin && fclose (stdin) == EOF)
- error (2, errno, "standard input");
+ error (2, errno, _("standard input"));
if (line != NULL)
free (line);
if (set_date && print_date)
{
error (0, 0,
- "the options to print and set the time may not be used together");
+ _("the options to print and set the time may not be used together"));
usage (1);
}
if (n_args > 1)
{
- error (0, 0, "too many non-option arguments");
+ error (0, 0, _("too many non-option arguments"));
usage (1);
}
if ((set_date || print_date || batch_file != NULL)
&& n_args == 1 && argv[optind][0] != '+')
{
- error (0, 0, "\
+ error (0, 0, _("\
when using the print, set time, or batch options, any\n\
-non-option argument must be a format string beginning with `+'");
+non-option argument must be a format string beginning with `+'"));
usage (1);
}
{
if (set_date || print_date)
{
- error (0, 0, "\
-neither print nor set options may be used when reading dates from a file");
+ error (0, 0, _("\
+neither print nor set options may be used when reading dates from a file"));
usage (1);
}
status = batch_convert (batch_file,
{
/* Prepare to print the current date/time. */
print_date = 1;
- datestr = "undefined";
+ datestr = _("undefined");
time (&when);
format = (n_args == 1 ? argv[optind] + 1 : NULL);
}
}
if (when == -1)
- error (1, 0, "invalid date `%s'", datestr);
+ error (1, 0, _("invalid date `%s'"), datestr);
if (set_date)
{
/* Set the system clock to the specified date, then regardless of
the success of that operation, format and print that date. */
if (stime (&when) == -1)
- error (0, errno, "cannot set date");
+ error (0, errno, _("cannot set date"));
}
show_date (format, when);
}
if (fclose (stdout) == EOF)
- error (2, errno, "write error");
+ error (2, errno, _("write error"));
exit (status);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s [OPTION]... [+FORMAT]\n\
or: %s [OPTION] [MMDDhhmm[[CC]YY][.ss]]\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
Display the current time in the given FORMAT, or set the system date.\n\
\n\
-d, --date=STRING display time described by STRING, not `now'\n\
-u, --utc, --universal print or set Coordinated Universal Time\n\
--help display this help and exit\n\
--version output version information and exit\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
FORMAT controls the output. The only valid option for the second form\n\
specifies Coordinated Universal Time. Interpreted sequences are:\n\
\n\
`-' (hyphen) do not pad the field\n\
`_' (underscore) pad the field with spaces\n\
-");
+"));
}
exit (status);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s NAME\n\
or: %s OPTION\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
Print NAME with its trailing /component removed; if NAME contains no /'s,\n\
output `.' (meaning the current directory).\n\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
-");
+"));
}
exit (status);
}
if (argc != 2)
{
- error (0, 0, "too %s arguments", argc < 2 ? "few" : "many");
+ error (0, 0, _("too %s arguments"), argc < 2 ? _("few") : _("many"));
usage (1);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [STRING]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [STRING]...\n"), program_name);
+ printf (_("\
Echo the STRING(s) to standard output.\n\
\n\
-n do not output the trailing newline\n\
\\r carriage return\n\
\\t horizontal tab\n\
\\v vertical tab\n\
-");
+"));
}
exit (status);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n",
+ printf (_("\
+Usage: %s [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n"),
program_name);
- printf ("\
+ printf (_("\
Set each NAME to VALUE in the environment and run COMMAND.\n\
\n\
-u, --unset=NAME remove variable from the environment\n\
--version output version information and exit\n\
\n\
A mere - implies -i. If no COMMAND, print the resulting environment.\n\
-");
+"));
}
exit (status);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s EXPRESSION\n\
or: %s OPTION\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
\n\
-");
- printf ("\
+"));
+ printf (_("\
Print the value of EXPRESSION to standard output. A blank line below\n\
separates increasing precedence groups. EXPRESSION may be:\n\
\n\
length STRING length of STRING\n\
\n\
( EXPRESSION ) value of EXPRESSION\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Beware that many operators need to be escaped or quoted for shells.\n\
Comparisons are arithmetic if both ARGs are numbers, else lexicographical.\n\
Pattern matches return the string matched between \\( and \\) or null; if\n\
\\( and \\) are not used, they return the number of characters matched or 0.\n\
-");
+"));
}
exit (status);
}
if (argc == 1)
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
v = eval ();
if (!nomoreargs ())
- error (2, 0, "syntax error");
+ error (2, 0, _("syntax error"));
printv (v);
exit (null (v));
int name (l, r) VALUE *l; VALUE *r; \
{ \
if (!toarith (l) || !toarith (r)) \
- error (2, 0, "non-numeric argument"); \
+ error (2, 0, _("non-numeric argument")); \
return l->u.i op r->u.i; \
}
int name (l, r) VALUE *l; VALUE *r; \
{ \
if (!toarith (l) || !toarith (r)) \
- error (2, 0, "non-numeric argument"); \
+ error (2, 0, _("non-numeric argument")); \
if (r->u.i == 0) \
- error (2, 0, "division by zero"); \
+ error (2, 0, _("division by zero")); \
return l->u.i op r->u.i; \
}
trace ("eval7");
#endif
if (nomoreargs ())
- error (2, 0, "syntax error");
+ error (2, 0, _("syntax error"));
if (nextarg ("("))
{
args++;
v = eval ();
if (!nextarg (")"))
- error (2, 0, "syntax error");
+ error (2, 0, _("syntax error"));
args++;
return v;
}
if (nextarg (")"))
- error (2, 0, "syntax error");
+ error (2, 0, _("syntax error"));
return str_value (*args++);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s [NUMBER]\n\
or: %s OPTION\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
-");
+"));
}
exit (status);
}
if (argc > 2)
{
- error (0, 0, "too many arguments");
+ error (0, 0, _("too many arguments"));
usage (1);
}
}
else
{
- fprintf (stderr, "Usage: %s [number]\n", argv[0]);
+ fprintf (stderr, _("Usage: %s [number]\n"), argv[0]);
exit (1);
}
exit (0);
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s [NAME]\n\
or: %s OPTION\n\
Print the hostname of the current system.\n\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
-"
+")
, program_name, program_name);
}
exit (status);
}
#else
if (argc == 2)
- error (1, 0, "cannot set hostname; this system lacks the functionality");
+ error (1, 0,
+ _("cannot set hostname; this system lacks the functionality"));
#endif
if (argc == 1)
{
hostname = xgethostname ();
if (hostname == NULL)
- error (1, errno, "cannot determine hostname");
+ error (1, errno, _("cannot determine hostname"));
printf ("%s\n", hostname);
}
else
{
- error (2, 0, "too many arguments");
+ error (2, 0, _("too many arguments"));
usage (1);
}
usage (0);
if (just_user + just_group + just_group_list > 1)
- error (1, 0, "cannot print only user and only group");
+ error (1, 0, _("cannot print only user and only group"));
if (just_user + just_group + just_group_list == 0 && (use_real || use_name))
- error (1, 0, "cannot print only names or real IDs in default format");
+ error (1, 0, _("cannot print only names or real IDs in default format"));
if (argc - optind > 1)
usage (1);
{
struct passwd *pwd = getpwnam (argv[optind]);
if (pwd == NULL)
- error (1, 0, "%s: No such user", argv[optind]);
+ error (1, 0, _("%s: No such user"), argv[optind]);
ruid = euid = pwd->pw_uid;
rgid = egid = pwd->pw_gid;
}
ngroups = getugroups (NGROUPS_MAX, groups, username);
if (ngroups < 0)
{
- error (0, errno, "cannot get supplemental group list");
+ error (0, errno, _("cannot get supplemental group list"));
problems++;
free (groups);
return;
ngroups = getugroups (NGROUPS_MAX, groups, username);
if (ngroups < 0)
{
- error (0, errno, "cannot get supplemental group list");
+ error (0, errno, _("cannot get supplemental group list"));
problems++;
free (groups);
return;
}
if (ngroups > 0)
- fputs (" groups=", stdout);
+ fputs (_(" groups="), stdout);
for (i = 0; i < ngroups; i++)
{
if (i > 0)
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [USERNAME]\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [USERNAME]\n"), program_name);
+ printf (_("\
Print information for USERNAME, or the current user.\n\
\n\
-g, --group print only the group ID\n\
--version output version information and exit\n\
\n\
Without any OPTION, print some useful set of identified information.\n\
-");
+"));
}
exit (status);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]...\n"), program_name);
+ printf (_("\
Print the name of the current user.\n\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
-");
+"));
}
exit (status);
}
exit (0);
}
/* POSIX.2 prohibits using a fallback technique. */
- fprintf (stderr,"%s: no login name\n", argv[0]);
+ fprintf (stderr,_("%s: no login name\n"), argv[0]);
exit (1);
}
if (s[0] == '-' && s[1] == '-' && ISDIGIT (s[2]))
{
if (!isinteger (&s[2]))
- error (1, 0, "invalid option `%s'", s);
+ error (1, 0, _("invalid option `%s'"), s);
minusflag = 1;
adjustment = atoi (&s[2]);
case 'n':
if (!isinteger (optarg))
- error (1, 0, "invalid priority `%s'", optarg);
+ error (1, 0, _("invalid priority `%s'"), optarg);
adjustment = atoi (optarg);
adjustment_given = 1;
break;
{
if (adjustment_given)
{
- error (0, 0, "a command must be given with an adjustment");
+ error (0, 0, _("a command must be given with an adjustment"));
usage (1);
}
/* No command given; print the priority. */
errno = 0;
current_priority = GET_PRIORITY ();
if (current_priority == -1 && errno != 0)
- error (1, errno, "cannot get priority");
+ error (1, errno, _("cannot get priority"));
printf ("%d\n", current_priority);
exit (0);
}
errno = 0;
current_priority = GET_PRIORITY ();
if (current_priority == -1 && errno != 0)
- error (1, errno, "cannot get priority");
+ error (1, errno, _("cannot get priority"));
if (setpriority (PRIO_PROCESS, 0, current_priority + adjustment))
#else
if (nice (adjustment) == -1)
#endif
- error (1, errno, "cannot set priority");
+ error (1, errno, _("cannot set priority"));
execvp (argv[optind], &argv[optind]);
error (errno == ENOENT ? 127 : 126, errno, "%s", argv[optind]);
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [COMMAND [ARG]...]\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [COMMAND [ARG]...]\n"), program_name);
+ printf (_("\
Run COMMAND with an adjusted scheduling priority.\n\
With no COMMAND, print the current scheduling priority. ADJUST is 10\n\
by default. Range goes from -20 (highest priority) to 19 (lowest).\n\
-ADJUST increment priority by ADJUST first\n\
-n, --adjustment=ADJUST same as -ADJUST\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
if (optind == argc)
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
for (p = path; *p; ++p)
if (portable_chars[(const unsigned char) *p] == 0)
{
- error (0, 0, "path `%s' contains nonportable character `%c'",
+ error (0, 0, _("path `%s' contains nonportable character `%c'"),
path, *p);
return 0;
}
if (!S_ISDIR (stats.st_mode))
{
- error (0, 0, "`%s' is not a directory", path);
+ error (0, 0, _("`%s' is not a directory"), path);
return 0;
}
if (access (path, X_OK) != 0)
{
if (errno == EACCES)
- error (0, 0, "directory `%s' is not searchable", path);
+ error (0, 0, _("directory `%s' is not searchable"), path);
else
error (0, errno, "%s", path);
return 0;
name_max = _POSIX_NAME_MAX;
if (length > name_max)
{
- error (0, 0, "name `%s' has length %d; exceeds limit of %d",
+ error (0, 0, _("name `%s' has length %d; exceeds limit of %d"),
start, length, name_max);
free (parent);
return 1;
free (parent);
if (strlen (path) > path_max)
{
- error (0, 0, "path `%s' has length %d; exceeds limit of %d",
+ error (0, 0, _("path `%s' has length %d; exceeds limit of %d"),
path, strlen (path), path_max);
return 1;
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... NAME...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... NAME...\n"), program_name);
+ printf (_("\
Diagnose unportable constructs in NAME.\n\
\n\
-p, --portability check for all POSIX systems, not only this one\n\
--help display this help and exit\n\
--version output version information and exit\n\
-");
+"));
}
exit (status);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [VARIABLE]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [VARIABLE]...\n"), program_name);
+ printf (_("\
If no environment VARIABLE specified, print them all.\n\
\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
}
if (ferror (stdout) || fclose (stdout) == EOF)
- error (2, errno, "standard output");
+ error (2, errno, _("standard output"));
exit (exit_status);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s FORMAT [ARGUMENT]...\n\
or: %s OPTION\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
Print ARGUMENT(s) according to FORMAT.\n\
\n\
--help display this help and exit\n\
\n\
and all C format specifications ending with one of diouxXfeEgGcs, with\n\
ARGUMENTs converted to proper type first. Variable widths are handled.\n\
-");
+"));
}
exit (status);
}
if (argc == 1)
{
- fprintf (stderr, "Usage: %s format [argument...]\n", program_name);
+ fprintf (stderr, _("Usage: %s format [argument...]\n"), program_name);
exit (1);
}
++direc_length;
}
if (!strchr ("diouxXfeEgGcs", *f))
- error (1, 0, "%%%c: invalid directive", *f);
+ error (1, 0, _("%%%c: invalid directive"), *f);
++direc_length;
if (argc > 0)
{
++esc_length, ++p)
esc_value = esc_value * 16 + hextobin (*p);
if (esc_length == 0)
- error (1, 0, "missing hexadecimal number in escape");
+ error (1, 0, _("missing hexadecimal number in escape"));
putchar (esc_value);
}
else if (*p == '0')
else if (strchr ("\"\\abcfnrtv", *p))
print_esc_char (*p++);
else
- error (1, 0, "\\%c: invalid escape", *p);
+ error (1, 0, _("\\%c: invalid escape"), *p);
return p - escstart - 1;
}
else if (*end)
{
if (s == end)
- error (0, 0, "%s: expected a numeric value", s);
+ error (0, 0, _("%s: expected a numeric value"), s);
else
- error (0, 0, "%s: value not completely converted", s);
+ error (0, 0, _("%s: value not completely converted"), s);
exit_status = 1;
}
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]\n"), program_name);
+ printf (_("\
Print the full filename of the current working directory.\n\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
-");
+"));
}
exit (status);
}
parse_long_options (argc, argv, "pwd", version_string, usage);
if (argc != 1)
- error (0, 0, "ignoring non-option arguments");
+ error (0, 0, _("ignoring non-option arguments"));
wd = xgetcwd ();
if (wd == NULL)
- error (1, errno, "cannot get current directory");
+ error (1, errno, _("cannot get current directory"));
printf ("%s\n", wd);
exit (0);
int status;
{
if (status != 0)
- (void) fprintf (stderr, "Try `%s --help' for more information.\n",
+ (void) fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- (void) printf ("\
+ (void) printf (_("\
Usage: %s [OPTION]... [from [step]] to\n\
-", program_name);
- (void) printf ("\
+"), program_name);
+ (void) printf (_("\
\n\
-f, --format FORMAT use printf(3) style FORMAT (default: %%g)\n\
--help display this help and exit\n\
FROM, STEP, TO are interpreted as floating point. STEP should be > 0 if\n\
FROM is smaller than TO and vice versa. When given, the FORMAT argument\n\
must contain exactly one of the float output formats %%e, %%f, or %%g.\n\
-");
+"));
}
exit (status);
}
if (optind >= argc)
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
/* NOTREACHED */
}
if (format_str != NULL && equal_width)
{
- error (0, 0,
- "format string may not be specified when printing equal width strings");
+ error (0, 0, _("\
+format string may not be specified when printing equal width strings"));
usage (1);
}
{
if (!check_format (format_str))
{
- error (0, 0, "invalid format string: `%s'", format_str);
+ error (0, 0, _("invalid format string: `%s'"), format_str);
usage (1);
}
}
ret_val = strtod (arg, &end_ptr);
if (end_ptr == arg || *end_ptr != '\0')
{
- error (0, 0, "invalid float argument: %s", arg);
+ error (0, 0, _("invalid float argument: %s"), arg);
usage (1);
/* NOTREACHED */
}
{
if (step >= 0)
{
- error (0, 0, "invalid increment: %g", step);
+ error (0, 0, _("invalid increment: %g"), step);
usage (1);
/* NOTREACHED */
}
{
if (step <= 0)
{
- error (0, 0, "invalid increment: %g", step);
+ error (0, 0, _("invalid increment: %g"), step);
usage (1);
/* NOTREACHED */
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... NUMBER[SUFFIX]\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... NUMBER[SUFFIX]\n"), program_name);
+ printf (_("\
Pause for NUMBER seconds.\n\
SUFFIX may be s to keep seconds, m for minutes, h for hours or d for days.\n\
\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
if (argc == 1)
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
}
if (*p)
- error (1, 0, "invalid time interval `%s'", s);
+ error (1, 0, _("invalid time interval `%s'"), s);
return value;
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s [SETTING]...\n\
or: %s OPTION\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
Print or change terminal characteristics.\n\
\n\
-a, --all print all current settings in human-readable form\n\
\n\
Optional - before SETTING indicates negation. An * marks non-POSIX\n\
settings. The underlying system defines which settings are available.\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Special characters:\n\
* dsusp CHAR CHAR will send a terminal stop signal once input flushed\n\
susp CHAR CHAR will send a terminal stop signal\n\
* swtch CHAR CHAR will switch to a different shell layer\n\
* werase CHAR CHAR will erase the last word typed\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Special settings:\n\
N set the input and output speeds to N bauds\n\
* size print the number of rows and columns according to the kernel\n\
speed print the terminal speed\n\
time N with -icanon, set read timeout of N tenths of a second\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Control settings:\n\
[-]clocal disable modem control signals\n\
[-]hupcl same as [-]hup\n\
[-]parenb generate parity bit in output and expect parity bit in input\n\
[-]parodd set odd parity (even with `-')\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Input settings:\n\
[-]brkint breaks cause an interrupt signal\n\
[-]ixon enable XON/XOFF flow control\n\
[-]parmrk mark parity errors (with a 255-0-character sequence)\n\
[-]tandem same as [-]ixoff\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Output settings:\n\
* bsN backspace delay style, N in [0..1]\n\
* tabs same as tab0\n\
* -tabs same as tab3\n\
* vtN vertical tab delay style, N in [0..1]\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Local settings:\n\
[-]crterase echo erase characters as backspace-space-backspace\n\
* [-]prterase same as [-]echoprt\n\
* [-]tostop stop background jobs that try to write to the terminal\n\
* [-]xcase with icanon, escape with `\\' for uppercase characters\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Combination settings:\n\
* [-]LCASE same as [-]lcase\n\
isig icanon iexten echo echoe echok -echonl -noflsh\n\
-xcase -tostop -echoprt echoctl echoke, all special\n\
characters to their default values.\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Handle the tty line connected to standard input. Without arguments,\n\
prints baud rate, line discipline, and deviations from stty sane. In\n\
settings, CHAR is taken literally, or coded as in ^c, 0x37, 0177 or\n\
127; special values ^- or undef used to disable special characters.\n\
-");
+"));
}
exit (status);
}
/* Specifying both -a and -g gets an error. */
if (verbose_output && recoverable_output)
error (2, 0,
- "the options for verbose and stty-readable output styles are\n\
-\tmutually exclusive");
+ _("the options for verbose and stty-readable output styles are\n\
+\tmutually exclusive"));
/* Specifying any other arguments with -a or -g gets an error. */
if (argc - optind > 0 && (verbose_output || recoverable_output))
- error (2, 0, "when specifying an output style, modes may not be set");
+ error (2, 0, _("when specifying an output style, modes may not be set"));
/* Initialize to all zeroes so there is no risk memcmp will report a
spurious difference in an uninitialized portion of the structure. */
memset (&mode, 0, sizeof (mode));
if (tcgetattr (0, &mode))
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
if (verbose_output || recoverable_output || argc == 1)
{
}
if (match_found == 0 && reversed)
{
- error (0, 0, "invalid argument `%s'", --argv[k]);
+ error (0, 0, _("invalid argument `%s'"), --argv[k]);
usage (1);
}
if (match_found == 0)
{
if (k == argc - 1)
{
- error (0, 0, "missing argument to `%s'", argv[k]);
+ error (0, 0, _("missing argument to `%s'"), argv[k]);
usage (1);
}
match_found = 1;
{
if (k == argc - 1)
{
- error (0, 0, "missing argument to `%s'", argv[k]);
+ error (0, 0, _("missing argument to `%s'"), argv[k]);
usage (1);
}
++k;
{
if (k == argc - 1)
{
- error (0, 0, "missing argument to `%s'", argv[k]);
+ error (0, 0, _("missing argument to `%s'"), argv[k]);
usage (1);
}
++k;
{
if (k == argc - 1)
{
- error (0, 0, "missing argument to `%s'", argv[k]);
+ error (0, 0, _("missing argument to `%s'"), argv[k]);
usage (1);
}
++k;
{
if (k == argc - 1)
{
- error (0, 0, "missing argument to `%s'", argv[k]);
+ error (0, 0, _("missing argument to `%s'"), argv[k]);
usage (1);
}
++k;
{
if (k == argc - 1)
{
- error (0, 0, "missing argument to `%s'", argv[k]);
+ error (0, 0, _("missing argument to `%s'"), argv[k]);
usage (1);
}
++k;
{
if (recover_mode (argv[k], &mode) == 0)
{
- error (0, 0, "invalid argument `%s'", argv[k]);
+ error (0, 0, _("invalid argument `%s'"), argv[k]);
usage (1);
}
require_set_attr = 1;
struct termios new_mode;
if (tcsetattr (0, TCSADRAIN, &mode))
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
/* POSIX (according to Zlotnick's book) tcsetattr returns zero if
it performs *any* of the requested operations. This means it
spurious difference in an uninitialized portion of the structure. */
memset (&new_mode, 0, sizeof (new_mode));
if (tcgetattr (0, &new_mode))
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
/* Normally, one shouldn't use memcmp to compare structures that
may have `holes' containing uninitialized data, but we have been
{
int i;
error (1, 0,
- "standard input: unable to perform all requested operations");
- printf ("new_mode: mode\n");
+ _("standard input: unable to perform all requested operations"));
+ printf (_("new_mode: mode\n"));
for (i=0; i<sizeof(new_mode); i++)
printf ("0x%02x: 0x%02x\n",
*(((unsigned char *) &new_mode) + i),
if (get_win_size (&win))
{
if (errno != EINVAL)
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
memset (&win, 0, sizeof (win));
}
win.ws_col = 1;
if (ioctl (0, TIOCSWINSZ, (char *) &win))
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
if (ioctl (0, TIOCSSIZE, (char *) &ttysz))
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
return;
}
#endif
if (ioctl (0, TIOCSWINSZ, (char *) &win))
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
}
static void
if (get_win_size (&win))
{
if (errno != EINVAL)
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
}
else
{
/* With Solaris 2.[123], this ioctl fails and errno is set to
EINVAL for telnet (but not rlogin) sessions. */
if (errno != EINVAL)
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
}
else if (win.ws_col > 0)
return win.ws_col;
char *bpout = buf;
if (ch == _POSIX_VDISABLE)
- return "<undef>";
+ return _("<undef>");
if (ch >= 32)
{
if (*p)
{
- error (0, 0, "invalid integer argument `%s'", s);
+ error (0, 0, _("invalid integer argument `%s'"), s);
usage (1);
}
return value;
pw = getpwnam (new_user);
if (pw == 0)
- error (1, 0, "user %s does not exist", new_user);
+ error (1, 0, _("user %s does not exist"), new_user);
endpwent ();
/* Make a copy of the password information and point pw at the local
#ifdef SYSLOG_FAILURE
log_su (pw, 0);
#endif
- error (1, 0, "incorrect password");
+ error (1, 0, _("incorrect password"));
}
#ifdef SYSLOG_SUCCESS
else
probably a uucp account or has restricted access. Don't
compromise the account by allowing access with a standard
shell. */
- error (0, 0, "using restricted shell %s", pw->pw_shell);
+ error (0, 0, _("using restricted shell %s"), pw->pw_shell);
shell = 0;
}
if (shell == 0)
change_identity (pw);
if (simulate_login && chdir (pw->pw_dir))
- error (0, errno, "warning: cannot change directory to %s", pw->pw_dir);
+ error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
run_shell (shell, command, additional_args);
}
if (getuid () == 0 || correct == 0 || correct[0] == '\0')
return 1;
- unencrypted = getpass ("Password:");
+ unencrypted = getpass (_("Password:"));
if (unencrypted == NULL)
{
- error (0, 0, "getpass: cannot open /dev/tty");
+ error (0, 0, _("getpass: cannot open /dev/tty"));
return 0;
}
encrypted = crypt (unencrypted, correct);
#ifdef HAVE_INITGROUPS
errno = 0;
if (initgroups (pw->pw_name, pw->pw_gid) == -1)
- error (1, errno, "cannot set groups");
+ error (1, errno, _("cannot set groups"));
endgrent ();
#endif
if (setgid (pw->pw_gid))
- error (1, errno, "cannot set group id");
+ error (1, errno, _("cannot set group id"));
if (setuid (pw->pw_uid))
- error (1, errno, "cannot set user id");
+ error (1, errno, _("cannot set user id"));
}
/* Run SHELL, or DEFAULT_SHELL if SHELL is empty.
args[argno++] = *additional_args;
args[argno] = NULL;
execv (shell, (char **) args);
- error (1, errno, "cannot run %s", shell);
+ error (1, errno, _("cannot run %s"), shell);
}
#if defined (SYSLOG_SUCCESS) || defined (SYSLOG_FAILURE)
char *val;
{
if (putenv (val))
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
}
/* Return a newly-allocated string whose contents concatenate
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [-] [USER [ARG]...]\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [-] [USER [ARG]...]\n"), program_name);
+ printf (_("\
Change the effective user id and group id to that of USER.\n\
\n\
-, -l, --login make the shell a login shell\n\
--version output version information and exit\n\
\n\
A mere - implies -l. If USER not given, assume root.\n\
-");
+"));
}
exit (status);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
+ printf (_("\
Copy standard input to each FILE, and also to standard output.\n\
\n\
-a, --append append to the given FILEs, do not overwrite\n\
-i, --ignore-interrupts ignore interrupt signals\n\
--help display this help and exit\n\
--version output version information and exit\n\
-");
+"));
}
exit (status);
}
errs = tee (argc - optind, (const char **) &argv[optind]);
if (close (0) != 0)
- error (1, errno, "standard input");
+ error (1, errno, _("standard input"));
if (close (1) != 0)
- error (1, errno, "standard output");
+ error (1, errno, _("standard output"));
exit (errs);
}
/* In the array of NFILES + 1 descriptors, make
the first one correspond to standard output. */
descriptors[0] = 1;
- files[0] = "standard output";
+ files[0] = _("standard output");
for (i = 1; i <= nfiles; i++)
{
if (bytes_read == -1)
{
- error (0, errno, "read error");
+ error (0, errno, _("read error"));
ret = 1;
}
static void
beyond ()
{
- test_syntax_error ("argument expected\n", NULL);
+ test_syntax_error (_("argument expected\n"), NULL);
}
/* Syntax error for when an integer argument was expected, but
integer_expected_error (pch)
char *pch;
{
- test_syntax_error ("integer expression expected %s\n", pch);
+ test_syntax_error (_("integer expression expected %s\n"), pch);
}
/* Return non-zero if the characters pointed to by STRING constitute a
advance (1);
value = expr ();
if (!argv[pos])
- test_syntax_error ("')' expected\n", NULL);
+ test_syntax_error (_("')' expected\n"), NULL);
else
if (argv[pos][0] != ')' || argv[pos][1])
- test_syntax_error ("')' expected, found %s\n", argv[pos]);
+ test_syntax_error (_("')' expected, found %s\n"), argv[pos]);
advance (0);
return (TRUE == (value));
}
if (unop (argv[pos][1]))
value = unary_operator ();
else
- test_syntax_error ("%s: unary operator expected\n", argv[pos]);
+ test_syntax_error (_("%s: unary operator expected\n"), argv[pos]);
}
else
{
/* Make sure that OP is still a valid binary operator. */
if ((op >= argc - 1) || (binop (argv[op]) == 0))
- test_syntax_error ("%s: binary operator expected\n", argv[op]);
+ test_syntax_error (_("%s: binary operator expected\n"), argv[op]);
advance (0);
}
else
{
if (!isint (argv[op - 1], &l))
- integer_expected_error ("before -lt");
+ integer_expected_error (_("before -lt"));
}
if (r_is_l)
else
{
if (!isint (argv[op + 1], &r))
- integer_expected_error ("after -lt");
+ integer_expected_error (_("after -lt"));
}
pos += 3;
return (TRUE == (l < r));
else
{
if (!isint (argv[op - 1], &l))
- integer_expected_error ("before -le");
+ integer_expected_error (_("before -le"));
}
if (r_is_l)
r = strlen (argv[op + 2]);
else
{
if (!isint (argv[op + 1], &r))
- integer_expected_error ("after -le");
+ integer_expected_error (_("after -le"));
}
pos += 3;
return (TRUE == (l <= r));
else
{
if (!isint (argv[op - 1], &l))
- integer_expected_error ("before -gt");
+ integer_expected_error (_("before -gt"));
}
if (r_is_l)
r = strlen (argv[op + 2]);
else
{
if (!isint (argv[op + 1], &r))
- integer_expected_error ("after -gt");
+ integer_expected_error (_("after -gt"));
}
pos += 3;
return (TRUE == (l > r));
else
{
if (!isint (argv[op - 1], &l))
- integer_expected_error ("before -ge");
+ integer_expected_error (_("before -ge"));
}
if (r_is_l)
r = strlen (argv[op + 2]);
else
{
if (!isint (argv[op + 1], &r))
- integer_expected_error ("after -ge");
+ integer_expected_error (_("after -ge"));
}
pos += 3;
return (TRUE == (l >= r));
/* nt - newer than */
pos += 3;
if (l_is_l || r_is_l)
- test_syntax_error ("-nt does not accept -l\n", NULL);
+ test_syntax_error (_("-nt does not accept -l\n"), NULL);
if (age_of (argv[op - 1], &l) && age_of (argv[op + 1], &r))
return (TRUE == (l > r));
else
else
{
if (!isint (argv[op - 1], &l))
- integer_expected_error ("before -ne");
+ integer_expected_error (_("before -ne"));
}
if (r_is_l)
r = strlen (argv[op + 2]);
else
{
if (!isint (argv[op + 1], &r))
- integer_expected_error ("after -ne");
+ integer_expected_error (_("after -ne"));
}
pos += 3;
return (TRUE == (l != r));
else
{
if (!isint (argv[op - 1], &l))
- integer_expected_error ("before -eq");
+ integer_expected_error (_("before -eq"));
}
if (r_is_l)
r = strlen (argv[op + 2]);
else
{
if (!isint (argv[op + 1], &r))
- integer_expected_error ("after -eq");
+ integer_expected_error (_("after -eq"));
}
pos += 3;
return (TRUE == (l == r));
/* ef - hard link? */
pos += 3;
if (l_is_l || r_is_l)
- test_syntax_error ("-ef does not accept -l\n", NULL);
+ test_syntax_error (_("-ef does not accept -l\n"), NULL);
if (stat (argv[op - 1], &stat_buf) < 0)
return (FALSE);
if (stat (argv[op + 1], &stat_spare) < 0)
/* ot - older than */
pos += 3;
if (l_is_l || r_is_l)
- test_syntax_error ("-nt does not accept -l\n", NULL);
+ test_syntax_error (_("-nt does not accept -l\n"), NULL);
if (age_of (argv[op - 1], &l) && age_of (argv[op + 1], &r))
return (TRUE == (l < r));
return (FALSE);
}
break;
}
- test_syntax_error ("unknown binary operator", argv[op]);
+ test_syntax_error (_("unknown binary operator"), argv[op]);
}
if (argv[op][0] == '=' && !argv[op][1])
if (unop (argv[pos][1]))
value = unary_operator ();
else
- test_syntax_error ("%s: unary operator expected\n", argv[pos]);
+ test_syntax_error (_("%s: unary operator expected\n"), argv[pos]);
}
else
beyond ();
(argv[pos][0] == '('))
value = expr ();
else
- test_syntax_error ("%s: binary operator expected\n", argv[pos+1]);
+ test_syntax_error (_("%s: binary operator expected\n"), argv[pos+1]);
return (value);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s EXPRESSION\n\
or: [ EXPRESSION ]\n\
or: %s OPTION\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
Exit with the status determined by EXPRESSION.\n\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
\n\
EXPRESSION is true or false and sets exit status. It is one of:\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
( EXPRESSION ) EXPRESSION is true\n\
! EXPRESSION EXPRESSION is false\n\
INTEGER1 -le INTEGER2 INTEGER1 is less than or equal to INTEGER2\n\
INTEGER1 -lt INTEGER2 INTEGER1 is less than INTEGER2\n\
INTEGER1 -ne INTEGER2 INTEGER1 is not equal to INTEGER2\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
FILE1 -ef FILE2 FILE1 and FILE2 have the same device and inode numbers\n\
FILE1 -nt FILE2 FILE1 is newer (modification date) than FILE2\n\
-u FILE FILE exists and its set-user-ID bit is set\n\
-w FILE FILE exists and is writable\n\
-x FILE FILE exists and is executable\n\
-");
- printf ("\
+"));
+ printf (_("\
\n\
Beware that parentheses need to be escaped by backslashes for shells.\n\
INTEGER may also be -l STRING, which evaluates to the length of STRING.\n\
-");
+"));
}
exit (status);
}
test_exit (SHELL_BOOLEAN (FALSE));
if (margv[margc] && strcmp (margv[margc], "]") != 0)
- test_syntax_error ("missing `]'\n", NULL);
+ test_syntax_error (_("missing `]'\n"), NULL);
}
argc = margc;
value = posixtest ();
if (pos != argc)
- test_syntax_error ("too many arguments\n", NULL);
+ test_syntax_error (_("too many arguments\n"), NULL);
test_exit (SHELL_BOOLEAN (value));
}
if (tty)
puts (tty);
else
- puts ("not a tty");
+ puts (_("not a tty"));
if (ferror (stdout) || fclose (stdout) == EOF)
- error (3, errno, "standard output");
+ error (3, errno, _("standard output"));
}
exit (isatty (0) ? 0 : 1);
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]...\n"), program_name);
+ printf (_("\
Print the file name of the terminal connected to standard input.\n\
\n\
-s, --silent, --quiet print nothing, only return an exit status\n\
--help display this help and exit\n\
--version output version information and exit\n\
-");
+"));
}
exit (status);
}
toprint = PRINT_SYSNAME;
if (uname (&name) == -1)
- error (1, errno, "cannot get system name");
+ error (1, errno, _("cannot get system name"));
print_element (PRINT_SYSNAME, name.sysname);
print_element (PRINT_NODENAME, name.nodename);
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]...\n"), program_name);
+ printf (_("\
Print certain system information. With no OPTION, same as -s.\n\
\n\
-a, --all print all information\n\
-s, --sysname print the operating system name\n\
-v print the operating system version\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
(int) ((seconds_idle % (60 * 60)) / 60));
return (const char *) idle;
}
- return " old ";
+ return _(" old ");
}
/* Display a line of information about entry THIS. */
}
this++;
}
- printf ("\n# users=%u\n", entries);
+ printf (_("\n# users=%u\n"), entries);
}
#endif /* WHO */
{
printf ("%-8s ", "USER");
if (include_mesg)
- printf ("MESG ");
- printf ("%-8s ", "LINE");
- printf ("LOGIN-TIME ");
+ printf (_("MESG "));
+ printf ("%-8s ", _("LINE"));
+ printf (_("LOGIN-TIME "));
if (include_idle)
- printf ("IDLE ");
- printf ("FROM\n");
+ printf (_("IDLE "));
+ printf (_("FROM\n"));
}
/* Display `utmp_contents', which should have N entries. */
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [ FILE | ARG1 ARG2 ]\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [ FILE | ARG1 ARG2 ]\n"), program_name);
+ printf (_("\
\n\
-H, --heading print line of column headings\n\
-T, -w, --mesg add user's message status as +, - or ?\n\
\n\
If FILE not given, uses /etc/utmp. /etc/wtmp as FILE is common.\n\
If ARG1 ARG2 given, -m presumed: `am i' or `mom likes' are usual.\n\
-");
+"));
}
exit (status);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [ FILE ]\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [ FILE ]\n"), program_name);
+ printf (_("\
Output who is currently logged in according to FILE.\n\
If FILE not given, uses /etc/utmp. /etc/wtmp as FILE is common.\n\
\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
#endif /* WHO */
default:
- error (0, 0, "too many arguments");
+ error (0, 0, _("too many arguments"));
usage (1);
}
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]...\n"), program_name);
+ printf (_("\
Print the user name associated with the current effective user id.\n\
Same as id -un.\n\
\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
puts (pw->pw_name);
exit (0);
}
- fprintf (stderr, "%s: cannot find username for UID %u\n",
+ fprintf (stderr, _("%s: cannot find username for UID %u\n"),
program_name, (unsigned) uid);
exit (1);
}
int status;
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [STRING]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [STRING]...\n"), program_name);
+ printf (_("\
Repeatedly output a line with all specified STRING(s), or `y'.\n\
\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}