Bash-4.1 distribution source
This commit is contained in:
parent
89a92869e5
commit
0001803f0b
252 changed files with 51563 additions and 37176 deletions
|
|
@ -1,12 +1,12 @@
|
|||
@c The GNU Free Documentation License.
|
||||
@center Version 1.2, November 2002
|
||||
@center Version 1.3, 3 November 2008
|
||||
|
||||
@c This file is intended to be included within another document,
|
||||
@c hence no sectioning command or @node.
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
|
||||
@uref{http://fsf.org/}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
|
@ -111,6 +111,9 @@ formats which do not have any title page as such, ``Title Page'' means
|
|||
the text near the most prominent appearance of the work's title,
|
||||
preceding the beginning of the body of the text.
|
||||
|
||||
The ``publisher'' means any person or entity that distributes copies
|
||||
of the Document to the public.
|
||||
|
||||
A section ``Entitled XYZ'' means a named subunit of the Document whose
|
||||
title either is precisely XYZ or contains XYZ in parentheses following
|
||||
text that translates XYZ in another language. (Here XYZ stands for a
|
||||
|
|
@ -379,13 +382,30 @@ title.
|
|||
@item
|
||||
TERMINATION
|
||||
|
||||
You may not copy, modify, sublicense, or distribute the Document except
|
||||
as expressly provided for under this License. Any other attempt to
|
||||
copy, modify, sublicense or distribute the Document is void, and will
|
||||
automatically terminate your rights under this License. However,
|
||||
parties who have received copies, or rights, from you under this
|
||||
License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
You may not copy, modify, sublicense, or distribute the Document
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense, or distribute it is void, and
|
||||
will automatically terminate your rights under this License.
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, receipt of a copy of some or all of the same material does
|
||||
not give you any rights to use it.
|
||||
|
||||
@item
|
||||
FUTURE REVISIONS OF THIS LICENSE
|
||||
|
|
@ -403,7 +423,42 @@ following the terms and conditions either of that specified version or
|
|||
of any later version that has been published (not as a draft) by the
|
||||
Free Software Foundation. If the Document does not specify a version
|
||||
number of this License, you may choose any version ever published (not
|
||||
as a draft) by the Free Software Foundation.
|
||||
as a draft) by the Free Software Foundation. If the Document
|
||||
specifies that a proxy can decide which future versions of this
|
||||
License can be used, that proxy's public statement of acceptance of a
|
||||
version permanently authorizes you to choose that version for the
|
||||
Document.
|
||||
|
||||
@item
|
||||
RELICENSING
|
||||
|
||||
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
|
||||
World Wide Web server that publishes copyrightable works and also
|
||||
provides prominent facilities for anybody to edit those works. A
|
||||
public wiki that anybody can edit is an example of such a server. A
|
||||
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
|
||||
site means any set of copyrightable works thus published on the MMC
|
||||
site.
|
||||
|
||||
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
|
||||
license published by Creative Commons Corporation, a not-for-profit
|
||||
corporation with a principal place of business in San Francisco,
|
||||
California, as well as future copyleft versions of that license
|
||||
published by that same organization.
|
||||
|
||||
``Incorporate'' means to publish or republish a Document, in whole or
|
||||
in part, as part of another Document.
|
||||
|
||||
An MMC is ``eligible for relicensing'' if it is licensed under this
|
||||
License, and if all works that were first published under this License
|
||||
somewhere other than this MMC, and subsequently incorporated in whole
|
||||
or in part into the MMC, (1) had no cover texts or invariant sections,
|
||||
and (2) were thus incorporated prior to November 1, 2008.
|
||||
|
||||
The operator of an MMC Site may republish an MMC contained in the site
|
||||
under CC-BY-SA on the same site at any time before August 1, 2009,
|
||||
provided the MMC is eligible for relicensing.
|
||||
|
||||
@end enumerate
|
||||
|
||||
@page
|
||||
|
|
@ -417,7 +472,7 @@ license notices just after the title page:
|
|||
@group
|
||||
Copyright (C) @var{year} @var{your name}.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2
|
||||
under the terms of the GNU Free Documentation License, Version 1.3
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||
Texts. A copy of the license is included in the section entitled ``GNU
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ are preserved on all copies.
|
|||
|
||||
@quotation
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
|
||||
and with the Back-Cover Texts as in (a) below. A copy of the license is
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ are preserved on all copies.
|
|||
|
||||
@quotation
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
|
||||
and with the Back-Cover Texts as in (a) below. A copy of the license is
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@ Readline which keymap to use.
|
|||
@deftypefun Keymap rl_make_bare_keymap (void)
|
||||
Returns a new, empty keymap. The space for the keymap is allocated with
|
||||
@code{malloc()}; the caller should free it by calling
|
||||
@code{rl_discard_keymap()} when done.
|
||||
@code{rl_free_keymap()} when done.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun Keymap rl_copy_keymap (Keymap map)
|
||||
|
|
@ -636,7 +636,13 @@ the Meta digits bound to produce numeric arguments.
|
|||
@end deftypefun
|
||||
|
||||
@deftypefun void rl_discard_keymap (Keymap keymap)
|
||||
Free the storage associated with @var{keymap}.
|
||||
Free the storage associated with the data in @var{keymap}.
|
||||
The caller should free @var{keymap}.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void rl_free_keymap (Keymap keymap)
|
||||
Free all storage associated with @var{keymap}. This calls
|
||||
@code{rl_discard_keymap} to free subordindate keymaps and macros.
|
||||
@end deftypefun
|
||||
|
||||
Readline has several internal keymaps. These functions allow you to
|
||||
|
|
@ -1722,6 +1728,35 @@ remove any quote characters from the directory name, because its result will
|
|||
be passed directly to @code{opendir()}.
|
||||
@end deftypevar
|
||||
|
||||
@ignore
|
||||
@deftypevar extern rl_icppfunc_t *rl_directory_rewrite_hook;
|
||||
If non-zero, this is the address of a function to call when completing
|
||||
a directory name. This function takes the address of the directory name
|
||||
to be modified as an argument. Unlike @code{rl_directory_completion_hook},
|
||||
it only modifies the directory name used in @code{opendir}, not what is
|
||||
displayed when the possible completions are printed or inserted. It is
|
||||
called before rl_directory_completion_hook.
|
||||
|
||||
I'm not happy with how this worksyet, so it's undocumented.
|
||||
@end deftypevar
|
||||
@end ignore
|
||||
|
||||
@deftypevar {rl_dequote_func_t *} rl_filename_rewrite_hook
|
||||
If non-zero, this is the address of a function called when reading
|
||||
directory entries from the filesystem for completion and comparing
|
||||
them to the partial word to be completed. The function should
|
||||
perform any necesary application or system-specific conversion on
|
||||
the filename, such as converting between character sets or converting
|
||||
from a filesystem format to a character input format.
|
||||
The function takes two arguments: @var{fname}, the filename to be converted,
|
||||
and @var{fnlen}, its length in bytes.
|
||||
It must either return its first argument (if no conversion takes place)
|
||||
or the converted filename in newly-allocated memory. The converted
|
||||
form is used to compare against the word to be completed, and, if it
|
||||
matches, is added to the list of matches. Readline will free the
|
||||
allocated string.
|
||||
@end deftypevar
|
||||
|
||||
@deftypevar {rl_compdisp_func_t *} rl_completion_display_matches_hook
|
||||
If non-zero, then this is the address of a function to call when
|
||||
completing a word would normally display the list of possible matches.
|
||||
|
|
|
|||
|
|
@ -474,12 +474,23 @@ key bindings is used. By default, Readline starts up in Emacs editing
|
|||
mode, where the keystrokes are most similar to Emacs. This variable can be
|
||||
set to either @samp{emacs} or @samp{vi}.
|
||||
|
||||
@item echo-control-characters
|
||||
When set to @samp{on}, on operating systems that indicate they support it,
|
||||
readline echoes a character corresponding to a signal generated from the
|
||||
keyboard. The default is @samp{on}.
|
||||
|
||||
@item enable-keypad
|
||||
@vindex enable-keypad
|
||||
When set to @samp{on}, Readline will try to enable the application
|
||||
keypad when it is called. Some systems need this to enable the
|
||||
arrow keys. The default is @samp{off}.
|
||||
|
||||
@item enable-meta-key
|
||||
When set to @samp{on}, Readline will try to enable any meta modifier
|
||||
key the terminal claims to support when it is called. On many terminals,
|
||||
the meta key is used to send eight-bit characters.
|
||||
The default is @samp{on}.
|
||||
|
||||
@item expand-tilde
|
||||
@vindex expand-tilde
|
||||
If set to @samp{on}, tilde expansion is performed when Readline
|
||||
|
|
@ -606,6 +617,20 @@ a common prefix) cause the matches to be listed immediately instead
|
|||
of ringing the bell.
|
||||
The default value is @samp{off}.
|
||||
|
||||
@item skip-completed-text
|
||||
@vindex skip-completed-text
|
||||
If set to @samp{on}, this alters the default completion behavior when
|
||||
inserting a single match into the line. It's only active when
|
||||
performing completion in the middle of a word. If enabled, readline
|
||||
does not insert characters from the completion that match characters
|
||||
after point in the word being completed, so portions of the word
|
||||
following the cursor are not duplicated.
|
||||
For instance, if this is enabled, attempting completion when the cursor
|
||||
is after the @samp{e} in @samp{Makefile} will result in @samp{Makefile}
|
||||
rather than @samp{Makefilefile}, assuming there is a single possible
|
||||
completion.
|
||||
The default value is @samp{off}.
|
||||
|
||||
@item visible-stats
|
||||
@vindex visible-stats
|
||||
If set to @samp{on}, a character denoting a file's type
|
||||
|
|
@ -1292,6 +1317,11 @@ through the list.
|
|||
This command is intended to be bound to @key{TAB}, but is unbound
|
||||
by default.
|
||||
|
||||
@item menu-complete-backward ()
|
||||
Identical to @code{menu-complete}, but moves backward through the list
|
||||
of possible completions, as if @code{menu-complete} had been given a
|
||||
negative argument.
|
||||
|
||||
@item delete-char-or-list ()
|
||||
Deletes the character under the cursor if not at the beginning or
|
||||
end of the line (like @code{delete-char}).
|
||||
|
|
@ -1431,6 +1461,15 @@ A character is read and point is moved to the previous occurrence
|
|||
of that character. A negative count searches for subsequent
|
||||
occurrences.
|
||||
|
||||
@item skip-csi-sequence ()
|
||||
Read enough characters to consume a multi-key sequence such as those
|
||||
defined for keys like Home and End. Such sequences begin with a
|
||||
Control Sequence Indicator (CSI), usually ESC-[. If this sequence is
|
||||
bound to "\e[", keys producing such sequences will have no effect
|
||||
unless explicitly bound to a readline command, instead of inserting
|
||||
stray characters into the editing buffer. This is unbound by default,
|
||||
but usually bound to ESC-[.
|
||||
|
||||
@item insert-comment (M-#)
|
||||
Without a numeric argument, the value of the @code{comment-begin}
|
||||
variable is inserted at the beginning of the current line.
|
||||
|
|
@ -1574,10 +1613,15 @@ the programmable completion facilities are invoked.
|
|||
First, the command name is identified.
|
||||
If a compspec has been defined for that command, the
|
||||
compspec is used to generate the list of possible completions for the word.
|
||||
If the command word is the empty string (completion attempted at the
|
||||
beginning of an empty line), any compspec defined with
|
||||
the @option{-E} option to @code{complete} is used.
|
||||
If the command word is a full pathname, a compspec for the full
|
||||
pathname is searched for first.
|
||||
If no compspec is found for the full pathname, an attempt is made to
|
||||
find a compspec for the portion following the final slash.
|
||||
If those searches do not result in a compspec, any compspec defined with
|
||||
the @option{-D} option to @code{complete} is used as the default.
|
||||
|
||||
Once a compspec has been found, it is used to generate the list of
|
||||
matching words.
|
||||
|
|
@ -1681,6 +1725,30 @@ to completed names which are symbolic links to directories, subject to
|
|||
the value of the @var{mark-directories} Readline variable, regardless
|
||||
of the setting of the @var{mark-symlinked-directories} Readline variable.
|
||||
|
||||
There is some support for dynamically modifying completions. This is
|
||||
most useful when used in combination with a default completion specified
|
||||
with @option{-D}. It's possible for shell functions executed as completion
|
||||
handlers to indicate that completion should be retried by returning an
|
||||
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
|
||||
completions to be built dynamically as completion is attempted, rather than
|
||||
being loaded all at once.
|
||||
|
||||
For instance, assuming that there is a library of compspecs, each kept in a
|
||||
file corresponding to the name of the command, the following default
|
||||
completion function would load completions dynamically:
|
||||
|
||||
@example
|
||||
_completion_loader()
|
||||
@{
|
||||
. "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
|
||||
@}
|
||||
complete -D -F _completion_loader
|
||||
@end example
|
||||
|
||||
@node Programmable Completion Builtins
|
||||
@section Programmable Completion Builtins
|
||||
@cindex completion builtins
|
||||
|
|
@ -1716,10 +1784,10 @@ matches were generated.
|
|||
@item complete
|
||||
@btindex complete
|
||||
@example
|
||||
@code{complete [-abcdefgjksuv] [-o @var{comp-option}] [-E] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}]
|
||||
@code{complete [-abcdefgjksuv] [-o @var{comp-option}] [-DE] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}]
|
||||
[-F @var{function}] [-C @var{command}] [-X @var{filterpat}]
|
||||
[-P @var{prefix}] [-S @var{suffix}] @var{name} [@var{name} @dots{}]}
|
||||
@code{complete -pr [-E] [@var{name} @dots{}]}
|
||||
@code{complete -pr [-DE] [@var{name} @dots{}]}
|
||||
@end example
|
||||
|
||||
Specify how arguments to each @var{name} should be completed.
|
||||
|
|
@ -1729,12 +1797,16 @@ reused as input.
|
|||
The @option{-r} option removes a completion specification for
|
||||
each @var{name}, or, if no @var{name}s are supplied, all
|
||||
completion specifications.
|
||||
The @option{-D} option indicates that the remaining options and actions should
|
||||
apply to the ``default'' command completion; that is, completion attempted
|
||||
on a command for which no completion has previously been defined.
|
||||
The @option{-E} option indicates that the remaining options and actions should
|
||||
apply to ``empty'' command completion; that is, completion attempted on a
|
||||
blank line.
|
||||
|
||||
The process of applying these completion specifications when word completion
|
||||
is attempted is described above (@pxref{Programmable Completion}).
|
||||
is attempted is described above (@pxref{Programmable Completion}). The
|
||||
@option{-D} option takes precedence over @option{-E}.
|
||||
|
||||
Other options, if specified, have the following meanings.
|
||||
The arguments to the @option{-G}, @option{-W}, and @option{-X} options
|
||||
|
|
@ -1908,7 +1980,7 @@ an error occurs adding a completion specification.
|
|||
@item compopt
|
||||
@btindex compopt
|
||||
@example
|
||||
@code{compopt} [-o @var{option}] [+o @var{option}] [@var{name}]
|
||||
@code{compopt} [-o @var{option}] [-DE] [+o @var{option}] [@var{name}]
|
||||
@end example
|
||||
Modify completion options for each @var{name} according to the
|
||||
@var{option}s, or for the currently-execution completion if no @var{name}s
|
||||
|
|
@ -1917,6 +1989,14 @@ If no @var{option}s are given, display the completion options for each
|
|||
@var{name} or the current completion.
|
||||
The possible values of @var{option} are those valid for the @code{complete}
|
||||
builtin described above.
|
||||
The @option{-D} option indicates that the remaining options should
|
||||
apply to the ``default'' command completion; that is, completion attempted
|
||||
on a command for which no completion has previously been defined.
|
||||
The @option{-E} option indicates that the remaining options should
|
||||
apply to ``empty'' command completion; that is, completion attempted on a
|
||||
blank line.
|
||||
|
||||
The @option{-D} option takes precedence over @option{-E}.
|
||||
|
||||
The return value is true unless an invalid option is supplied, an attempt
|
||||
is made to modify the options for a @var{name} for which no completion
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ are preserved on all copies.
|
|||
|
||||
@quotation
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
|
||||
and with the Back-Cover Texts as in (a) below. A copy of the license is
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
Copyright (C) 1988-2009 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set EDITION 6.0
|
||||
@set VERSION 6.0
|
||||
@set UPDATED 28 October 2008
|
||||
@set UPDATED-MONTH October 2008
|
||||
@set EDITION 6.1
|
||||
@set VERSION 6.1
|
||||
@set UPDATED 9 October 2009
|
||||
@set UPDATED-MONTH October 2009
|
||||
|
||||
@set LASTCHANGE Tue Oct 28 11:25:24 EDT 2008
|
||||
@set LASTCHANGE Fri Oct 9 12:57:58 EDT 2009
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue