mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-23 22:07:58 +02:00
commit bash-20100520 snapshot
This commit is contained in:
@@ -9810,3 +9810,24 @@ lib/readline/complete.c
|
||||
text being completed, inhibit inserting the match.
|
||||
The guess is that replacing text with a shorter match will not
|
||||
be wanted
|
||||
|
||||
5/20
|
||||
----
|
||||
lib/sh/unicode.c
|
||||
- new file, with unicode character conversion-related code. Will be
|
||||
used to implement \u and \U escapes where appropriate, and for
|
||||
other unicode-related functions in the future
|
||||
|
||||
5/21
|
||||
----
|
||||
builtins/printf.def
|
||||
- add code to handle \u and \U escapes in format strings and arguments
|
||||
processed by the %b format specifier
|
||||
|
||||
lib/sh/strtrans.c
|
||||
- add code to handle \u and \U escapes as unicode characters, works for
|
||||
both `echo -e' and $'...'
|
||||
|
||||
doc/{bash.1,bashref.texi}
|
||||
- document new \u and \U escape sequences for $'...' and echo (printf
|
||||
defers to the system's man page or Posix)
|
||||
|
||||
@@ -9789,3 +9789,41 @@ lib/readline/histexpand.c
|
||||
$(...) code above. Bug reported by Rajeev V. Pillai
|
||||
<rajeevvp@gmail.com>
|
||||
|
||||
4/24
|
||||
----
|
||||
lib/readline/vi_mode.c
|
||||
- add checks to rl_vi_char_search to make sure we've already done a
|
||||
search if the command is `;' or `,', and return immediately if we
|
||||
have not. Fixes bug reported by Eric Ho <ericmho@shaw.ca>
|
||||
|
||||
lib/readline/text.c
|
||||
- make sure `dir' is in the valid range before searching in
|
||||
_rl_char_search_internal. Range checks in the code depend on it
|
||||
being non-zero
|
||||
|
||||
5/3
|
||||
---
|
||||
lib/readline/complete.c
|
||||
- in rl_complete_internal, if show-all-if-ambiguous or
|
||||
show-all-if-unmodified are set (what_to_do == '!' or '@',
|
||||
respectively), and the common match prefix is shorter than the
|
||||
text being completed, inhibit inserting the match.
|
||||
The guess is that replacing text with a shorter match will not
|
||||
be wanted
|
||||
|
||||
5/20
|
||||
----
|
||||
lib/sh/unicode.c
|
||||
- new file, with unicode character conversion-related code. Will be
|
||||
used to implement \u and \U escapes where appropriate, and for
|
||||
other unicode-related functions in the future
|
||||
|
||||
5/21
|
||||
----
|
||||
builtins/printf.def
|
||||
- add code to handle \u and \U escapes in format strings and arguments
|
||||
processed by the %b format specifier
|
||||
|
||||
lib/sh/strtrans.c
|
||||
- add code to handle \u and \U escapes as unicode characters, works for
|
||||
both `echo -e' and $'...'
|
||||
|
||||
@@ -436,6 +436,7 @@ lib/sh/timeval.c f
|
||||
lib/sh/tmpfile.c f
|
||||
lib/sh/uconvert.c f
|
||||
lib/sh/ufuncs.c f
|
||||
lib/sh/unicode.c f
|
||||
lib/sh/vprint.c f
|
||||
lib/sh/wcsdup.c f
|
||||
lib/sh/winsize.c f
|
||||
|
||||
+1
-1
@@ -214,7 +214,7 @@ SHLIB_SOURCE = ${SH_LIBSRC}/clktck.c ${SH_LIBSRC}/getcwd.c \
|
||||
${SH_LIBSRC}/casemod.c ${SH_LIBSRC}/uconvert.c \
|
||||
${SH_LIBSRC}/ufuncs.c ${SH_LIBSRC}/dprintf.c \
|
||||
${SH_LIBSRC}/input_avail.c ${SH_LIBSRC}/mbscasecmp.c \
|
||||
${SH_LIBSRC}/fnxform.c
|
||||
${SH_LIBSRC}/fnxform.c ${SH_LIBSRC}/unicode.c
|
||||
|
||||
SHLIB_LIB = -lsh
|
||||
SHLIB_LIBNAME = libsh.a
|
||||
|
||||
+51
-10
@@ -224,6 +224,10 @@ printf_builtin (list)
|
||||
int ch, fieldwidth, precision;
|
||||
int have_fieldwidth, have_precision;
|
||||
char convch, thisch, nextch, *format, *modstart, *fmt, *start;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
char mbch[25]; /* 25 > MB_LEN_MAX, plus can handle 4-byte UTF-8 and large Unicode characters*/
|
||||
int mbind;
|
||||
#endif
|
||||
|
||||
conversion_error = 0;
|
||||
retval = EXECUTION_SUCCESS;
|
||||
@@ -301,8 +305,17 @@ printf_builtin (list)
|
||||
fmt++;
|
||||
/* A NULL third argument to tescape means to bypass the
|
||||
special processing for arguments to %b. */
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
/* Accommodate possible use of \u or \U, which can result in
|
||||
multibyte characters */
|
||||
memset (mbch, '\0', sizeof (mbch));
|
||||
fmt += tescape (fmt, mbch, (int *)NULL);
|
||||
for (mbind = 0; mbch[mbind]; mbind++)
|
||||
PC (mbch[mbind]);
|
||||
#else
|
||||
fmt += tescape (fmt, &nextch, (int *)NULL);
|
||||
PC (nextch);
|
||||
#endif
|
||||
fmt--; /* for loop will increment it for us again */
|
||||
continue;
|
||||
}
|
||||
@@ -743,14 +756,10 @@ tescape (estart, cp, sawc)
|
||||
*cp = evalue & 0xFF;
|
||||
break;
|
||||
|
||||
/* And, as another extension, we allow \xNNN, where each N is a
|
||||
/* And, as another extension, we allow \xNN, where each N is a
|
||||
hex digit. */
|
||||
case 'x':
|
||||
#if 0
|
||||
for (evalue = 0; ISXDIGIT ((unsigned char)*p); p++)
|
||||
#else
|
||||
for (temp = 2, evalue = 0; ISXDIGIT ((unsigned char)*p) && temp--; p++)
|
||||
#endif
|
||||
evalue = (evalue * 16) + HEXVALUE (*p);
|
||||
if (p == estart + 1)
|
||||
{
|
||||
@@ -761,6 +770,28 @@ tescape (estart, cp, sawc)
|
||||
*cp = evalue & 0xFF;
|
||||
break;
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
case 'u':
|
||||
case 'U':
|
||||
temp = (c == 'u') ? 4 : 8; /* \uNNNN \UNNNNNNNN */
|
||||
for (evalue = 0; ISXDIGIT ((unsigned char)*p) && temp--; p++)
|
||||
evalue = (evalue * 16) + HEXVALUE (*p);
|
||||
if (p == estart + 1)
|
||||
{
|
||||
builtin_error (_("missing unicode digit for \\%c"), c);
|
||||
*cp = '\\';
|
||||
return 0;
|
||||
}
|
||||
if (evalue <= UCHAR_MAX)
|
||||
*cp = evalue;
|
||||
else
|
||||
{
|
||||
temp = u32cconv (evalue, cp);
|
||||
cp[temp] = '\0';
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case '\\': /* \\ -> \ */
|
||||
*cp = c;
|
||||
break;
|
||||
@@ -799,12 +830,12 @@ bexpand (string, len, sawc, lenp)
|
||||
{
|
||||
int temp;
|
||||
char *ret, *r, *s, c;
|
||||
|
||||
#if 0
|
||||
if (string == 0 || *string == '\0')
|
||||
#else
|
||||
if (string == 0 || len == 0)
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
char mbch[25];
|
||||
int mbind;
|
||||
#endif
|
||||
|
||||
if (string == 0 || len == 0)
|
||||
{
|
||||
if (sawc)
|
||||
*sawc = 0;
|
||||
@@ -823,7 +854,12 @@ bexpand (string, len, sawc, lenp)
|
||||
continue;
|
||||
}
|
||||
temp = 0;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
memset (mbch, '\0', sizeof (mbch));
|
||||
s += tescape (s, mbch, &temp);
|
||||
#else
|
||||
s += tescape (s, &c, &temp);
|
||||
#endif
|
||||
if (temp)
|
||||
{
|
||||
if (sawc)
|
||||
@@ -831,7 +867,12 @@ bexpand (string, len, sawc, lenp)
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
for (mbind = 0; mbch[mbind]; mbind++)
|
||||
*r++ = mbch[mbind];
|
||||
#else
|
||||
*r++ = c;
|
||||
#endif
|
||||
}
|
||||
|
||||
*r = '\0';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+2257
-2252
File diff suppressed because it is too large
Load Diff
+16
@@ -1104,6 +1104,14 @@ the eight-bit character whose value is the octal value \fInnn\fP
|
||||
the eight-bit character whose value is the hexadecimal value \fIHH\fP
|
||||
(one or two hex digits)
|
||||
.TP
|
||||
.B \eu\fIHHHH\fP
|
||||
the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
|
||||
\fIHHHH\fP (one to four hex digits)
|
||||
.TP
|
||||
.B \eU\fIHHHHHHHH\fP
|
||||
the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
|
||||
\fIHHHHHHHH\fP (one to eight hex digits)
|
||||
.TP
|
||||
.B \ec\fIx\fP
|
||||
a control-\fIx\fP character
|
||||
.PD
|
||||
@@ -7293,6 +7301,14 @@ the eight-bit character whose value is the octal value \fInnn\fP
|
||||
.B \ex\fIHH\fP
|
||||
the eight-bit character whose value is the hexadecimal value \fIHH\fP
|
||||
(one or two hex digits)
|
||||
.TP
|
||||
.B \eu\fIHHHH\fP
|
||||
the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
|
||||
\fIHHHH\fP (one to four hex digits)
|
||||
.TP
|
||||
.B \eU\fIHHHHHHHH\fP
|
||||
the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
|
||||
\fIHHHHHHHH\fP (one to eight hex digits)
|
||||
.PD
|
||||
.RE
|
||||
.TP
|
||||
|
||||
+2
-2
@@ -50,8 +50,8 @@ bash \- GNU Bourne-Again SHell
|
||||
[options]
|
||||
[file]
|
||||
.SH COPYRIGHT
|
||||
.if n Bash is Copyright (C) 1989-2009 by the Free Software Foundation, Inc.
|
||||
.if t Bash is Copyright \(co 1989-2009 by the Free Software Foundation, Inc.
|
||||
.if n Bash is Copyright (C) 1989-2010 by the Free Software Foundation, Inc.
|
||||
.if t Bash is Copyright \(co 1989-2010 by the Free Software Foundation, Inc.
|
||||
.SH DESCRIPTION
|
||||
.B Bash
|
||||
is an \fBsh\fR-compatible command language interpreter that
|
||||
|
||||
+24
-19
@@ -3,7 +3,7 @@
|
||||
</HEAD>
|
||||
<BODY><TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2010 January 15<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2010 April 17<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR><A HREF="#index">Index</A>
|
||||
@@ -42,7 +42,7 @@ bash - GNU Bourne-Again SHell
|
||||
<H3>COPYRIGHT</H3>
|
||||
|
||||
|
||||
Bash is Copyright © 1989-2009 by the Free Software Foundation, Inc.
|
||||
Bash is Copyright © 1989-2010 by the Free Software Foundation, Inc.
|
||||
<A NAME="lbAE"> </A>
|
||||
<H3>DESCRIPTION</H3>
|
||||
|
||||
@@ -67,8 +67,10 @@ can be configured to be POSIX-conformant by default.
|
||||
<A NAME="lbAF"> </A>
|
||||
<H3>OPTIONS</H3>
|
||||
|
||||
In addition to the single-character shell options documented in the
|
||||
description of the <B>set</B> builtin command, <B>bash</B>
|
||||
All of the single-character shell options documented in the
|
||||
description of the <B>set</B> builtin command can be used as options
|
||||
when the shell is invoked.
|
||||
In addition, <B>bash</B>
|
||||
interprets the following options when it is invoked:
|
||||
<P>
|
||||
|
||||
@@ -195,11 +197,6 @@ Turns on extended debugging mode (see the description of the
|
||||
option to the
|
||||
<B>shopt</B>
|
||||
|
||||
builtin below)
|
||||
and shell function tracing (see the description of the
|
||||
<B>-o functrace</B> option to the
|
||||
<B>set</B>
|
||||
|
||||
builtin below).
|
||||
<DT><B>--dump-po-strings</B>
|
||||
|
||||
@@ -5048,7 +5045,7 @@ turned on to be used in an expression.
|
||||
|
||||
Constants with a leading 0 are interpreted as octal numbers.
|
||||
A leading 0x or 0X denotes hexadecimal.
|
||||
Otherwise, numbers take the form [<I>base#</I>]n, where <I>base</I>
|
||||
Otherwise, numbers take the form [<I>base#</I>]n, where the optional <I>base</I>
|
||||
is a decimal number between 2 and 64 representing the arithmetic
|
||||
base, and <I>n</I> is a number in that base.
|
||||
If <I>base#</I> is omitted, then base 10 is used.
|
||||
@@ -6688,7 +6685,8 @@ have a slash appended (subject to the value of
|
||||
<DD>
|
||||
This variable, when set to <B>On</B>, causes readline to match files whose
|
||||
names begin with a `.' (hidden files) when performing filename
|
||||
completion, unless the leading `.' is
|
||||
completion.
|
||||
If set to <B>Off</B>, the leading `.' must be
|
||||
supplied by the user in the filename to be completed.
|
||||
<DT><B>output-meta (Off)</B>
|
||||
|
||||
@@ -7822,7 +7820,7 @@ exit status of 124. If a shell function returns 124, and changes
|
||||
the compspec associated with the command on which completion is being
|
||||
attempted (supplied as the first argument when the function is executed),
|
||||
programmable completion restarts from the beginning, with an
|
||||
attempt to find a compspec for that command. This allows a set of
|
||||
attempt to find a new compspec for that command. This allows a set of
|
||||
completions to be built dynamically as completion is attempted, rather than
|
||||
being loaded all at once.
|
||||
<P>
|
||||
@@ -9810,14 +9808,15 @@ returns true if an option, specified or unspecified, is found.
|
||||
It returns false if the end of options is encountered or an
|
||||
error occurs.
|
||||
<DT><B>hash</B> [<B>-lr</B>] [<B>-p</B> <I>filename</I>] [<B>-dt</B>] [<I>name</I>]<DD>
|
||||
For each
|
||||
<I>name</I>,
|
||||
Each time <B>hash</B> is invoked,
|
||||
the full pathname of the command
|
||||
<I>name</I>
|
||||
|
||||
the full file name of the command is determined by searching
|
||||
is determined by searching
|
||||
the directories in
|
||||
<B>$PATH</B>
|
||||
|
||||
and remembered.
|
||||
and remembered. Any previously-remembered pathname is discarded.
|
||||
If the
|
||||
<B>-p</B>
|
||||
|
||||
@@ -10330,6 +10329,11 @@ beginning with <B>\0</B> may contain up to four digits),
|
||||
and <B>%q</B> causes <B>printf</B> to output the corresponding
|
||||
<I>argument</I> in a format that can be reused as shell input.
|
||||
<P>
|
||||
Arguments to non-string format specifiers are treated as C constants,
|
||||
except that a leading plus or minus sign is allowed, and if the leading
|
||||
character is a single or double quote, the value is the ASCII value of
|
||||
the following character.
|
||||
<P>
|
||||
The <B>-v</B> option causes the output to be assigned to the variable
|
||||
<I>var</I> rather than being printed to the standard output.
|
||||
<P>
|
||||
@@ -12069,7 +12073,8 @@ The maximum number of processes available to a single user
|
||||
<DT><B>-v</B>
|
||||
|
||||
<DD>
|
||||
The maximum amount of virtual memory available to the shell
|
||||
The maximum amount of virtual memory available to the shell and, on
|
||||
some systems, to its children
|
||||
<DT><B>-x</B>
|
||||
|
||||
<DD>
|
||||
@@ -12511,7 +12516,7 @@ There may be only one active coprocess at a time.
|
||||
<HR>
|
||||
<TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash-4.1<TH ALIGN=CENTER width=33%>2010 January 15<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash-4.1<TH ALIGN=CENTER width=33%>2010 April 17<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<HR>
|
||||
@@ -12617,6 +12622,6 @@ There may be only one active coprocess at a time.
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by man2html from bash.1.<BR>
|
||||
Time: 15 January 2010 11:58:10 EST
|
||||
Time: 20 May 2010 16:33:15 EDT
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
Binary file not shown.
+1388
-1381
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -182,11 +182,11 @@
|
||||
@xrdef{Interactive Shells-snt}{Section@tie 6.3}
|
||||
@xrdef{What is an Interactive Shell?-title}{What is an Interactive Shell?}
|
||||
@xrdef{What is an Interactive Shell?-snt}{Section@tie 6.3.1}
|
||||
@xrdef{Interactive Shells-pg}{74}
|
||||
@xrdef{Is this Shell Interactive?-title}{Is this Shell Interactive?}
|
||||
@xrdef{Is this Shell Interactive?-snt}{Section@tie 6.3.2}
|
||||
@xrdef{Interactive Shell Behavior-title}{Interactive Shell Behavior}
|
||||
@xrdef{Interactive Shell Behavior-snt}{Section@tie 6.3.3}
|
||||
@xrdef{Interactive Shells-pg}{75}
|
||||
@xrdef{What is an Interactive Shell?-pg}{75}
|
||||
@xrdef{Is this Shell Interactive?-pg}{75}
|
||||
@xrdef{Interactive Shell Behavior-pg}{75}
|
||||
@@ -294,9 +294,9 @@
|
||||
@xrdef{Miscellaneous Commands-pg}{112}
|
||||
@xrdef{Readline vi Mode-title}{Readline vi Mode}
|
||||
@xrdef{Readline vi Mode-snt}{Section@tie 8.5}
|
||||
@xrdef{Readline vi Mode-pg}{114}
|
||||
@xrdef{Programmable Completion-title}{Programmable Completion}
|
||||
@xrdef{Programmable Completion-snt}{Section@tie 8.6}
|
||||
@xrdef{Readline vi Mode-pg}{115}
|
||||
@xrdef{Programmable Completion-pg}{115}
|
||||
@xrdef{Programmable Completion Builtins-title}{Programmable Completion Builtins}
|
||||
@xrdef{Programmable Completion Builtins-snt}{Section@tie 8.7}
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@
|
||||
\entry{source}{49}{\code {source}}
|
||||
\entry{type}{49}{\code {type}}
|
||||
\entry{typeset}{49}{\code {typeset}}
|
||||
\entry{ulimit}{49}{\code {ulimit}}
|
||||
\entry{ulimit}{50}{\code {ulimit}}
|
||||
\entry{unalias}{51}{\code {unalias}}
|
||||
\entry{set}{51}{\code {set}}
|
||||
\entry{shopt}{55}{\code {shopt}}
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@
|
||||
\entry {\code {type}}{49}
|
||||
\entry {\code {typeset}}{49}
|
||||
\initial {U}
|
||||
\entry {\code {ulimit}}{49}
|
||||
\entry {\code {ulimit}}{50}
|
||||
\entry {\code {umask}}{41}
|
||||
\entry {\code {unalias}}{51}
|
||||
\entry {\code {unset}}{41}
|
||||
|
||||
+2
-2
@@ -75,8 +75,8 @@
|
||||
\entry{login shell}{73}{login shell}
|
||||
\entry{interactive shell}{73}{interactive shell}
|
||||
\entry{startup files}{73}{startup files}
|
||||
\entry{interactive shell}{75}{interactive shell}
|
||||
\entry{shell, interactive}{75}{shell, interactive}
|
||||
\entry{interactive shell}{74}{interactive shell}
|
||||
\entry{shell, interactive}{74}{shell, interactive}
|
||||
\entry{expressions, conditional}{76}{expressions, conditional}
|
||||
\entry{arithmetic, shell}{78}{arithmetic, shell}
|
||||
\entry{shell arithmetic}{78}{shell arithmetic}
|
||||
|
||||
+2
-2
@@ -67,7 +67,7 @@
|
||||
\entry {initialization file, readline}{96}
|
||||
\entry {installation}{127}
|
||||
\entry {interaction, readline}{93}
|
||||
\entry {interactive shell}{73, 75}
|
||||
\entry {interactive shell}{73, 74}
|
||||
\entry {internationalization}{7}
|
||||
\initial {J}
|
||||
\entry {job}{3}
|
||||
@@ -116,7 +116,7 @@
|
||||
\entry {shell function}{14}
|
||||
\entry {shell script}{33}
|
||||
\entry {shell variable}{15}
|
||||
\entry {shell, interactive}{75}
|
||||
\entry {shell, interactive}{74}
|
||||
\entry {signal}{4}
|
||||
\entry {signal handling}{32}
|
||||
\entry {special builtin}{4, 59}
|
||||
|
||||
Binary file not shown.
+2
-2
@@ -78,7 +78,7 @@
|
||||
\entry{do-uppercase-version (M-a, M-b, M-x, ...{})}{112}{\code {do-uppercase-version (M-a, M-b, M-\var {x}, \dots {})}}
|
||||
\entry{prefix-meta (ESC)}{112}{\code {prefix-meta (\key {ESC})}}
|
||||
\entry{undo (C-_ or C-x C-u)}{112}{\code {undo (C-_ or C-x C-u)}}
|
||||
\entry{revert-line (M-r)}{112}{\code {revert-line (M-r)}}
|
||||
\entry{revert-line (M-r)}{113}{\code {revert-line (M-r)}}
|
||||
\entry{tilde-expand (M-&)}{113}{\code {tilde-expand (M-&)}}
|
||||
\entry{set-mark (C-@)}{113}{\code {set-mark (C-@)}}
|
||||
\entry{exchange-point-and-mark (C-x C-x)}{113}{\code {exchange-point-and-mark (C-x C-x)}}
|
||||
@@ -88,7 +88,7 @@
|
||||
\entry{insert-comment (M-#)}{113}{\code {insert-comment (M-#)}}
|
||||
\entry{dump-functions ()}{113}{\code {dump-functions ()}}
|
||||
\entry{dump-variables ()}{113}{\code {dump-variables ()}}
|
||||
\entry{dump-macros ()}{113}{\code {dump-macros ()}}
|
||||
\entry{dump-macros ()}{114}{\code {dump-macros ()}}
|
||||
\entry{glob-complete-word (M-g)}{114}{\code {glob-complete-word (M-g)}}
|
||||
\entry{glob-expand-word (C-x *)}{114}{\code {glob-expand-word (C-x *)}}
|
||||
\entry{glob-list-expansions (C-x g)}{114}{\code {glob-list-expansions (C-x g)}}
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@
|
||||
\entry {\code {do-uppercase-version (M-a, M-b, M-\var {x}, \dots {})}}{112}
|
||||
\entry {\code {downcase-word (M-l)}}{108}
|
||||
\entry {\code {dump-functions ()}}{113}
|
||||
\entry {\code {dump-macros ()}}{113}
|
||||
\entry {\code {dump-macros ()}}{114}
|
||||
\entry {\code {dump-variables ()}}{113}
|
||||
\entry {\code {dynamic-complete-history (M-\key {TAB})}}{112}
|
||||
\initial {E}
|
||||
@@ -95,7 +95,7 @@
|
||||
\entry {\code {re-read-init-file (C-x C-r)}}{112}
|
||||
\entry {\code {redraw-current-line ()}}{106}
|
||||
\entry {\code {reverse-search-history (C-r)}}{107}
|
||||
\entry {\code {revert-line (M-r)}}{112}
|
||||
\entry {\code {revert-line (M-r)}}{113}
|
||||
\initial {S}
|
||||
\entry {\code {self-insert (a, b, A, 1, !, \dots {})}}{108}
|
||||
\entry {\code {set-mark (C-@)}}{113}
|
||||
|
||||
+520
-495
File diff suppressed because it is too large
Load Diff
+231
-210
@@ -2,12 +2,12 @@ This is bashref.info, produced by makeinfo version 4.13 from
|
||||
/Users/chet/src/bash/src/doc/bashref.texi.
|
||||
|
||||
This text is a brief description of the features that are present in
|
||||
the Bash shell (version 4.1, 15 January 2010).
|
||||
the Bash shell (version 4.1, 17 April 2010).
|
||||
|
||||
This is Edition 4.1, last updated 15 January 2010, of `The GNU Bash
|
||||
This is Edition 4.1, last updated 17 April 2010, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 4.1.
|
||||
|
||||
Copyright (C) 1988-2009 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2010 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of this
|
||||
manual provided the copyright notice and this permission notice are
|
||||
@@ -38,9 +38,9 @@ Bash Features
|
||||
*************
|
||||
|
||||
This text is a brief description of the features that are present in
|
||||
the Bash shell (version 4.1, 15 January 2010).
|
||||
the Bash shell (version 4.1, 17 April 2010).
|
||||
|
||||
This is Edition 4.1, last updated 15 January 2010, of `The GNU Bash
|
||||
This is Edition 4.1, last updated 17 April 2010, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 4.1.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -2571,18 +2571,19 @@ standard.
|
||||
|
||||
`hash'
|
||||
hash [-r] [-p FILENAME] [-dt] [NAME]
|
||||
Remember the full pathnames of commands specified as NAME
|
||||
arguments, so they need not be searched for on subsequent
|
||||
invocations. The commands are found by searching through the
|
||||
directories listed in `$PATH'. The `-p' option inhibits the path
|
||||
search, and FILENAME is used as the location of NAME. The `-r'
|
||||
option causes the shell to forget all remembered locations. The
|
||||
`-d' option causes the shell to forget the remembered location of
|
||||
each NAME. If the `-t' option is supplied, the full pathname to
|
||||
which each NAME corresponds is printed. If multiple NAME
|
||||
arguments are supplied with `-t' the NAME is printed before the
|
||||
hashed full pathname. The `-l' option causes output to be
|
||||
displayed in a format that may be reused as input. If no
|
||||
Each time `hash' is invoked, it remembers the full pathnames of the
|
||||
commands specified as NAME arguments, so they need not be searched
|
||||
for on subsequent invocations. The commands are found by
|
||||
searching through the directories listed in `$PATH'. Any
|
||||
previously-remembered pathname is discarded. The `-p' option
|
||||
inhibits the path search, and FILENAME is used as the location of
|
||||
NAME. The `-r' option causes the shell to forget all remembered
|
||||
locations. The `-d' option causes the shell to forget the
|
||||
remembered location of each NAME. If the `-t' option is supplied,
|
||||
the full pathname to which each NAME corresponds is printed. If
|
||||
multiple NAME arguments are supplied with `-t' the NAME is printed
|
||||
before the hashed full pathname. The `-l' option causes output to
|
||||
be displayed in a format that may be reused as input. If no
|
||||
arguments are given, or if only `-l' is supplied, information
|
||||
about remembered commands is printed. The return status is zero
|
||||
unless a NAME is not found or an invalid option is supplied.
|
||||
@@ -3185,6 +3186,11 @@ POSIX standard.
|
||||
and `%q' causes `printf' to output the corresponding ARGUMENT in a
|
||||
format that can be reused as shell input.
|
||||
|
||||
Arguments to non-string format specifiers are treated as C
|
||||
language constants, except that a leading plus or minus sign is
|
||||
allowed, and if the leading character is a single or double quote,
|
||||
the value is the ASCII value of the following character.
|
||||
|
||||
The `-v' option causes the output to be assigned to the variable
|
||||
VAR rather than being printed to the standard output.
|
||||
|
||||
@@ -3386,7 +3392,8 @@ POSIX standard.
|
||||
The maximum number of processes available to a single user.
|
||||
|
||||
`-v'
|
||||
The maximum amount of virtual memory available to the process.
|
||||
The maximum amount of virtual memory available to the shell,
|
||||
and, on some systems, to its children.
|
||||
|
||||
`-x'
|
||||
The maximum number of file locks.
|
||||
@@ -4684,17 +4691,17 @@ File: bashref.info, Node: Invoking Bash, Next: Bash Startup Files, Up: Bash F
|
||||
bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] -c STRING [ARGUMENT ...]
|
||||
bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] [ARGUMENT ...]
|
||||
|
||||
In addition to the single-character shell command-line options
|
||||
(*note The Set Builtin::), there are several multi-character options
|
||||
that you can use. These options must appear on the command line before
|
||||
the single-character options to be recognized.
|
||||
All of the single-character options used with the `set' builtin
|
||||
(*note The Set Builtin::) can be used as options when the shell is
|
||||
invoked. In addition, there are several multi-character options that
|
||||
you can use. These options must appear on the command line before the
|
||||
single-character options to be recognized.
|
||||
|
||||
`--debugger'
|
||||
Arrange for the debugger profile to be executed before the shell
|
||||
starts. Turns on extended debugging mode (see *note The Shopt
|
||||
Builtin:: for a description of the `extdebug' option to the `shopt'
|
||||
builtin) and shell function tracing (see *note The Set Builtin::
|
||||
for a description of the `-o functrace' option).
|
||||
builtin).
|
||||
|
||||
`--dump-po-strings'
|
||||
A list of all double-quoted strings preceded by `$' is printed on
|
||||
@@ -5280,13 +5287,13 @@ its integer attribute turned on to be used in an expression.
|
||||
|
||||
Constants with a leading 0 are interpreted as octal numbers. A
|
||||
leading `0x' or `0X' denotes hexadecimal. Otherwise, numbers take the
|
||||
form [BASE`#']N, where BASE is a decimal number between 2 and 64
|
||||
representing the arithmetic base, and N is a number in that base. If
|
||||
BASE`#' is omitted, then base 10 is used. The digits greater than 9
|
||||
are represented by the lowercase letters, the uppercase letters, `@',
|
||||
and `_', in that order. If BASE is less than or equal to 36, lowercase
|
||||
and uppercase letters may be used interchangeably to represent numbers
|
||||
between 10 and 35.
|
||||
form [BASE`#']N, where the optional BASE is a decimal number between 2
|
||||
and 64 representing the arithmetic base, and N is a number in that
|
||||
base. If BASE`#' is omitted, then base 10 is used. The digits greater
|
||||
than 9 are represented by the lowercase letters, the uppercase letters,
|
||||
`@', and `_', in that order. If BASE is less than or equal to 36,
|
||||
lowercase and uppercase letters may be used interchangeably to
|
||||
represent numbers between 10 and 35.
|
||||
|
||||
Operators are evaluated in order of precedence. Sub-expressions in
|
||||
parentheses are evaluated first and may override the precedence rules
|
||||
@@ -6488,6 +6495,13 @@ Variable Settings
|
||||
`insert-comment' command is executed. The default value is
|
||||
`"#"'.
|
||||
|
||||
`completion-display-width'
|
||||
The number of screen columns used to display possible matches
|
||||
when performing completion. The value is ignored if it is
|
||||
less than 0 or greater than the terminal screen width. A
|
||||
value of 0 will cause matches to be displayed one per line.
|
||||
The default value is -1.
|
||||
|
||||
`completion-ignore-case'
|
||||
If set to `on', Readline performs filename matching and
|
||||
completion in a case-insensitive fashion. The default value
|
||||
@@ -6605,9 +6619,9 @@ Variable Settings
|
||||
`match-hidden-files'
|
||||
This variable, when set to `on', causes Readline to match
|
||||
files whose names begin with a `.' (hidden files) when
|
||||
performing filename completion, unless the leading `.' is
|
||||
supplied by the user in the filename to be completed. This
|
||||
variable is `on' by default.
|
||||
performing filename completion. If set to `off', the leading
|
||||
`.' must be supplied by the user in the filename to be
|
||||
completed. This variable is `on' by default.
|
||||
|
||||
`output-meta'
|
||||
If set to `on', Readline will display characters with the
|
||||
@@ -7279,7 +7293,11 @@ File: bashref.info, Node: Commands For Completion, Next: Keyboard Macros, Pre
|
||||
completion is attempted.
|
||||
|
||||
`possible-completions (M-?)'
|
||||
List the possible completions of the text before point.
|
||||
List the possible completions of the text before point. When
|
||||
displaying completions, Readline sets the number of columns used
|
||||
for display to the value of `completion-display-width', the value
|
||||
of the environment variable `COLUMNS', or the screen width, in
|
||||
that order.
|
||||
|
||||
`insert-completions (M-*)'
|
||||
Insert all completions of the text before point that would have
|
||||
@@ -7535,8 +7553,7 @@ File: bashref.info, Node: Readline vi Mode, Next: Programmable Completion, Pr
|
||||
|
||||
While the Readline library does not have a full set of `vi' editing
|
||||
functions, it does contain enough to allow simple editing of the line.
|
||||
The Readline `vi' mode behaves as specified in the POSIX 1003.2
|
||||
standard.
|
||||
The Readline `vi' mode behaves as specified in the POSIX standard.
|
||||
|
||||
In order to switch interactively between `emacs' and `vi' editing
|
||||
modes, use the `set -o emacs' and `set -o vi' commands (*note The Set
|
||||
@@ -7667,7 +7684,7 @@ exit status of 124. If a shell function returns 124, and changes the
|
||||
compspec associated with the command on which completion is being
|
||||
attempted (supplied as the first argument when the function is
|
||||
executed), programmable completion restarts from the beginning, with an
|
||||
attempt to find a compspec for that command. This allows a set of
|
||||
attempt to find a new compspec for that command. This allows a set of
|
||||
completions to be built dynamically as completion is attempted, rather
|
||||
than being loaded all at once.
|
||||
|
||||
@@ -9672,7 +9689,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* :: Bourne Shell Builtins.
|
||||
(line 11)
|
||||
* [: Bourne Shell Builtins.
|
||||
(line 213)
|
||||
(line 214)
|
||||
* alias: Bash Builtins. (line 11)
|
||||
* bg: Job Control Builtins.
|
||||
(line 7)
|
||||
@@ -9732,34 +9749,34 @@ D.1 Index of Shell Builtin Commands
|
||||
* pushd: Directory Stack Builtins.
|
||||
(line 58)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 163)
|
||||
* read: Bash Builtins. (line 413)
|
||||
* readarray: Bash Builtins. (line 493)
|
||||
(line 164)
|
||||
* read: Bash Builtins. (line 418)
|
||||
* readarray: Bash Builtins. (line 498)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 172)
|
||||
(line 173)
|
||||
* return: Bourne Shell Builtins.
|
||||
(line 188)
|
||||
(line 189)
|
||||
* set: The Set Builtin. (line 11)
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 201)
|
||||
(line 202)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 501)
|
||||
* source: Bash Builtins. (line 506)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 94)
|
||||
* test: Bourne Shell Builtins.
|
||||
(line 213)
|
||||
(line 214)
|
||||
* times: Bourne Shell Builtins.
|
||||
(line 281)
|
||||
(line 282)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 286)
|
||||
* type: Bash Builtins. (line 505)
|
||||
* typeset: Bash Builtins. (line 536)
|
||||
* ulimit: Bash Builtins. (line 542)
|
||||
(line 287)
|
||||
* type: Bash Builtins. (line 510)
|
||||
* typeset: Bash Builtins. (line 541)
|
||||
* ulimit: Bash Builtins. (line 547)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 332)
|
||||
* unalias: Bash Builtins. (line 630)
|
||||
(line 333)
|
||||
* unalias: Bash Builtins. (line 636)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 349)
|
||||
(line 350)
|
||||
* wait: Job Control Builtins.
|
||||
(line 73)
|
||||
|
||||
@@ -9858,26 +9875,30 @@ D.3 Parameter and Variable Index
|
||||
* COMP_TYPE: Bash Variables. (line 165)
|
||||
* COMP_WORDBREAKS: Bash Variables. (line 179)
|
||||
* COMP_WORDS: Bash Variables. (line 185)
|
||||
* completion-display-width: Readline Init File Syntax.
|
||||
(line 55)
|
||||
* completion-ignore-case: Readline Init File Syntax.
|
||||
(line 62)
|
||||
* completion-prefix-display-length: Readline Init File Syntax.
|
||||
(line 60)
|
||||
* completion-query-items: Readline Init File Syntax.
|
||||
(line 67)
|
||||
* completion-query-items: Readline Init File Syntax.
|
||||
(line 74)
|
||||
* COMPREPLY: Bash Variables. (line 193)
|
||||
* convert-meta: Readline Init File Syntax.
|
||||
(line 77)
|
||||
(line 84)
|
||||
* COPROC: Bash Variables. (line 198)
|
||||
* DIRSTACK: Bash Variables. (line 202)
|
||||
* disable-completion: Readline Init File Syntax.
|
||||
(line 83)
|
||||
(line 90)
|
||||
* editing-mode: Readline Init File Syntax.
|
||||
(line 88)
|
||||
(line 95)
|
||||
* EMACS: Bash Variables. (line 212)
|
||||
* enable-keypad: Readline Init File Syntax.
|
||||
(line 99)
|
||||
(line 106)
|
||||
* ENV: Bash Variables. (line 217)
|
||||
* EUID: Bash Variables. (line 221)
|
||||
* expand-tilde: Readline Init File Syntax.
|
||||
(line 110)
|
||||
(line 117)
|
||||
* FCEDIT: Bash Variables. (line 225)
|
||||
* FIGNORE: Bash Variables. (line 229)
|
||||
* FUNCNAME: Bash Variables. (line 235)
|
||||
@@ -9890,15 +9911,15 @@ D.3 Parameter and Variable Index
|
||||
* HISTFILESIZE: Bash Variables. (line 296)
|
||||
* HISTIGNORE: Bash Variables. (line 304)
|
||||
* history-preserve-point: Readline Init File Syntax.
|
||||
(line 114)
|
||||
(line 121)
|
||||
* history-size: Readline Init File Syntax.
|
||||
(line 120)
|
||||
(line 127)
|
||||
* HISTSIZE: Bash Variables. (line 323)
|
||||
* HISTTIMEFORMAT: Bash Variables. (line 327)
|
||||
* HOME: Bourne Shell Variables.
|
||||
(line 13)
|
||||
* horizontal-scroll-mode: Readline Init File Syntax.
|
||||
(line 125)
|
||||
(line 132)
|
||||
* HOSTFILE: Bash Variables. (line 336)
|
||||
* HOSTNAME: Bash Variables. (line 347)
|
||||
* HOSTTYPE: Bash Variables. (line 350)
|
||||
@@ -9906,12 +9927,12 @@ D.3 Parameter and Variable Index
|
||||
(line 18)
|
||||
* IGNOREEOF: Bash Variables. (line 353)
|
||||
* input-meta: Readline Init File Syntax.
|
||||
(line 132)
|
||||
(line 139)
|
||||
* INPUTRC: Bash Variables. (line 363)
|
||||
* isearch-terminators: Readline Init File Syntax.
|
||||
(line 139)
|
||||
* keymap: Readline Init File Syntax.
|
||||
(line 146)
|
||||
* keymap: Readline Init File Syntax.
|
||||
(line 153)
|
||||
* LANG: Bash Variables. (line 367)
|
||||
* LC_ALL: Bash Variables. (line 371)
|
||||
* LC_COLLATE: Bash Variables. (line 375)
|
||||
@@ -9929,13 +9950,13 @@ D.3 Parameter and Variable Index
|
||||
(line 27)
|
||||
* MAPFILE: Bash Variables. (line 416)
|
||||
* mark-modified-lines: Readline Init File Syntax.
|
||||
(line 159)
|
||||
(line 166)
|
||||
* mark-symlinked-directories: Readline Init File Syntax.
|
||||
(line 164)
|
||||
(line 171)
|
||||
* match-hidden-files: Readline Init File Syntax.
|
||||
(line 169)
|
||||
(line 176)
|
||||
* meta-flag: Readline Init File Syntax.
|
||||
(line 132)
|
||||
(line 139)
|
||||
* OLDPWD: Bash Variables. (line 420)
|
||||
* OPTARG: Bourne Shell Variables.
|
||||
(line 34)
|
||||
@@ -9944,9 +9965,9 @@ D.3 Parameter and Variable Index
|
||||
(line 38)
|
||||
* OSTYPE: Bash Variables. (line 427)
|
||||
* output-meta: Readline Init File Syntax.
|
||||
(line 176)
|
||||
(line 183)
|
||||
* page-completions: Readline Init File Syntax.
|
||||
(line 181)
|
||||
(line 188)
|
||||
* PATH: Bourne Shell Variables.
|
||||
(line 42)
|
||||
* PIPESTATUS: Bash Variables. (line 430)
|
||||
@@ -9966,17 +9987,17 @@ D.3 Parameter and Variable Index
|
||||
* READLINE_POINT: Bash Variables. (line 481)
|
||||
* REPLY: Bash Variables. (line 485)
|
||||
* revert-all-at-newline: Readline Init File Syntax.
|
||||
(line 191)
|
||||
(line 198)
|
||||
* SECONDS: Bash Variables. (line 488)
|
||||
* SHELL: Bash Variables. (line 494)
|
||||
* SHELLOPTS: Bash Variables. (line 499)
|
||||
* SHLVL: Bash Variables. (line 508)
|
||||
* show-all-if-ambiguous: Readline Init File Syntax.
|
||||
(line 197)
|
||||
(line 204)
|
||||
* show-all-if-unmodified: Readline Init File Syntax.
|
||||
(line 203)
|
||||
(line 210)
|
||||
* skip-completed-text: Readline Init File Syntax.
|
||||
(line 212)
|
||||
(line 219)
|
||||
* TEXTDOMAIN: Locale Translation. (line 11)
|
||||
* TEXTDOMAINDIR: Locale Translation. (line 11)
|
||||
* TIMEFORMAT: Bash Variables. (line 513)
|
||||
@@ -9984,7 +10005,7 @@ D.3 Parameter and Variable Index
|
||||
* TMPDIR: Bash Variables. (line 563)
|
||||
* UID: Bash Variables. (line 567)
|
||||
* visible-stats: Readline Init File Syntax.
|
||||
(line 225)
|
||||
(line 232)
|
||||
|
||||
|
||||
File: bashref.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Indexes
|
||||
@@ -10019,7 +10040,7 @@ D.4 Function Index
|
||||
* copy-region-as-kill (): Commands For Killing. (line 54)
|
||||
* delete-char (C-d): Commands For Text. (line 6)
|
||||
* delete-char-or-list (): Commands For Completion.
|
||||
(line 39)
|
||||
(line 43)
|
||||
* delete-horizontal-space (): Commands For Killing. (line 46)
|
||||
* digit-argument (M-0, M-1, ... M--): Numeric Arguments. (line 6)
|
||||
* do-uppercase-version (M-a, M-b, M-X, ...): Miscellaneous Commands.
|
||||
@@ -10045,15 +10066,15 @@ D.4 Function Index
|
||||
* insert-comment (M-#): Miscellaneous Commands.
|
||||
(line 60)
|
||||
* insert-completions (M-*): Commands For Completion.
|
||||
(line 18)
|
||||
(line 22)
|
||||
* kill-line (C-k): Commands For Killing. (line 6)
|
||||
* kill-region (): Commands For Killing. (line 50)
|
||||
* kill-whole-line (): Commands For Killing. (line 15)
|
||||
* kill-word (M-d): Commands For Killing. (line 19)
|
||||
* menu-complete (): Commands For Completion.
|
||||
(line 22)
|
||||
(line 26)
|
||||
* menu-complete-backward (): Commands For Completion.
|
||||
(line 34)
|
||||
(line 38)
|
||||
* next-history (C-n): Commands For History. (line 17)
|
||||
* non-incremental-forward-search-history (M-n): Commands For History.
|
||||
(line 41)
|
||||
@@ -10253,132 +10274,132 @@ D.5 Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top1344
|
||||
Node: Introduction3181
|
||||
Node: What is Bash?3409
|
||||
Node: What is a shell?4522
|
||||
Node: Definitions7062
|
||||
Node: Basic Shell Features9980
|
||||
Node: Shell Syntax11199
|
||||
Node: Shell Operation12229
|
||||
Node: Quoting13523
|
||||
Node: Escape Character14826
|
||||
Node: Single Quotes15311
|
||||
Node: Double Quotes15659
|
||||
Node: ANSI-C Quoting16784
|
||||
Node: Locale Translation17769
|
||||
Node: Comments18665
|
||||
Node: Shell Commands19283
|
||||
Node: Simple Commands20107
|
||||
Node: Pipelines20738
|
||||
Node: Lists22994
|
||||
Node: Compound Commands24723
|
||||
Node: Looping Constructs25527
|
||||
Node: Conditional Constructs27982
|
||||
Node: Command Grouping36095
|
||||
Node: Coprocesses37574
|
||||
Node: Shell Functions39218
|
||||
Node: Shell Parameters43772
|
||||
Node: Positional Parameters46188
|
||||
Node: Special Parameters47088
|
||||
Node: Shell Expansions50052
|
||||
Node: Brace Expansion51977
|
||||
Node: Tilde Expansion54732
|
||||
Node: Shell Parameter Expansion57083
|
||||
Node: Command Substitution65984
|
||||
Node: Arithmetic Expansion67317
|
||||
Node: Process Substitution68167
|
||||
Node: Word Splitting69217
|
||||
Node: Filename Expansion70840
|
||||
Node: Pattern Matching72979
|
||||
Node: Quote Removal76618
|
||||
Node: Redirections76913
|
||||
Node: Executing Commands85438
|
||||
Node: Simple Command Expansion86108
|
||||
Node: Command Search and Execution88038
|
||||
Node: Command Execution Environment90375
|
||||
Node: Environment93361
|
||||
Node: Exit Status95021
|
||||
Node: Signals96642
|
||||
Node: Shell Scripts98610
|
||||
Node: Shell Builtin Commands101128
|
||||
Node: Bourne Shell Builtins103156
|
||||
Node: Bash Builtins120532
|
||||
Node: Modifying Shell Behavior145360
|
||||
Node: The Set Builtin145705
|
||||
Node: The Shopt Builtin155229
|
||||
Node: Special Builtins166563
|
||||
Node: Shell Variables167542
|
||||
Node: Bourne Shell Variables167982
|
||||
Node: Bash Variables169963
|
||||
Node: Bash Features194096
|
||||
Node: Invoking Bash194979
|
||||
Node: Bash Startup Files200788
|
||||
Node: Interactive Shells205800
|
||||
Node: What is an Interactive Shell?206210
|
||||
Node: Is this Shell Interactive?206859
|
||||
Node: Interactive Shell Behavior207674
|
||||
Node: Bash Conditional Expressions210954
|
||||
Node: Shell Arithmetic214603
|
||||
Node: Aliases217349
|
||||
Node: Arrays219921
|
||||
Node: The Directory Stack223879
|
||||
Node: Directory Stack Builtins224593
|
||||
Node: Printing a Prompt227485
|
||||
Node: The Restricted Shell230237
|
||||
Node: Bash POSIX Mode232069
|
||||
Node: Job Control240126
|
||||
Node: Job Control Basics240586
|
||||
Node: Job Control Builtins245303
|
||||
Node: Job Control Variables249667
|
||||
Node: Command Line Editing250825
|
||||
Node: Introduction and Notation252392
|
||||
Node: Readline Interaction254014
|
||||
Node: Readline Bare Essentials255205
|
||||
Node: Readline Movement Commands256994
|
||||
Node: Readline Killing Commands257959
|
||||
Node: Readline Arguments259879
|
||||
Node: Searching260923
|
||||
Node: Readline Init File263109
|
||||
Node: Readline Init File Syntax264256
|
||||
Node: Conditional Init Constructs278743
|
||||
Node: Sample Init File281276
|
||||
Node: Bindable Readline Commands284393
|
||||
Node: Commands For Moving285600
|
||||
Node: Commands For History286744
|
||||
Node: Commands For Text289899
|
||||
Node: Commands For Killing292572
|
||||
Node: Numeric Arguments295023
|
||||
Node: Commands For Completion296162
|
||||
Node: Keyboard Macros300122
|
||||
Node: Miscellaneous Commands300693
|
||||
Node: Readline vi Mode306499
|
||||
Node: Programmable Completion307413
|
||||
Node: Programmable Completion Builtins314619
|
||||
Node: Using History Interactively323755
|
||||
Node: Bash History Facilities324439
|
||||
Node: Bash History Builtins327353
|
||||
Node: History Interaction331210
|
||||
Node: Event Designators333915
|
||||
Node: Word Designators334930
|
||||
Node: Modifiers336569
|
||||
Node: Installing Bash337973
|
||||
Node: Basic Installation339110
|
||||
Node: Compilers and Options341802
|
||||
Node: Compiling For Multiple Architectures342543
|
||||
Node: Installation Names344207
|
||||
Node: Specifying the System Type345025
|
||||
Node: Sharing Defaults345741
|
||||
Node: Operation Controls346414
|
||||
Node: Optional Features347372
|
||||
Node: Reporting Bugs356931
|
||||
Node: Major Differences From The Bourne Shell358132
|
||||
Node: GNU Free Documentation License374819
|
||||
Node: Indexes400015
|
||||
Node: Builtin Index400469
|
||||
Node: Reserved Word Index407296
|
||||
Node: Variable Index409744
|
||||
Node: Function Index422202
|
||||
Node: Concept Index429211
|
||||
Node: Top1340
|
||||
Node: Introduction3173
|
||||
Node: What is Bash?3401
|
||||
Node: What is a shell?4514
|
||||
Node: Definitions7054
|
||||
Node: Basic Shell Features9972
|
||||
Node: Shell Syntax11191
|
||||
Node: Shell Operation12221
|
||||
Node: Quoting13515
|
||||
Node: Escape Character14818
|
||||
Node: Single Quotes15303
|
||||
Node: Double Quotes15651
|
||||
Node: ANSI-C Quoting16776
|
||||
Node: Locale Translation17761
|
||||
Node: Comments18657
|
||||
Node: Shell Commands19275
|
||||
Node: Simple Commands20099
|
||||
Node: Pipelines20730
|
||||
Node: Lists22986
|
||||
Node: Compound Commands24715
|
||||
Node: Looping Constructs25519
|
||||
Node: Conditional Constructs27974
|
||||
Node: Command Grouping36087
|
||||
Node: Coprocesses37566
|
||||
Node: Shell Functions39210
|
||||
Node: Shell Parameters43764
|
||||
Node: Positional Parameters46180
|
||||
Node: Special Parameters47080
|
||||
Node: Shell Expansions50044
|
||||
Node: Brace Expansion51969
|
||||
Node: Tilde Expansion54724
|
||||
Node: Shell Parameter Expansion57075
|
||||
Node: Command Substitution65976
|
||||
Node: Arithmetic Expansion67309
|
||||
Node: Process Substitution68159
|
||||
Node: Word Splitting69209
|
||||
Node: Filename Expansion70832
|
||||
Node: Pattern Matching72971
|
||||
Node: Quote Removal76610
|
||||
Node: Redirections76905
|
||||
Node: Executing Commands85430
|
||||
Node: Simple Command Expansion86100
|
||||
Node: Command Search and Execution88030
|
||||
Node: Command Execution Environment90367
|
||||
Node: Environment93353
|
||||
Node: Exit Status95013
|
||||
Node: Signals96634
|
||||
Node: Shell Scripts98602
|
||||
Node: Shell Builtin Commands101120
|
||||
Node: Bourne Shell Builtins103148
|
||||
Node: Bash Builtins120616
|
||||
Node: Modifying Shell Behavior145759
|
||||
Node: The Set Builtin146104
|
||||
Node: The Shopt Builtin155628
|
||||
Node: Special Builtins166962
|
||||
Node: Shell Variables167941
|
||||
Node: Bourne Shell Variables168381
|
||||
Node: Bash Variables170362
|
||||
Node: Bash Features194495
|
||||
Node: Invoking Bash195378
|
||||
Node: Bash Startup Files201142
|
||||
Node: Interactive Shells206154
|
||||
Node: What is an Interactive Shell?206564
|
||||
Node: Is this Shell Interactive?207213
|
||||
Node: Interactive Shell Behavior208028
|
||||
Node: Bash Conditional Expressions211308
|
||||
Node: Shell Arithmetic214957
|
||||
Node: Aliases217716
|
||||
Node: Arrays220288
|
||||
Node: The Directory Stack224246
|
||||
Node: Directory Stack Builtins224960
|
||||
Node: Printing a Prompt227852
|
||||
Node: The Restricted Shell230604
|
||||
Node: Bash POSIX Mode232436
|
||||
Node: Job Control240493
|
||||
Node: Job Control Basics240953
|
||||
Node: Job Control Builtins245670
|
||||
Node: Job Control Variables250034
|
||||
Node: Command Line Editing251192
|
||||
Node: Introduction and Notation252759
|
||||
Node: Readline Interaction254381
|
||||
Node: Readline Bare Essentials255572
|
||||
Node: Readline Movement Commands257361
|
||||
Node: Readline Killing Commands258326
|
||||
Node: Readline Arguments260246
|
||||
Node: Searching261290
|
||||
Node: Readline Init File263476
|
||||
Node: Readline Init File Syntax264623
|
||||
Node: Conditional Init Constructs279472
|
||||
Node: Sample Init File282005
|
||||
Node: Bindable Readline Commands285122
|
||||
Node: Commands For Moving286329
|
||||
Node: Commands For History287473
|
||||
Node: Commands For Text290628
|
||||
Node: Commands For Killing293301
|
||||
Node: Numeric Arguments295752
|
||||
Node: Commands For Completion296891
|
||||
Node: Keyboard Macros301083
|
||||
Node: Miscellaneous Commands301654
|
||||
Node: Readline vi Mode307460
|
||||
Node: Programmable Completion308367
|
||||
Node: Programmable Completion Builtins315577
|
||||
Node: Using History Interactively324713
|
||||
Node: Bash History Facilities325397
|
||||
Node: Bash History Builtins328311
|
||||
Node: History Interaction332168
|
||||
Node: Event Designators334873
|
||||
Node: Word Designators335888
|
||||
Node: Modifiers337527
|
||||
Node: Installing Bash338931
|
||||
Node: Basic Installation340068
|
||||
Node: Compilers and Options342760
|
||||
Node: Compiling For Multiple Architectures343501
|
||||
Node: Installation Names345165
|
||||
Node: Specifying the System Type345983
|
||||
Node: Sharing Defaults346699
|
||||
Node: Operation Controls347372
|
||||
Node: Optional Features348330
|
||||
Node: Reporting Bugs357889
|
||||
Node: Major Differences From The Bourne Shell359090
|
||||
Node: GNU Free Documentation License375777
|
||||
Node: Indexes400973
|
||||
Node: Builtin Index401427
|
||||
Node: Reserved Word Index408254
|
||||
Node: Variable Index410702
|
||||
Node: Function Index423442
|
||||
Node: Concept Index430451
|
||||
|
||||
End Tag Table
|
||||
|
||||
+17
-17
@@ -1,4 +1,4 @@
|
||||
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.12.11) 15 JAN 2010 14:35
|
||||
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.12.11) 20 MAY 2010 16:33
|
||||
**/Users/chet/src/bash/src/doc/bashref.texi
|
||||
(/Users/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
|
||||
Loading texinfo [version 2009-01-18.17]:
|
||||
@@ -193,7 +193,7 @@ textttsl pat-tern@texttt ][]) @textttsl command-list @texttt ;;][] esac[][]
|
||||
[10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24]
|
||||
[25] [26] [27] [28] [29] [30] [31] [32] Chapter 4 [33] [34] [35] [36] [37]
|
||||
[38] [39] [40] [41]
|
||||
Underfull \hbox (badness 5231) in paragraph at lines 3300--3313
|
||||
Underfull \hbox (badness 5231) in paragraph at lines 3302--3315
|
||||
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
|
||||
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
|
||||
|
||||
@@ -206,7 +206,7 @@ m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
|
||||
.etc.
|
||||
|
||||
[42] [43] [44] [45] [46]
|
||||
Overfull \hbox (172.34125pt too wide) in paragraph at lines 3726--3726
|
||||
Overfull \hbox (172.34125pt too wide) in paragraph at lines 3733--3733
|
||||
[]@texttt read [-ers] [-a @textttsl aname@texttt ] [-d @textttsl de-lim@texttt
|
||||
] [-i @textttsl text@texttt ] [-n @textttsl nchars@texttt ] [-N @textttsl ncha
|
||||
rs@texttt ] [-p @textttsl prompt@texttt ] [-t @textttsl time-
|
||||
@@ -221,7 +221,7 @@ rs@texttt ] [-p @textttsl prompt@texttt ] [-t @textttsl time-
|
||||
|
||||
[47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] Chapter 5 [59]
|
||||
[60] [61] [62] [63] [64] [65] [66] [67] [68] [69] Chapter 6 [70]
|
||||
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5313--5313
|
||||
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5321--5321
|
||||
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
|
||||
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
|
||||
@@ -234,7 +234,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
.etc.
|
||||
|
||||
|
||||
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5314--5314
|
||||
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5322--5322
|
||||
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
|
||||
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
|
||||
-
|
||||
@@ -248,7 +248,7 @@ Overfull \hbox (76.23077pt too wide) in paragraph at lines 5314--5314
|
||||
.etc.
|
||||
|
||||
|
||||
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5315--5315
|
||||
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5323--5323
|
||||
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
|
||||
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
|
||||
@@ -261,7 +261,7 @@ tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
.etc.
|
||||
|
||||
[71] [72]
|
||||
Underfull \hbox (badness 2245) in paragraph at lines 5489--5491
|
||||
Underfull \hbox (badness 2245) in paragraph at lines 5496--5498
|
||||
[]@textrm When a lo-gin shell ex-its, Bash reads and ex-e-cutes com-mands from
|
||||
the file
|
||||
|
||||
@@ -273,8 +273,8 @@ the file
|
||||
.@textrm n
|
||||
.etc.
|
||||
|
||||
[73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86]
|
||||
Underfull \hbox (badness 2521) in paragraph at lines 6637--6640
|
||||
[73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85]
|
||||
Underfull \hbox (badness 2521) in paragraph at lines 6644--6647
|
||||
@textrm `@texttt --enable-strict-posix-default[]@textrm '[] to @texttt configur
|
||||
e[] @textrm when build-ing (see Sec-tion 10.8
|
||||
|
||||
@@ -286,10 +286,10 @@ e[] @textrm when build-ing (see Sec-tion 10.8
|
||||
.@texttt n
|
||||
.etc.
|
||||
|
||||
Chapter 7 [87] [88] [89] [90] [91]
|
||||
Chapter 7 [86] [87] [88] [89] [90] [91]
|
||||
(/Users/chet/src/bash/src/lib/readline/doc/rluser.texi Chapter 8 [92] [93]
|
||||
[94] [95] [96] [97] [98]
|
||||
Underfull \hbox (badness 5231) in paragraph at lines 535--551
|
||||
Underfull \hbox (badness 5231) in paragraph at lines 545--561
|
||||
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
|
||||
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
|
||||
|
||||
@@ -302,7 +302,7 @@ m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
|
||||
.etc.
|
||||
|
||||
[99] [100] [101] [102] [103]
|
||||
Overfull \hbox (26.43913pt too wide) in paragraph at lines 871--871
|
||||
Overfull \hbox (26.43913pt too wide) in paragraph at lines 882--882
|
||||
[]@texttt Meta-Control-h: backward-kill-word Text after the function name is i
|
||||
gnored[]
|
||||
|
||||
@@ -316,7 +316,7 @@ gnored[]
|
||||
|
||||
[104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115]
|
||||
[116]
|
||||
Overfull \hbox (12.05716pt too wide) in paragraph at lines 1789--1789
|
||||
Overfull \hbox (12.05716pt too wide) in paragraph at lines 1803--1803
|
||||
[]@texttt complete [-abcdefgjksuv] [-o @textttsl comp-option@texttt ] [-DE] [-
|
||||
A @textttsl ac-tion@texttt ] [-
|
||||
|
||||
@@ -329,7 +329,7 @@ A @textttsl ac-tion@texttt ] [-
|
||||
.etc.
|
||||
|
||||
[117] [118]
|
||||
Underfull \hbox (badness 2753) in paragraph at lines 1899--1902
|
||||
Underfull \hbox (badness 2753) in paragraph at lines 1913--1916
|
||||
@texttt hostname[]@textrm Hostnames, as taken from the file spec-i-fied by
|
||||
|
||||
@hbox(7.60416+2.12917)x433.62, glue set 3.02202
|
||||
@@ -342,7 +342,7 @@ Underfull \hbox (badness 2753) in paragraph at lines 1899--1902
|
||||
|
||||
[119]) (/Users/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
|
||||
[120] [121] [122] [123] [124]) Chapter 10 [125] [126] [127] [128] [129]
|
||||
Underfull \hbox (badness 2772) in paragraph at lines 7238--7242
|
||||
Underfull \hbox (badness 2772) in paragraph at lines 7245--7249
|
||||
[]@textrm Enable sup-port for large files (@texttt http://www.sas.com/standard
|
||||
s/large_
|
||||
|
||||
@@ -362,10 +362,10 @@ s/large_
|
||||
Here is how much of TeX's memory you used:
|
||||
2078 strings out of 97980
|
||||
28503 string characters out of 1221004
|
||||
65670 words of memory out of 1500000
|
||||
65573 words of memory out of 1500000
|
||||
2894 multiletter control sequences out of 10000+50000
|
||||
32127 words of font info for 112 fonts, out of 1200000 for 2000
|
||||
51 hyphenation exceptions out of 8191
|
||||
16i,6n,14p,315b,699s stack positions out of 5000i,500n,6000p,200000b,5000s
|
||||
|
||||
Output written on bashref.dvi (164 pages, 666524 bytes).
|
||||
Output written on bashref.dvi (164 pages, 668052 bytes).
|
||||
|
||||
Binary file not shown.
+2512
-2487
File diff suppressed because it is too large
Load Diff
@@ -522,6 +522,12 @@ the eight-bit character whose value is the octal value @var{nnn}
|
||||
@item \x@var{HH}
|
||||
the eight-bit character whose value is the hexadecimal value @var{HH}
|
||||
(one or two hex digits)
|
||||
@item \u@var{HHHH}
|
||||
the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
|
||||
@var{HHHH} (one to four hex digits)
|
||||
@item \U@var{HHHHHHHH}
|
||||
the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
|
||||
@var{HHHHHHHH} (one to eight hex digits)
|
||||
@item \c@var{x}
|
||||
a control-@var{x} character
|
||||
@end table
|
||||
@@ -3557,6 +3563,12 @@ the eight-bit character whose value is the octal value @var{nnn}
|
||||
@item \x@var{HH}
|
||||
the eight-bit character whose value is the hexadecimal value @var{HH}
|
||||
(one or two hex digits)
|
||||
@item \u@var{HHHH}
|
||||
the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
|
||||
@var{HHHH} (one to four hex digits)
|
||||
@item \U@var{HHHHHHHH}
|
||||
the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
|
||||
@var{HHHHHHHH} (one to eight hex digits)
|
||||
@end table
|
||||
|
||||
@item enable
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ This is Edition @value{EDITION}, last updated @value{UPDATED},
|
||||
of @cite{The GNU Bash Reference Manual},
|
||||
for @code{Bash}, Version @value{VERSION}.
|
||||
|
||||
Copyright @copyright{} 1988--2009 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 1988--2010 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ This is Edition @value{EDITION}, last updated @value{UPDATED},
|
||||
of @cite{The GNU Bash Reference Manual},
|
||||
for @code{Bash}, Version @value{VERSION}.
|
||||
|
||||
Copyright @copyright{} 1988--2009 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 1988--2010 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@
|
||||
@numchapentry{Bash Features}{6}{Bash Features}{71}
|
||||
@numsecentry{Invoking Bash}{6.1}{Invoking Bash}{71}
|
||||
@numsecentry{Bash Startup Files}{6.2}{Bash Startup Files}{73}
|
||||
@numsecentry{Interactive Shells}{6.3}{Interactive Shells}{75}
|
||||
@numsecentry{Interactive Shells}{6.3}{Interactive Shells}{74}
|
||||
@numsubsecentry{What is an Interactive Shell?}{6.3.1}{What is an Interactive Shell?}{75}
|
||||
@numsubsecentry{Is this Shell Interactive?}{6.3.2}{Is this Shell Interactive?}{75}
|
||||
@numsubsecentry{Interactive Shell Behavior}{6.3.3}{Interactive Shell Behavior}{75}
|
||||
@@ -106,7 +106,7 @@
|
||||
@numsubsecentry{Letting Readline Type For You}{8.4.6}{Commands For Completion}{110}
|
||||
@numsubsecentry{Keyboard Macros}{8.4.7}{Keyboard Macros}{112}
|
||||
@numsubsecentry{Some Miscellaneous Commands}{8.4.8}{Miscellaneous Commands}{112}
|
||||
@numsecentry{Readline vi Mode}{8.5}{Readline vi Mode}{114}
|
||||
@numsecentry{Readline vi Mode}{8.5}{Readline vi Mode}{115}
|
||||
@numsecentry{Programmable Completion}{8.6}{Programmable Completion}{115}
|
||||
@numsecentry{Programmable Completion Builtins}{8.7}{Programmable Completion Builtins}{117}
|
||||
@numchapentry{Using History Interactively}{9}{Using History Interactively}{121}
|
||||
|
||||
+4
-2
@@ -107,6 +107,8 @@
|
||||
\entry{bell-style}{97}{\code {bell-style}}
|
||||
\entry{bind-tty-special-chars}{97}{\code {bind-tty-special-chars}}
|
||||
\entry{comment-begin}{97}{\code {comment-begin}}
|
||||
\entry{completion-display-width}{97}{\code {completion-display-width}}
|
||||
\entry{completion-ignore-case}{97}{\code {completion-ignore-case}}
|
||||
\entry{completion-prefix-display-length}{97}{\code {completion-prefix-display-length}}
|
||||
\entry{completion-query-items}{97}{\code {completion-query-items}}
|
||||
\entry{convert-meta}{98}{\code {convert-meta}}
|
||||
@@ -116,7 +118,7 @@
|
||||
\entry{expand-tilde}{98}{\code {expand-tilde}}
|
||||
\entry{history-preserve-point}{98}{\code {history-preserve-point}}
|
||||
\entry{history-size}{98}{\code {history-size}}
|
||||
\entry{horizontal-scroll-mode}{98}{\code {horizontal-scroll-mode}}
|
||||
\entry{horizontal-scroll-mode}{99}{\code {horizontal-scroll-mode}}
|
||||
\entry{input-meta}{99}{\code {input-meta}}
|
||||
\entry{meta-flag}{99}{\code {meta-flag}}
|
||||
\entry{isearch-terminators}{99}{\code {isearch-terminators}}
|
||||
@@ -125,7 +127,7 @@
|
||||
\entry{mark-symlinked-directories}{99}{\code {mark-symlinked-directories}}
|
||||
\entry{match-hidden-files}{99}{\code {match-hidden-files}}
|
||||
\entry{output-meta}{99}{\code {output-meta}}
|
||||
\entry{page-completions}{99}{\code {page-completions}}
|
||||
\entry{page-completions}{100}{\code {page-completions}}
|
||||
\entry{revert-all-at-newline}{100}{\code {revert-all-at-newline}}
|
||||
\entry{show-all-if-ambiguous}{100}{\code {show-all-if-ambiguous}}
|
||||
\entry{show-all-if-unmodified}{100}{\code {show-all-if-unmodified}}
|
||||
|
||||
+4
-2
@@ -49,6 +49,8 @@
|
||||
\entry {\code {COMP_TYPE}}{64}
|
||||
\entry {\code {COMP_WORDBREAKS}}{64}
|
||||
\entry {\code {COMP_WORDS}}{64}
|
||||
\entry {\code {completion-display-width}}{97}
|
||||
\entry {\code {completion-ignore-case}}{97}
|
||||
\entry {\code {completion-prefix-display-length}}{97}
|
||||
\entry {\code {completion-query-items}}{97}
|
||||
\entry {\code {COMPREPLY}}{65}
|
||||
@@ -83,7 +85,7 @@
|
||||
\entry {\code {HISTSIZE}}{66}
|
||||
\entry {\code {HISTTIMEFORMAT}}{67}
|
||||
\entry {\code {HOME}}{61}
|
||||
\entry {\code {horizontal-scroll-mode}}{98}
|
||||
\entry {\code {horizontal-scroll-mode}}{99}
|
||||
\entry {\code {HOSTFILE}}{67}
|
||||
\entry {\code {HOSTNAME}}{67}
|
||||
\entry {\code {HOSTTYPE}}{67}
|
||||
@@ -122,7 +124,7 @@
|
||||
\entry {\code {OSTYPE}}{68}
|
||||
\entry {\code {output-meta}}{99}
|
||||
\initial {P}
|
||||
\entry {\code {page-completions}}{99}
|
||||
\entry {\code {page-completions}}{100}
|
||||
\entry {\code {PATH}}{61}
|
||||
\entry {\code {PIPESTATUS}}{68}
|
||||
\entry {\code {POSIXLY_CORRECT}}{68}
|
||||
|
||||
+106
-100
@@ -617,25 +617,26 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
an error occurs.
|
||||
|
||||
hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e]
|
||||
For each _n_a_m_e, the full file name of the command is determined
|
||||
by searching the directories in $$PPAATTHH and remembered. If the --pp
|
||||
option is supplied, no path search is performed, and _f_i_l_e_n_a_m_e is
|
||||
used as the full file name of the command. The --rr option causes
|
||||
the shell to forget all remembered locations. The --dd option
|
||||
causes the shell to forget the remembered location of each _n_a_m_e.
|
||||
If the --tt option is supplied, the full pathname to which each
|
||||
_n_a_m_e corresponds is printed. If multiple _n_a_m_e arguments are
|
||||
supplied with --tt, the _n_a_m_e is printed before the hashed full
|
||||
pathname. The --ll option causes output to be displayed in a for-
|
||||
mat that may be reused as input. If no arguments are given, or
|
||||
if only --ll is supplied, information about remembered commands is
|
||||
printed. The return status is true unless a _n_a_m_e is not found
|
||||
or an invalid option is supplied.
|
||||
Each time hhaasshh is invoked, the full pathname of the command _n_a_m_e
|
||||
is determined by searching the directories in $$PPAATTHH and remem-
|
||||
bered. Any previously-remembered pathname is discarded. If the
|
||||
--pp option is supplied, no path search is performed, and _f_i_l_e_n_a_m_e
|
||||
is used as the full file name of the command. The --rr option
|
||||
causes the shell to forget all remembered locations. The --dd
|
||||
option causes the shell to forget the remembered location of
|
||||
each _n_a_m_e. If the --tt option is supplied, the full pathname to
|
||||
which each _n_a_m_e corresponds is printed. If multiple _n_a_m_e argu-
|
||||
ments are supplied with --tt, the _n_a_m_e is printed before the
|
||||
hashed full pathname. The --ll option causes output to be dis-
|
||||
played in a format that may be reused as input. If no arguments
|
||||
are given, or if only --ll is supplied, information about remem-
|
||||
bered commands is printed. The return status is true unless a
|
||||
_n_a_m_e is not found or an invalid option is supplied.
|
||||
|
||||
hheellpp [--ddmmss] [_p_a_t_t_e_r_n]
|
||||
Display helpful information about builtin commands. If _p_a_t_t_e_r_n
|
||||
is specified, hheellpp gives detailed help on all commands matching
|
||||
_p_a_t_t_e_r_n; otherwise help for all the builtins and shell control
|
||||
Display helpful information about builtin commands. If _p_a_t_t_e_r_n
|
||||
is specified, hheellpp gives detailed help on all commands matching
|
||||
_p_a_t_t_e_r_n; otherwise help for all the builtins and shell control
|
||||
structures is printed.
|
||||
--dd Display a short description of each _p_a_t_t_e_r_n
|
||||
--mm Display the description of each _p_a_t_t_e_r_n in a manpage-like
|
||||
@@ -651,44 +652,44 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
hhiissttoorryy --ss _a_r_g [_a_r_g _._._.]
|
||||
With no options, display the command history list with line num-
|
||||
bers. Lines listed with a ** have been modified. An argument of
|
||||
_n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE--
|
||||
FFOORRMMAATT is set and not null, it is used as a format string for
|
||||
_s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis-
|
||||
played history entry. No intervening blank is printed between
|
||||
the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is
|
||||
supplied, it is used as the name of the history file; if not,
|
||||
the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the
|
||||
_n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE--
|
||||
FFOORRMMAATT is set and not null, it is used as a format string for
|
||||
_s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis-
|
||||
played history entry. No intervening blank is printed between
|
||||
the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is
|
||||
supplied, it is used as the name of the history file; if not,
|
||||
the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the
|
||||
following meanings:
|
||||
--cc Clear the history list by deleting all the entries.
|
||||
--dd _o_f_f_s_e_t
|
||||
Delete the history entry at position _o_f_f_s_e_t.
|
||||
--aa Append the ``new'' history lines (history lines entered
|
||||
since the beginning of the current bbaasshh session) to the
|
||||
--aa Append the ``new'' history lines (history lines entered
|
||||
since the beginning of the current bbaasshh session) to the
|
||||
history file.
|
||||
--nn Read the history lines not already read from the history
|
||||
file into the current history list. These are lines
|
||||
appended to the history file since the beginning of the
|
||||
--nn Read the history lines not already read from the history
|
||||
file into the current history list. These are lines
|
||||
appended to the history file since the beginning of the
|
||||
current bbaasshh session.
|
||||
--rr Read the contents of the history file and use them as the
|
||||
current history.
|
||||
--ww Write the current history to the history file, overwrit-
|
||||
--ww Write the current history to the history file, overwrit-
|
||||
ing the history file's contents.
|
||||
--pp Perform history substitution on the following _a_r_g_s and
|
||||
display the result on the standard output. Does not
|
||||
store the results in the history list. Each _a_r_g must be
|
||||
--pp Perform history substitution on the following _a_r_g_s and
|
||||
display the result on the standard output. Does not
|
||||
store the results in the history list. Each _a_r_g must be
|
||||
quoted to disable normal history expansion.
|
||||
--ss Store the _a_r_g_s in the history list as a single entry.
|
||||
The last command in the history list is removed before
|
||||
--ss Store the _a_r_g_s in the history list as a single entry.
|
||||
The last command in the history list is removed before
|
||||
the _a_r_g_s are added.
|
||||
|
||||
If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa-
|
||||
tion associated with each history entry is written to the his-
|
||||
tory file, marked with the history comment character. When the
|
||||
history file is read, lines beginning with the history comment
|
||||
character followed immediately by a digit are interpreted as
|
||||
If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa-
|
||||
tion associated with each history entry is written to the his-
|
||||
tory file, marked with the history comment character. When the
|
||||
history file is read, lines beginning with the history comment
|
||||
character followed immediately by a digit are interpreted as
|
||||
timestamps for the previous history line. The return value is 0
|
||||
unless an invalid option is encountered, an error occurs while
|
||||
reading or writing the history file, an invalid _o_f_f_s_e_t is sup-
|
||||
unless an invalid option is encountered, an error occurs while
|
||||
reading or writing the history file, an invalid _o_f_f_s_e_t is sup-
|
||||
plied as an argument to --dd, or the history expansion supplied as
|
||||
an argument to --pp fails.
|
||||
|
||||
@@ -697,125 +698,130 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
The first form lists the active jobs. The options have the fol-
|
||||
lowing meanings:
|
||||
--ll List process IDs in addition to the normal information.
|
||||
--nn Display information only about jobs that have changed
|
||||
status since the user was last notified of their status.
|
||||
--pp List only the process ID of the job's process group
|
||||
--nn Display information only about jobs that have changed
|
||||
status since the user was last notified of their status.
|
||||
--pp List only the process ID of the job's process group
|
||||
leader.
|
||||
--rr Restrict output to running jobs.
|
||||
--ss Restrict output to stopped jobs.
|
||||
|
||||
If _j_o_b_s_p_e_c is given, output is restricted to information about
|
||||
that job. The return status is 0 unless an invalid option is
|
||||
If _j_o_b_s_p_e_c is given, output is restricted to information about
|
||||
that job. The return status is 0 unless an invalid option is
|
||||
encountered or an invalid _j_o_b_s_p_e_c is supplied.
|
||||
|
||||
If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in
|
||||
_c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and
|
||||
_c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and
|
||||
executes _c_o_m_m_a_n_d passing it _a_r_g_s, returning its exit status.
|
||||
|
||||
kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ...
|
||||
kkiillll --ll [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s]
|
||||
Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes
|
||||
named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive
|
||||
signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or
|
||||
a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not
|
||||
present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the
|
||||
signal names. If any arguments are supplied when --ll is given,
|
||||
the names of the signals corresponding to the arguments are
|
||||
Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes
|
||||
named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive
|
||||
signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or
|
||||
a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not
|
||||
present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the
|
||||
signal names. If any arguments are supplied when --ll is given,
|
||||
the names of the signals corresponding to the arguments are
|
||||
listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to
|
||||
--ll is a number specifying either a signal number or the exit
|
||||
status of a process terminated by a signal. kkiillll returns true
|
||||
if at least one signal was successfully sent, or false if an
|
||||
--ll is a number specifying either a signal number or the exit
|
||||
status of a process terminated by a signal. kkiillll returns true
|
||||
if at least one signal was successfully sent, or false if an
|
||||
error occurs or an invalid option is encountered.
|
||||
|
||||
lleett _a_r_g [_a_r_g ...]
|
||||
Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH--
|
||||
MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett
|
||||
MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett
|
||||
returns 1; 0 is returned otherwise.
|
||||
|
||||
llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ...]
|
||||
For each argument, a local variable named _n_a_m_e is created, and
|
||||
assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted
|
||||
For each argument, a local variable named _n_a_m_e is created, and
|
||||
assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted
|
||||
by ddeeccllaarree. When llooccaall is used within a function, it causes the
|
||||
variable _n_a_m_e to have a visible scope restricted to that func-
|
||||
variable _n_a_m_e to have a visible scope restricted to that func-
|
||||
tion and its children. With no operands, llooccaall writes a list of
|
||||
local variables to the standard output. It is an error to use
|
||||
local variables to the standard output. It is an error to use
|
||||
llooccaall when not within a function. The return status is 0 unless
|
||||
llooccaall is used outside a function, an invalid _n_a_m_e is supplied,
|
||||
llooccaall is used outside a function, an invalid _n_a_m_e is supplied,
|
||||
or _n_a_m_e is a readonly variable.
|
||||
|
||||
llooggoouutt Exit a login shell.
|
||||
|
||||
mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
|
||||
mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
|
||||
[--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
|
||||
rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
|
||||
rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
|
||||
[--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
|
||||
Read lines from the standard input into the indexed array vari-
|
||||
able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup-
|
||||
plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if
|
||||
Read lines from the standard input into the indexed array vari-
|
||||
able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup-
|
||||
plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if
|
||||
supplied, have the following meanings:
|
||||
--nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are
|
||||
--nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are
|
||||
copied.
|
||||
--OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default
|
||||
--OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default
|
||||
index is 0.
|
||||
--ss Discard the first _c_o_u_n_t lines read.
|
||||
--tt Remove a trailing newline from each line read.
|
||||
--uu Read lines from file descriptor _f_d instead of the stan-
|
||||
--uu Read lines from file descriptor _f_d instead of the stan-
|
||||
dard input.
|
||||
--CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The
|
||||
--CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The
|
||||
--cc option specifies _q_u_a_n_t_u_m.
|
||||
--cc Specify the number of lines read between each call to
|
||||
--cc Specify the number of lines read between each call to
|
||||
_c_a_l_l_b_a_c_k.
|
||||
|
||||
If --CC is specified without --cc, the default quantum is 5000.
|
||||
If --CC is specified without --cc, the default quantum is 5000.
|
||||
When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next
|
||||
array element to be assigned as an additional argument. _c_a_l_l_-
|
||||
_b_a_c_k is evaluated after the line is read but before the array
|
||||
array element to be assigned as an additional argument. _c_a_l_l_-
|
||||
_b_a_c_k is evaluated after the line is read but before the array
|
||||
element is assigned.
|
||||
|
||||
If not supplied with an explicit origin, mmaappffiillee will clear
|
||||
If not supplied with an explicit origin, mmaappffiillee will clear
|
||||
_a_r_r_a_y before assigning to it.
|
||||
|
||||
mmaappffiillee returns successfully unless an invalid option or option
|
||||
argument is supplied, _a_r_r_a_y is invalid or unassignable, or if
|
||||
mmaappffiillee returns successfully unless an invalid option or option
|
||||
argument is supplied, _a_r_r_a_y is invalid or unassignable, or if
|
||||
_a_r_r_a_y is not an indexed array.
|
||||
|
||||
ppooppdd [-nn] [+_n] [-_n]
|
||||
Removes entries from the directory stack. With no arguments,
|
||||
removes the top directory from the stack, and performs a ccdd to
|
||||
Removes entries from the directory stack. With no arguments,
|
||||
removes the top directory from the stack, and performs a ccdd to
|
||||
the new top directory. Arguments, if supplied, have the follow-
|
||||
ing meanings:
|
||||
--nn Suppresses the normal change of directory when removing
|
||||
directories from the stack, so that only the stack is
|
||||
--nn Suppresses the normal change of directory when removing
|
||||
directories from the stack, so that only the stack is
|
||||
manipulated.
|
||||
++_n Removes the _nth entry counting from the left of the list
|
||||
shown by ddiirrss, starting with zero. For example: ``popd
|
||||
++_n Removes the _nth entry counting from the left of the list
|
||||
shown by ddiirrss, starting with zero. For example: ``popd
|
||||
+0'' removes the first directory, ``popd +1'' the second.
|
||||
--_n Removes the _nth entry counting from the right of the list
|
||||
shown by ddiirrss, starting with zero. For example: ``popd
|
||||
-0'' removes the last directory, ``popd -1'' the next to
|
||||
shown by ddiirrss, starting with zero. For example: ``popd
|
||||
-0'' removes the last directory, ``popd -1'' the next to
|
||||
last.
|
||||
|
||||
If the ppooppdd command is successful, a ddiirrss is performed as well,
|
||||
and the return status is 0. ppooppdd returns false if an invalid
|
||||
If the ppooppdd command is successful, a ddiirrss is performed as well,
|
||||
and the return status is 0. ppooppdd returns false if an invalid
|
||||
option is encountered, the directory stack is empty, a non-exis-
|
||||
tent directory stack entry is specified, or the directory change
|
||||
fails.
|
||||
|
||||
pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s]
|
||||
Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the
|
||||
control of the _f_o_r_m_a_t. The _f_o_r_m_a_t is a character string which
|
||||
contains three types of objects: plain characters, which are
|
||||
simply copied to standard output, character escape sequences,
|
||||
which are converted and copied to the standard output, and for-
|
||||
mat specifications, each of which causes printing of the next
|
||||
Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the
|
||||
control of the _f_o_r_m_a_t. The _f_o_r_m_a_t is a character string which
|
||||
contains three types of objects: plain characters, which are
|
||||
simply copied to standard output, character escape sequences,
|
||||
which are converted and copied to the standard output, and for-
|
||||
mat specifications, each of which causes printing of the next
|
||||
successive _a_r_g_u_m_e_n_t. In addition to the standard _p_r_i_n_t_f(1) for-
|
||||
mats, %%bb causes pprriinnttff to expand backslash escape sequences in
|
||||
the corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output,
|
||||
mats, %%bb causes pprriinnttff to expand backslash escape sequences in
|
||||
the corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output,
|
||||
backslashes in \\'', \\"", and \\?? are not removed, and octal escapes
|
||||
beginning with \\00 may contain up to four digits), and %%qq causes
|
||||
beginning with \\00 may contain up to four digits), and %%qq causes
|
||||
pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a format that can
|
||||
be reused as shell input.
|
||||
|
||||
Arguments to non-string format specifiers are treated as C con-
|
||||
stants, except that a leading plus or minus sign is allowed, and
|
||||
if the leading character is a single or double quote, the value
|
||||
is the ASCII value of the following character.
|
||||
|
||||
The --vv option causes the output to be assigned to the variable
|
||||
_v_a_r rather than being printed to the standard output.
|
||||
|
||||
@@ -1520,7 +1526,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
--uu The maximum number of processes available to a single
|
||||
user
|
||||
--vv The maximum amount of virtual memory available to the
|
||||
shell
|
||||
shell and, on some systems, to its children
|
||||
--xx The maximum number of file locks
|
||||
--TT The maximum number of threads
|
||||
|
||||
|
||||
+1127
-1116
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
%!PS-Adobe-3.0
|
||||
%%Creator: groff version 1.19.2
|
||||
%%CreationDate: Fri Jan 15 11:36:45 2010
|
||||
%%CreationDate: Thu May 20 16:33:07 2010
|
||||
%%DocumentNeededResources: font Times-Roman
|
||||
%%+ font Times-Bold
|
||||
%%DocumentSuppliedResources: procset grops 1.19 2
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
if [ -z "$PS1" ]; then
|
||||
return
|
||||
fi
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return ;;
|
||||
esac
|
||||
|
||||
# bogus
|
||||
if [ -f /unix ] ; then
|
||||
|
||||
@@ -455,6 +455,9 @@ extern int uconvert __P((char *, long *, long *));
|
||||
extern unsigned int falarm __P((unsigned int, unsigned int));
|
||||
extern unsigned int fsleep __P((unsigned int, unsigned int));
|
||||
|
||||
/* declarations for functions defined in lib/sh/unicode.c */
|
||||
extern int u32cconv __P((unsigned long, char *));
|
||||
|
||||
/* declarations for functions defined in lib/sh/winsize.c */
|
||||
extern void get_new_window_size __P((int, int *, int *));
|
||||
|
||||
|
||||
+2
-2
@@ -92,7 +92,7 @@ CSOURCES = clktck.c clock.c getcwd.c getenv.c oslib.c setlinebuf.c \
|
||||
mktime.c strftime.c mbschr.c zcatfd.c zmapfd.c winsize.c eaccess.c \
|
||||
wcsdup.c fpurge.c zgetline.c mbscmp.c uconvert.c ufuncs.c \
|
||||
casemod.c dprintf.c input_avail.c mbscasecmp.c fnxform.c \
|
||||
strchrnul.c
|
||||
strchrnul.c unicode.c
|
||||
|
||||
# The header files for this library.
|
||||
HSOURCES =
|
||||
@@ -106,7 +106,7 @@ OBJECTS = clktck.o clock.o getenv.o oslib.o setlinebuf.o strnlen.o \
|
||||
strtrans.o snprintf.o mailstat.o fmtulong.o \
|
||||
fmtullong.o fmtumax.o zcatfd.o zmapfd.o winsize.o wcsdup.o \
|
||||
fpurge.o zgetline.o mbscmp.o uconvert.o ufuncs.o casemod.o \
|
||||
input_avail.o mbscasecmp.o fnxform.o ${LIBOBJS}
|
||||
input_avail.o mbscasecmp.o fnxform.o unicode.o ${LIBOBJS}
|
||||
|
||||
SUPPORT = Makefile
|
||||
|
||||
|
||||
+32
-1
@@ -49,13 +49,20 @@ ansicstr (string, len, flags, sawc, rlen)
|
||||
char *string;
|
||||
int len, flags, *sawc, *rlen;
|
||||
{
|
||||
int c, temp;
|
||||
int c, temp, v;
|
||||
char *ret, *r, *s;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
char mbch[25]; /* 25 > MB_LEN_MAX, plus can handle 4-byte UTF-8 and large Unicode characters*/
|
||||
#endif
|
||||
|
||||
if (string == 0 || *string == '\0')
|
||||
return ((char *)NULL);
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
ret = (char *)xmalloc (4*len + 1);
|
||||
#else
|
||||
ret = (char *)xmalloc (2*len + 1); /* 2*len for possible CTLESC */
|
||||
#endif
|
||||
for (r = ret, s = string; s && *s; )
|
||||
{
|
||||
c = *s++;
|
||||
@@ -128,6 +135,30 @@ ansicstr (string, len, flags, sawc, rlen)
|
||||
}
|
||||
c &= 0xFF;
|
||||
break;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
case 'u':
|
||||
case 'U':
|
||||
temp = (c == 'u') ? 4 : 8; /* \uNNNN \UNNNNNNNN */
|
||||
for (v = 0; ISXDIGIT ((unsigned char)*s) && temp--; s++)
|
||||
v = (v * 16) + HEXVALUE (*s);
|
||||
if (temp == ((c == 'u') ? 4 : 8))
|
||||
{
|
||||
*r++ = '\\'; /* c remains unchanged */
|
||||
break;
|
||||
}
|
||||
else if (v <= UCHAR_MAX)
|
||||
{
|
||||
c = v;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
memset (mbch, '\0', sizeof (mbch));
|
||||
temp = u32cconv (v, r);
|
||||
r += temp;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
case '\\':
|
||||
break;
|
||||
case '\'': case '"': case '?':
|
||||
|
||||
@@ -0,0 +1,310 @@
|
||||
/* strtrans.c - Translate and untranslate strings with ANSI-C escape sequences. */
|
||||
|
||||
/* Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bash is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bash. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <bashansi.h>
|
||||
#include <stdio.h>
|
||||
#include <chartypes.h>
|
||||
|
||||
#include "shell.h"
|
||||
|
||||
#ifdef ESC
|
||||
#undef ESC
|
||||
#endif
|
||||
#define ESC '\033' /* ASCII */
|
||||
|
||||
/* Convert STRING by expanding the escape sequences specified by the
|
||||
ANSI C standard. If SAWC is non-null, recognize `\c' and use that
|
||||
as a string terminator. If we see \c, set *SAWC to 1 before
|
||||
returning. LEN is the length of STRING. If (FLAGS&1) is non-zero,
|
||||
that we're translating a string for `echo -e', and therefore should not
|
||||
treat a single quote as a character that may be escaped with a backslash.
|
||||
If (FLAGS&2) is non-zero, we're expanding for the parser and want to
|
||||
quote CTLESC and CTLNUL with CTLESC. If (flags&4) is non-zero, we want
|
||||
to remove the backslash before any unrecognized escape sequence. */
|
||||
char *
|
||||
ansicstr (string, len, flags, sawc, rlen)
|
||||
char *string;
|
||||
int len, flags, *sawc, *rlen;
|
||||
{
|
||||
int c, temp, v;
|
||||
char *ret, *r, *s;
|
||||
|
||||
if (string == 0 || *string == '\0')
|
||||
return ((char *)NULL);
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
ret = (char *)xmalloc (4*len + 1);
|
||||
#else
|
||||
ret = (char *)xmalloc (2*len + 1); /* 2*len for possible CTLESC */
|
||||
#endif
|
||||
for (r = ret, s = string; s && *s; )
|
||||
{
|
||||
c = *s++;
|
||||
if (c != '\\' || *s == '\0')
|
||||
*r++ = c;
|
||||
else
|
||||
{
|
||||
switch (c = *s++)
|
||||
{
|
||||
#if defined (__STDC__)
|
||||
case 'a': c = '\a'; break;
|
||||
case 'v': c = '\v'; break;
|
||||
#else
|
||||
case 'a': c = '\007'; break;
|
||||
case 'v': c = (int) 0x0B; break;
|
||||
#endif
|
||||
case 'b': c = '\b'; break;
|
||||
case 'e': case 'E': /* ESC -- non-ANSI */
|
||||
c = ESC; break;
|
||||
case 'f': c = '\f'; break;
|
||||
case 'n': c = '\n'; break;
|
||||
case 'r': c = '\r'; break;
|
||||
case 't': c = '\t'; break;
|
||||
case '1': case '2': case '3':
|
||||
case '4': case '5': case '6':
|
||||
case '7':
|
||||
#if 1
|
||||
if (flags & 1)
|
||||
{
|
||||
*r++ = '\\';
|
||||
break;
|
||||
}
|
||||
/*FALLTHROUGH*/
|
||||
#endif
|
||||
case '0':
|
||||
/* If (FLAGS & 1), we're translating a string for echo -e (or
|
||||
the equivalent xpg_echo option), so we obey the SUSv3/
|
||||
POSIX-2001 requirement and accept 0-3 octal digits after
|
||||
a leading `0'. */
|
||||
temp = 2 + ((flags & 1) && (c == '0'));
|
||||
for (c -= '0'; ISOCTAL (*s) && temp--; s++)
|
||||
c = (c * 8) + OCTVALUE (*s);
|
||||
c &= 0xFF;
|
||||
break;
|
||||
case 'x': /* Hex digit -- non-ANSI */
|
||||
if ((flags & 2) && *s == '{')
|
||||
{
|
||||
flags |= 16; /* internal flag value */
|
||||
s++;
|
||||
}
|
||||
/* Consume at least two hex characters */
|
||||
for (temp = 2, c = 0; ISXDIGIT ((unsigned char)*s) && temp--; s++)
|
||||
c = (c * 16) + HEXVALUE (*s);
|
||||
/* DGK says that after a `\x{' ksh93 consumes ISXDIGIT chars
|
||||
until a non-xdigit or `}', so potentially more than two
|
||||
chars are consumed. */
|
||||
if (flags & 16)
|
||||
{
|
||||
for ( ; ISXDIGIT ((unsigned char)*s); s++)
|
||||
c = (c * 16) + HEXVALUE (*s);
|
||||
flags &= ~16;
|
||||
if (*s == '}')
|
||||
s++;
|
||||
}
|
||||
/* \x followed by non-hex digits is passed through unchanged */
|
||||
else if (temp == 2)
|
||||
{
|
||||
*r++ = '\\';
|
||||
c = 'x';
|
||||
}
|
||||
c &= 0xFF;
|
||||
break;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
case 'u':
|
||||
case 'U':
|
||||
temp = (c == 'u') ? 4 : 8; /* \uNNNN \UNNNNNNNN */
|
||||
for (v = 0; ISXDIGIT ((unsigned char)*s) && temp--; s++)
|
||||
v = (v * 16) + HEXVALUE (*s);
|
||||
if (temp == ((c == 'u') ? 4 : 8))
|
||||
{
|
||||
*r++ = '\\'; /* c remains unchanged */
|
||||
break;
|
||||
}
|
||||
else if (v <= UCHAR_MAX)
|
||||
{
|
||||
c = v;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
memset (mbch, '\0', sizeof (mbch));
|
||||
temp = u32cconv (v, r);
|
||||
r += temp;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
case '\\':
|
||||
break;
|
||||
case '\'': case '"': case '?':
|
||||
if (flags & 1)
|
||||
*r++ = '\\';
|
||||
break;
|
||||
case 'c':
|
||||
if (sawc)
|
||||
{
|
||||
*sawc = 1;
|
||||
*r = '\0';
|
||||
if (rlen)
|
||||
*rlen = r - ret;
|
||||
return ret;
|
||||
}
|
||||
else if ((flags & 1) == 0 && (c = *s))
|
||||
{
|
||||
s++;
|
||||
c = TOCTRL(c);
|
||||
break;
|
||||
}
|
||||
/*FALLTHROUGH*/
|
||||
default:
|
||||
if ((flags & 4) == 0)
|
||||
*r++ = '\\';
|
||||
break;
|
||||
}
|
||||
if ((flags & 2) && (c == CTLESC || c == CTLNUL))
|
||||
*r++ = CTLESC;
|
||||
*r++ = c;
|
||||
}
|
||||
}
|
||||
*r = '\0';
|
||||
if (rlen)
|
||||
*rlen = r - ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Take a string STR, possibly containing non-printing characters, and turn it
|
||||
into a $'...' ANSI-C style quoted string. Returns a new string. */
|
||||
char *
|
||||
ansic_quote (str, flags, rlen)
|
||||
char *str;
|
||||
int flags, *rlen;
|
||||
{
|
||||
char *r, *ret, *s;
|
||||
int l, rsize;
|
||||
unsigned char c;
|
||||
|
||||
if (str == 0 || *str == 0)
|
||||
return ((char *)0);
|
||||
|
||||
l = strlen (str);
|
||||
rsize = 4 * l + 4;
|
||||
r = ret = (char *)xmalloc (rsize);
|
||||
|
||||
*r++ = '$';
|
||||
*r++ = '\'';
|
||||
|
||||
for (s = str, l = 0; *s; s++)
|
||||
{
|
||||
c = *s;
|
||||
l = 1; /* 1 == add backslash; 0 == no backslash */
|
||||
switch (c)
|
||||
{
|
||||
case ESC: c = 'E'; break;
|
||||
#ifdef __STDC__
|
||||
case '\a': c = 'a'; break;
|
||||
case '\v': c = 'v'; break;
|
||||
#else
|
||||
case '\007': c = 'a'; break;
|
||||
case 0x0b: c = 'v'; break;
|
||||
#endif
|
||||
|
||||
case '\b': c = 'b'; break;
|
||||
case '\f': c = 'f'; break;
|
||||
case '\n': c = 'n'; break;
|
||||
case '\r': c = 'r'; break;
|
||||
case '\t': c = 't'; break;
|
||||
case '\\':
|
||||
case '\'':
|
||||
break;
|
||||
default:
|
||||
if (ISPRINT (c) == 0)
|
||||
{
|
||||
*r++ = '\\';
|
||||
*r++ = TOCHAR ((c >> 6) & 07);
|
||||
*r++ = TOCHAR ((c >> 3) & 07);
|
||||
*r++ = TOCHAR (c & 07);
|
||||
continue;
|
||||
}
|
||||
l = 0;
|
||||
break;
|
||||
}
|
||||
if (l)
|
||||
*r++ = '\\';
|
||||
*r++ = c;
|
||||
}
|
||||
|
||||
*r++ = '\'';
|
||||
*r = '\0';
|
||||
if (rlen)
|
||||
*rlen = r - ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* return 1 if we need to quote with $'...' because of non-printing chars. */
|
||||
int
|
||||
ansic_shouldquote (string)
|
||||
const char *string;
|
||||
{
|
||||
const char *s;
|
||||
unsigned char c;
|
||||
|
||||
if (string == 0)
|
||||
return 0;
|
||||
|
||||
for (s = string; c = *s; s++)
|
||||
if (ISPRINT (c) == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* $'...' ANSI-C expand the portion of STRING between START and END and
|
||||
return the result. The result cannot be longer than the input string. */
|
||||
char *
|
||||
ansiexpand (string, start, end, lenp)
|
||||
char *string;
|
||||
int start, end, *lenp;
|
||||
{
|
||||
char *temp, *t;
|
||||
int len, tlen;
|
||||
|
||||
temp = (char *)xmalloc (end - start + 1);
|
||||
for (tlen = 0, len = start; len < end; )
|
||||
temp[tlen++] = string[len++];
|
||||
temp[tlen] = '\0';
|
||||
|
||||
if (*temp)
|
||||
{
|
||||
t = ansicstr (temp, tlen, 2, (int *)NULL, lenp);
|
||||
free (temp);
|
||||
return (t);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lenp)
|
||||
*lenp = 0;
|
||||
return (temp);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
/* unicode.c - functions to convert unicode characters */
|
||||
|
||||
/* Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bash is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bash. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
|
||||
#include <stdc.h>
|
||||
#include <wchar.h>
|
||||
#include <bashansi.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
#if HAVE_ICONV
|
||||
# include <iconv.h>
|
||||
#endif
|
||||
|
||||
#include <xmalloc.h>
|
||||
|
||||
#ifndef USHORT_MAX
|
||||
# ifdef USHRT_MAX
|
||||
# define USHORT_MAX USHRT_MAX
|
||||
# else
|
||||
# define USHORT_MAX ((unsigned short) ~(unsigned short)0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined (STREQ)
|
||||
# define STREQ(a, b) ((a)[0] == (b)[0] && strcmp ((a), (b)) == 0)
|
||||
#endif /* !STREQ */
|
||||
|
||||
#if defined (HAVE_LOCALE_CHARSET)
|
||||
extern const char *locale_charset __P((void));
|
||||
#else
|
||||
extern char *get_locale_var __P((char *));
|
||||
#endif
|
||||
|
||||
static int u32init = 0;
|
||||
static int utf8locale = 0;
|
||||
static iconv_t localconv;
|
||||
|
||||
/* u32toascii ? */
|
||||
int
|
||||
u32tochar (wc, s)
|
||||
wchar_t wc;
|
||||
char *s;
|
||||
{
|
||||
unsigned long x;
|
||||
int l;
|
||||
|
||||
x = wc;
|
||||
l = (x <= UCHAR_MAX) ? 1 : ((x <= USHORT_MAX) ? 2 : 4);
|
||||
|
||||
if (x <= UCHAR_MAX)
|
||||
s[0] = x & 0xFF;
|
||||
else if (x <= USHORT_MAX) /* assume unsigned short = 16 bits */
|
||||
{
|
||||
s[0] = (x >> 8) & 0xFF;
|
||||
s[1] = x & 0xFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
s[0] = (x >> 24) & 0xFF;
|
||||
s[1] = (x >> 16) & 0xFF;
|
||||
s[2] = (x >> 8) & 0xFF;
|
||||
s[3] = x & 0xFF;
|
||||
}
|
||||
s[l] = '\0';
|
||||
return l;
|
||||
}
|
||||
|
||||
int
|
||||
u32toutf8 (wc, s)
|
||||
wchar_t wc;
|
||||
char *s;
|
||||
{
|
||||
int l;
|
||||
|
||||
l = (wc < 0x0080) ? 1 : ((wc < 0x0800) ? 2 : 3);
|
||||
|
||||
if (wc < 0x0080)
|
||||
s[0] = (unsigned char)wc;
|
||||
else if (wc < 0x0800)
|
||||
{
|
||||
s[0] = (wc >> 6) | 0xc0;
|
||||
s[1] = (wc & 0x3f) | 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
s[0] = (wc >> 12) | 0xe0;
|
||||
s[1] = ((wc >> 6) & 0x3f) | 0x80;
|
||||
s[2] = (wc & 0x3f) | 0x80;
|
||||
}
|
||||
s[l] = '\0';
|
||||
return l;
|
||||
}
|
||||
|
||||
/* convert a single unicode-32 character into a multibyte string and put the
|
||||
result in S, which must be large enough (at least MB_LEN_MAX bytes) */
|
||||
int
|
||||
u32cconv (c, s)
|
||||
unsigned long c;
|
||||
char *s;
|
||||
{
|
||||
wchar_t wc;
|
||||
int n;
|
||||
#if HAVE_ICONV
|
||||
const char *charset;
|
||||
char obuf[25], *optr;
|
||||
size_t obytesleft;
|
||||
char *iptr;
|
||||
size_t sn;
|
||||
#endif
|
||||
|
||||
wc = c;
|
||||
|
||||
#if __STDC_ISO_10646__
|
||||
if (sizeof (wchar_t) == 4)
|
||||
{
|
||||
n = wctomb (wc, s);
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAVE_NL_LANGINFO
|
||||
codeset = nl_langinfo (CODESET);
|
||||
if (STREQ (codeset, "UTF-8"))
|
||||
{
|
||||
n = u32toutf8 (wc, s);
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAVE_ICONV
|
||||
/* this is mostly from coreutils-8.5/lib/unicodeio.c */
|
||||
if (u32init == 0)
|
||||
{
|
||||
charset = locale_charset (); /* XXX - fix later */
|
||||
if (STREQ (charset, "UTF-8"))
|
||||
utf8locale = 1;
|
||||
else
|
||||
{
|
||||
localconv = iconv_open (charset, "UTF-8");
|
||||
if (localconv == (iconv_t)-1)
|
||||
localconv = iconv_open (charset, "ASCII");
|
||||
}
|
||||
u32init = 1;
|
||||
}
|
||||
|
||||
if (utf8locale)
|
||||
{
|
||||
n = u32toutf8 (wc, s);
|
||||
return n;
|
||||
}
|
||||
|
||||
if (localconv == (iconv_t)-1)
|
||||
{
|
||||
n = u32tochar (wc, s);
|
||||
return n;
|
||||
}
|
||||
|
||||
n = u32toutf8 (wc, s);
|
||||
|
||||
optr = obuf;
|
||||
obytesleft = sizeof (obuf);
|
||||
iptr = s;
|
||||
sn = n;
|
||||
|
||||
iconv (localconv, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (iconv (localconv, &iptr, &sn, &optr, &obytesleft) == (size_t)-1)
|
||||
return n; /* You get utf-8 if iconv fails */
|
||||
|
||||
*optr = '\0';
|
||||
|
||||
/* number of chars to be copied is optr - obuf if we want to do bounds
|
||||
checking */
|
||||
strcpy (s, obuf);
|
||||
return (optr - obuf);
|
||||
#endif
|
||||
|
||||
n = u32tochar (wc, s); /* fallback */
|
||||
return n;
|
||||
}
|
||||
|
||||
#endif /* HANDLE_MULTIBYTE */
|
||||
@@ -0,0 +1,201 @@
|
||||
/* unicode.c - functions to convert unicode characters */
|
||||
|
||||
/* Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bash is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bash. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
|
||||
#include <stdc.h>
|
||||
#include <wchar.h>
|
||||
#include <bashansi.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
#if HAVE_ICONV
|
||||
# include <iconv.h>
|
||||
#endif
|
||||
|
||||
#include <xmalloc.h>
|
||||
|
||||
#ifndef USHORT_MAX
|
||||
# ifdef USHRT_MAX
|
||||
# define USHORT_MAX USHRT_MAX
|
||||
# else
|
||||
# define USHORT_MAX ((unsigned short) ~(unsigned short)0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_LOCALE_CHARSET)
|
||||
extern const char *locale_charset __P((void));
|
||||
#else
|
||||
extern char *get_locale_var __P((char *));
|
||||
#endif
|
||||
|
||||
static int u32init = 0;
|
||||
static int utf8locale = 0;
|
||||
static iconv_t localconv;
|
||||
|
||||
/* u32toascii ? */
|
||||
int
|
||||
u32tochar (wc, s)
|
||||
wchar_t wc;
|
||||
char *s;
|
||||
{
|
||||
unsigned long x;
|
||||
int l;
|
||||
|
||||
x = wc;
|
||||
l = (x <= UCHAR_MAX) ? 1 : ((x <= USHORT_MAX) ? 2 : 4);
|
||||
|
||||
if (x <= UCHAR_MAX)
|
||||
s[0] = x & 0xFF;
|
||||
else if (x <= USHORT_MAX) /* assume unsigned short = 16 bits */
|
||||
{
|
||||
s[0] = (x >> 8) & 0xFF;
|
||||
s[1] = x & 0xFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
s[0] = (x >> 24) & 0xFF;
|
||||
s[1] = (x >> 16) & 0xFF;
|
||||
s[2] = (x >> 8) & 0xFF;
|
||||
s[3] = x & 0xFF;
|
||||
}
|
||||
s[l] = '\0';
|
||||
return l;
|
||||
}
|
||||
|
||||
int
|
||||
u32toutf8 (wc, s)
|
||||
wchar_t wc;
|
||||
char *s;
|
||||
{
|
||||
int l;
|
||||
|
||||
l = (wc < 0x0080) ? 1 : ((wc < 0x0800) ? 2 : 3);
|
||||
|
||||
if (wc < 0x0080)
|
||||
s[0] = (unsigned char)wc;
|
||||
else if (wc < 0x0800)
|
||||
{
|
||||
s[0] = (wc >> 6) | 0xc0;
|
||||
s[1] = (wc & 0x3f) | 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
s[0] = (wc >> 12) | 0xe0;
|
||||
s[1] = ((wc >> 6) & 0x3f) | 0x80;
|
||||
s[2] = (wc & 0x3f) | 0x80;
|
||||
}
|
||||
s[l] = '\0';
|
||||
return l;
|
||||
}
|
||||
|
||||
/* convert a single unicode-32 character into a multibyte string and put the
|
||||
result in S, which must be large enough (at least MB_LEN_MAX bytes) */
|
||||
int
|
||||
u32cconv (c, s)
|
||||
unsigned long c;
|
||||
char *s;
|
||||
{
|
||||
wchar_t wc;
|
||||
int n;
|
||||
#if HAVE_ICONV
|
||||
const char *charset;
|
||||
char obuf[25], *optr;
|
||||
size_t obytesleft;
|
||||
char *iptr;
|
||||
size_t sn;
|
||||
#endif
|
||||
|
||||
wc = c;
|
||||
|
||||
#if __STDC_ISO_10646__
|
||||
if (sizeof (wchar_t) == 4)
|
||||
{
|
||||
n = wctomb (wc, s);
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAVE_NL_LANGINFO
|
||||
codeset = nl_langinfo (CODESET);
|
||||
if (STREQ (codeset, "UTF-8"))
|
||||
{
|
||||
n = u32toutf8 (wc, s);
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAVE_ICONV
|
||||
/* this is mostly from coreutils-8.5/lib/unicodeio.c */
|
||||
if (u32init == 0)
|
||||
{
|
||||
charset = locale_charset (); /* XXX - fix later */
|
||||
if (STREQ (charset, "UTF-8"))
|
||||
utf8locale = 1;
|
||||
else
|
||||
{
|
||||
localconv = iconv_open (charset, "UTF-8");
|
||||
if (localconv == (iconv_t)-1)
|
||||
localconv = iconv_open (charset, "ASCII");
|
||||
}
|
||||
u32init = 1;
|
||||
}
|
||||
|
||||
if (utf8locale)
|
||||
{
|
||||
n = u32toutf8 (wc, s);
|
||||
return n;
|
||||
}
|
||||
|
||||
if (localconv == (iconv_t)-1)
|
||||
{
|
||||
n = u32tochar (wc, s);
|
||||
return n;
|
||||
}
|
||||
|
||||
n = u32toutf8 (wc, s);
|
||||
|
||||
optr = obuf;
|
||||
obytesleft = sizeof (obuf);
|
||||
iptr = s;
|
||||
sn = n;
|
||||
|
||||
iconv (localconv, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (iconv (localconv, &iptr, &sn, &optr, &obytesleft) == (size_t)-1)
|
||||
return n; /* You get utf-8 if iconv fails */
|
||||
|
||||
*optr = '\0';
|
||||
|
||||
/* number of chars to be copied is optr - obuf if we want to do bounds
|
||||
checking */
|
||||
strcpy (s, obuf);
|
||||
return (optr - obuf);
|
||||
#endif
|
||||
|
||||
n = u32tochar (wc, s); /* fallback */
|
||||
return n;
|
||||
}
|
||||
|
||||
#endif /* HANDLE_MULTIBYTE */
|
||||
+1
-1
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
#define PATCHLEVEL 2
|
||||
#define PATCHLEVEL 7
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
|
||||
Reference in New Issue
Block a user