mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-09 11:40:30 +02:00
new readline "fetch-history" bindable command; declare -p output change
This commit is contained in:
+248
-157
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.7 from
|
||||
bashref.texi.
|
||||
|
||||
This text is a brief description of the features that are present in the
|
||||
Bash shell (version 5.1, 4 March2021).
|
||||
Bash shell (version 5.1, 31 March 2021).
|
||||
|
||||
This is Edition 5.1, last updated 4 March2021, of 'The GNU Bash
|
||||
This is Edition 5.1, last updated 31 March 2021, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.1.
|
||||
|
||||
Copyright (C) 1988-2021 Free Software Foundation, Inc.
|
||||
@@ -27,10 +27,10 @@ Bash Features
|
||||
*************
|
||||
|
||||
This text is a brief description of the features that are present in the
|
||||
Bash shell (version 5.1, 4 March2021). The Bash home page is
|
||||
Bash shell (version 5.1, 31 March 2021). The Bash home page is
|
||||
<http://www.gnu.org/software/bash/>.
|
||||
|
||||
This is Edition 5.1, last updated 4 March2021, of 'The GNU Bash
|
||||
This is Edition 5.1, last updated 31 March 2021, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.1.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -419,9 +419,10 @@ File: bashref.info, Node: ANSI-C Quoting, Next: Locale Translation, Prev: Dou
|
||||
3.1.2.4 ANSI-C Quoting
|
||||
......................
|
||||
|
||||
Words of the form $'STRING' are treated specially. The word expands to
|
||||
STRING, with backslash-escaped characters replaced as specified by the
|
||||
ANSI C standard. Backslash escape sequences, if present, are decoded as
|
||||
Character sequences of the form $'STRING' are treated as a special kind
|
||||
of single quotes. The sequence expands to STRING, with
|
||||
backslash-escaped characters in STRING replaced as specified by the ANSI
|
||||
C standard. Backslash escape sequences, if present, are decoded as
|
||||
follows:
|
||||
|
||||
'\a'
|
||||
@@ -473,22 +474,104 @@ File: bashref.info, Node: Locale Translation, Prev: ANSI-C Quoting, Up: Quoti
|
||||
3.1.2.5 Locale-Specific Translation
|
||||
...................................
|
||||
|
||||
A double-quoted string preceded by a dollar sign ('$') will cause the
|
||||
string to be translated according to the current locale. The 'gettext'
|
||||
infrastructure performs the message catalog lookup and translation,
|
||||
using the 'LC_MESSAGES' and 'TEXTDOMAIN' shell variables, as explained
|
||||
below. See the gettext documentation for additional details. If the
|
||||
current locale is 'C' or 'POSIX', or if there are no translations
|
||||
available, the dollar sign is ignored. If the string is translated and
|
||||
replaced, the replacement is double-quoted.
|
||||
Prefixing a double-quoted string with a dollar sign ('$'), such as
|
||||
$"hello, world", will cause the string to be translated according to the
|
||||
current locale. The 'gettext' infrastructure performs the lookup and
|
||||
translation, using the 'LC_MESSAGES', 'TEXTDOMAINDIR', and 'TEXTDOMAIN'
|
||||
shell variables, as explained below. See the gettext documentation for
|
||||
additional details not covered here. If the current locale is 'C' or
|
||||
'POSIX', or if there are no translations available, the dollar sign is
|
||||
ignored, and the shell doesn't attempt to translate the string. If the
|
||||
string is translated and replaced, the replacement is double-quoted.
|
||||
|
||||
Some systems use the message catalog selected by the 'LC_MESSAGES'
|
||||
shell variable. Others create the name of the message catalog from the
|
||||
value of the 'TEXTDOMAIN' shell variable, possibly adding a suffix of
|
||||
'.mo'. If you use the 'TEXTDOMAIN' variable, you may need to set the
|
||||
'TEXTDOMAINDIR' variable to the location of the message catalog files.
|
||||
Still others use both variables in this fashion:
|
||||
'TEXTDOMAINDIR'/'LC_MESSAGES'/LC_MESSAGES/'TEXTDOMAIN'.mo.
|
||||
The rest of this section is a brief overview of how you use gettext
|
||||
to create translations for strings in a shell script named SCRIPTNAME.
|
||||
There are more details in the gettext documentation.
|
||||
|
||||
Once you've marked the strings in your script that you want to
|
||||
translate using $"...", you create a gettext "template" file using the
|
||||
command
|
||||
|
||||
bash --dump-po-strings SCRIPTNAME > DOMAIN.pot
|
||||
|
||||
The DOMAIN is your "message domain". It's just an arbitrary string
|
||||
that's used to identify the files gettext needs, like a package or
|
||||
script name. It needs to be unique among all the message domains on
|
||||
systems where you install the translations, so gettext knows which
|
||||
translations correspond to your script. You'll use the template file to
|
||||
create translations for each target language. The template file
|
||||
conventionally has the suffix '.pot'.
|
||||
|
||||
You copy this template file to a separate file for each target
|
||||
language you want to support (called "PO" files, which use the suffix
|
||||
'.po'). PO files use various naming conventions, but when you are
|
||||
working to translate a template file into a particular language, you
|
||||
first copy the template file to a file whose name is the language you
|
||||
want to target, with the '.po' suffix. For instance, the Spanish
|
||||
translations of your strings would be in a file named 'es.po', and to
|
||||
get started using a message domain named "example," you would run
|
||||
|
||||
cp example.pot es.po
|
||||
|
||||
Ultimately, PO files are often named DOMAIN.po and installed in
|
||||
directories that contain multiple translation files for a particular
|
||||
language.
|
||||
|
||||
Whichever naming convention you choose, you will need to translate
|
||||
the strings in the PO files into the appropriate languages. This has to
|
||||
be done manually.
|
||||
|
||||
When you have the translations and PO files complete, you'll use the
|
||||
gettext tools to produce what are called "MO" files, which are compiled
|
||||
versions of the PO files the gettext tools use to look up translations
|
||||
efficiently. MO files are also called "message catalog" files. You use
|
||||
the 'msgfmt' program to do this. For instance, if you had a file with
|
||||
Spanish translations, you could run
|
||||
|
||||
msgfmt -o es.mo es.po
|
||||
|
||||
to produce the corresponding MO file.
|
||||
|
||||
Once you have the MO files, you decide where to install them and use
|
||||
the 'TEXTDOMAINDIR' shell variable to tell the gettext tools where they
|
||||
are. Make sure to use the same message domain to name the MO files as
|
||||
you did for the PO files when you install them.
|
||||
|
||||
Your users will use the 'LANG' or 'LC_MESSAGES' shell variables to
|
||||
select the desired language.
|
||||
|
||||
You set the 'TEXTDOMAIN' variable to the script's message domain. As
|
||||
above, you use the message domain to name your translation files.
|
||||
|
||||
You, or possibly your users, set the 'TEXTDOMAINDIR' variable to the
|
||||
name of a directory where the message catalog files are stored. If you
|
||||
install the message files into the system's standard message catalog
|
||||
directory, you don't need to worry about this variable.
|
||||
|
||||
The directory where the message catalog files are stored varies
|
||||
between systems. Some use the message catalog selected by the
|
||||
'LC_MESSAGES' shell variable. Others create the name of the message
|
||||
catalog from the value of the 'TEXTDOMAIN' shell variable, possibly
|
||||
adding the '.mo' suffix. If you use the 'TEXTDOMAIN' variable, you may
|
||||
need to set the 'TEXTDOMAINDIR' variable to the location of the message
|
||||
catalog files, as above. It's common to use both variables in this
|
||||
fashion: '$TEXTDOMAINDIR'/'$LC_MESSAGES'/LC_MESSAGES/'$TEXTDOMAIN'.mo.
|
||||
|
||||
If you used that last convention, and you wanted to store the message
|
||||
catalog files with Spanish (es) and Esperanto (eo) translations into a
|
||||
local directory you use for custom translation files, you could run
|
||||
|
||||
TEXTDOMAIN=example
|
||||
TEXTDOMAINDIR=/usr/local/share/locale
|
||||
|
||||
cp es.mo ${TEXTDOMAINDIR}/es/LC_MESSAGES/${TEXTDOMAIN}.mo
|
||||
cp eo.mo ${TEXTDOMAINDIR}/eo/LC_MESSAGES/${TEXTDOMAIN}.mo
|
||||
|
||||
When all of this is done, and the message catalog files containing
|
||||
the compiled translations are installed in the correct location, your
|
||||
users will be able to see translated strings in any of the supported
|
||||
languages by setting the 'LANG' or 'LC_MESSAGES' environment variables
|
||||
before running your script.
|
||||
|
||||
|
||||
File: bashref.info, Node: Comments, Prev: Quoting, Up: Shell Syntax
|
||||
@@ -8562,6 +8645,11 @@ File: bashref.info, Node: Commands For History, Next: Commands For Text, Prev
|
||||
supplied, specifies the history entry to use instead of the current
|
||||
line.
|
||||
|
||||
'fetch-history ()'
|
||||
With a numeric argument, fetch that entry from the history list and
|
||||
make it the current line. Without an argument, move back to the
|
||||
first entry in the history list.
|
||||
|
||||
|
||||
File: bashref.info, Node: Commands For Text, Next: Commands For Killing, Prev: Commands For History, Up: Bindable Readline Commands
|
||||
|
||||
@@ -11668,11 +11756,12 @@ D.3 Parameter and Variable Index
|
||||
(line 197)
|
||||
* keymap: Readline Init File Syntax.
|
||||
(line 204)
|
||||
* LANG: Bash Variables. (line 485)
|
||||
* LANG: Locale Translation. (line 69)
|
||||
* LANG <1>: Bash Variables. (line 485)
|
||||
* LC_ALL: Bash Variables. (line 489)
|
||||
* LC_COLLATE: Bash Variables. (line 493)
|
||||
* LC_CTYPE: Bash Variables. (line 500)
|
||||
* LC_MESSAGES: Locale Translation. (line 15)
|
||||
* LC_MESSAGES: Locale Translation. (line 69)
|
||||
* LC_MESSAGES <1>: Bash Variables. (line 505)
|
||||
* LC_NUMERIC: Bash Variables. (line 509)
|
||||
* LC_TIME: Bash Variables. (line 513)
|
||||
@@ -11741,8 +11830,8 @@ D.3 Parameter and Variable Index
|
||||
* skip-completed-text: Readline Init File Syntax.
|
||||
(line 299)
|
||||
* SRANDOM: Bash Variables. (line 657)
|
||||
* TEXTDOMAIN: Locale Translation. (line 15)
|
||||
* TEXTDOMAINDIR: Locale Translation. (line 15)
|
||||
* TEXTDOMAIN: Locale Translation. (line 69)
|
||||
* TEXTDOMAINDIR: Locale Translation. (line 69)
|
||||
* TIMEFORMAT: Bash Variables. (line 666)
|
||||
* TMOUT: Bash Variables. (line 704)
|
||||
* TMPDIR: Bash Variables. (line 716)
|
||||
@@ -11838,6 +11927,8 @@ D.4 Function Index
|
||||
* end-of-line (C-e): Commands For Moving. (line 9)
|
||||
* exchange-point-and-mark (C-x C-x): Miscellaneous Commands.
|
||||
(line 37)
|
||||
* fetch-history (): Commands For History.
|
||||
(line 103)
|
||||
* forward-backward-delete-char (): Commands For Text. (line 21)
|
||||
* forward-char (C-f): Commands For Moving. (line 12)
|
||||
* forward-search-history (C-s): Commands For History.
|
||||
@@ -12125,137 +12216,137 @@ D.5 Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top887
|
||||
Node: Introduction2797
|
||||
Node: What is Bash?3013
|
||||
Node: What is a shell?4127
|
||||
Node: Definitions6665
|
||||
Node: Basic Shell Features9616
|
||||
Node: Shell Syntax10835
|
||||
Node: Shell Operation11861
|
||||
Node: Quoting13154
|
||||
Node: Escape Character14458
|
||||
Node: Single Quotes14943
|
||||
Node: Double Quotes15291
|
||||
Node: ANSI-C Quoting16569
|
||||
Node: Locale Translation17826
|
||||
Node: Comments18981
|
||||
Node: Shell Commands19599
|
||||
Node: Reserved Words20537
|
||||
Node: Simple Commands21293
|
||||
Node: Pipelines21947
|
||||
Node: Lists24904
|
||||
Node: Compound Commands26699
|
||||
Node: Looping Constructs27711
|
||||
Node: Conditional Constructs30206
|
||||
Node: Command Grouping44368
|
||||
Node: Coprocesses45843
|
||||
Node: GNU Parallel48506
|
||||
Node: Shell Functions52807
|
||||
Node: Shell Parameters60027
|
||||
Node: Positional Parameters64460
|
||||
Node: Special Parameters65362
|
||||
Node: Shell Expansions68586
|
||||
Node: Brace Expansion70713
|
||||
Node: Tilde Expansion73438
|
||||
Node: Shell Parameter Expansion76059
|
||||
Node: Command Substitution91188
|
||||
Node: Arithmetic Expansion92543
|
||||
Node: Process Substitution93475
|
||||
Node: Word Splitting94595
|
||||
Node: Filename Expansion96539
|
||||
Node: Pattern Matching99088
|
||||
Node: Quote Removal103078
|
||||
Node: Redirections103373
|
||||
Node: Executing Commands112947
|
||||
Node: Simple Command Expansion113617
|
||||
Node: Command Search and Execution115571
|
||||
Node: Command Execution Environment117949
|
||||
Node: Environment120935
|
||||
Node: Exit Status122598
|
||||
Node: Signals124270
|
||||
Node: Shell Scripts126237
|
||||
Node: Shell Builtin Commands129249
|
||||
Node: Bourne Shell Builtins131287
|
||||
Node: Bash Builtins152492
|
||||
Node: Modifying Shell Behavior182642
|
||||
Node: The Set Builtin182987
|
||||
Node: The Shopt Builtin193400
|
||||
Node: Special Builtins208312
|
||||
Node: Shell Variables209291
|
||||
Node: Bourne Shell Variables209728
|
||||
Node: Bash Variables211832
|
||||
Node: Bash Features244490
|
||||
Node: Invoking Bash245503
|
||||
Node: Bash Startup Files251516
|
||||
Node: Interactive Shells256619
|
||||
Node: What is an Interactive Shell?257029
|
||||
Node: Is this Shell Interactive?257678
|
||||
Node: Interactive Shell Behavior258493
|
||||
Node: Bash Conditional Expressions262006
|
||||
Node: Shell Arithmetic266583
|
||||
Node: Aliases269527
|
||||
Node: Arrays272140
|
||||
Node: The Directory Stack278149
|
||||
Node: Directory Stack Builtins278933
|
||||
Node: Controlling the Prompt283119
|
||||
Node: The Restricted Shell286084
|
||||
Node: Bash POSIX Mode288678
|
||||
Node: Shell Compatibility Mode299951
|
||||
Node: Job Control306607
|
||||
Node: Job Control Basics307067
|
||||
Node: Job Control Builtins312069
|
||||
Node: Job Control Variables317469
|
||||
Node: Command Line Editing318625
|
||||
Node: Introduction and Notation320296
|
||||
Node: Readline Interaction321919
|
||||
Node: Readline Bare Essentials323110
|
||||
Node: Readline Movement Commands324893
|
||||
Node: Readline Killing Commands325853
|
||||
Node: Readline Arguments327771
|
||||
Node: Searching328815
|
||||
Node: Readline Init File331001
|
||||
Node: Readline Init File Syntax332260
|
||||
Node: Conditional Init Constructs352798
|
||||
Node: Sample Init File356994
|
||||
Node: Bindable Readline Commands360118
|
||||
Node: Commands For Moving361322
|
||||
Node: Commands For History363373
|
||||
Node: Commands For Text368166
|
||||
Node: Commands For Killing371815
|
||||
Node: Numeric Arguments374848
|
||||
Node: Commands For Completion375987
|
||||
Node: Keyboard Macros380178
|
||||
Node: Miscellaneous Commands380865
|
||||
Node: Readline vi Mode386804
|
||||
Node: Programmable Completion387711
|
||||
Node: Programmable Completion Builtins395491
|
||||
Node: A Programmable Completion Example406186
|
||||
Node: Using History Interactively411433
|
||||
Node: Bash History Facilities412117
|
||||
Node: Bash History Builtins415122
|
||||
Node: History Interaction420130
|
||||
Node: Event Designators423750
|
||||
Node: Word Designators425104
|
||||
Node: Modifiers426864
|
||||
Node: Installing Bash428675
|
||||
Node: Basic Installation429812
|
||||
Node: Compilers and Options433070
|
||||
Node: Compiling For Multiple Architectures433811
|
||||
Node: Installation Names435504
|
||||
Node: Specifying the System Type436322
|
||||
Node: Sharing Defaults437038
|
||||
Node: Operation Controls437711
|
||||
Node: Optional Features438669
|
||||
Node: Reporting Bugs449469
|
||||
Node: Major Differences From The Bourne Shell450663
|
||||
Node: GNU Free Documentation License467513
|
||||
Node: Indexes492690
|
||||
Node: Builtin Index493144
|
||||
Node: Reserved Word Index499971
|
||||
Node: Variable Index502419
|
||||
Node: Function Index518316
|
||||
Node: Concept Index531964
|
||||
Node: Top891
|
||||
Node: Introduction2805
|
||||
Node: What is Bash?3021
|
||||
Node: What is a shell?4135
|
||||
Node: Definitions6673
|
||||
Node: Basic Shell Features9624
|
||||
Node: Shell Syntax10843
|
||||
Node: Shell Operation11869
|
||||
Node: Quoting13162
|
||||
Node: Escape Character14466
|
||||
Node: Single Quotes14951
|
||||
Node: Double Quotes15299
|
||||
Node: ANSI-C Quoting16577
|
||||
Node: Locale Translation17887
|
||||
Node: Comments22909
|
||||
Node: Shell Commands23527
|
||||
Node: Reserved Words24465
|
||||
Node: Simple Commands25221
|
||||
Node: Pipelines25875
|
||||
Node: Lists28832
|
||||
Node: Compound Commands30627
|
||||
Node: Looping Constructs31639
|
||||
Node: Conditional Constructs34134
|
||||
Node: Command Grouping48296
|
||||
Node: Coprocesses49771
|
||||
Node: GNU Parallel52434
|
||||
Node: Shell Functions56735
|
||||
Node: Shell Parameters63955
|
||||
Node: Positional Parameters68388
|
||||
Node: Special Parameters69290
|
||||
Node: Shell Expansions72514
|
||||
Node: Brace Expansion74641
|
||||
Node: Tilde Expansion77366
|
||||
Node: Shell Parameter Expansion79987
|
||||
Node: Command Substitution95116
|
||||
Node: Arithmetic Expansion96471
|
||||
Node: Process Substitution97403
|
||||
Node: Word Splitting98523
|
||||
Node: Filename Expansion100467
|
||||
Node: Pattern Matching103016
|
||||
Node: Quote Removal107006
|
||||
Node: Redirections107301
|
||||
Node: Executing Commands116875
|
||||
Node: Simple Command Expansion117545
|
||||
Node: Command Search and Execution119499
|
||||
Node: Command Execution Environment121877
|
||||
Node: Environment124863
|
||||
Node: Exit Status126526
|
||||
Node: Signals128198
|
||||
Node: Shell Scripts130165
|
||||
Node: Shell Builtin Commands133177
|
||||
Node: Bourne Shell Builtins135215
|
||||
Node: Bash Builtins156420
|
||||
Node: Modifying Shell Behavior186570
|
||||
Node: The Set Builtin186915
|
||||
Node: The Shopt Builtin197328
|
||||
Node: Special Builtins212240
|
||||
Node: Shell Variables213219
|
||||
Node: Bourne Shell Variables213656
|
||||
Node: Bash Variables215760
|
||||
Node: Bash Features248418
|
||||
Node: Invoking Bash249431
|
||||
Node: Bash Startup Files255444
|
||||
Node: Interactive Shells260547
|
||||
Node: What is an Interactive Shell?260957
|
||||
Node: Is this Shell Interactive?261606
|
||||
Node: Interactive Shell Behavior262421
|
||||
Node: Bash Conditional Expressions265934
|
||||
Node: Shell Arithmetic270511
|
||||
Node: Aliases273455
|
||||
Node: Arrays276068
|
||||
Node: The Directory Stack282077
|
||||
Node: Directory Stack Builtins282861
|
||||
Node: Controlling the Prompt287047
|
||||
Node: The Restricted Shell290012
|
||||
Node: Bash POSIX Mode292606
|
||||
Node: Shell Compatibility Mode303879
|
||||
Node: Job Control310535
|
||||
Node: Job Control Basics310995
|
||||
Node: Job Control Builtins315997
|
||||
Node: Job Control Variables321397
|
||||
Node: Command Line Editing322553
|
||||
Node: Introduction and Notation324224
|
||||
Node: Readline Interaction325847
|
||||
Node: Readline Bare Essentials327038
|
||||
Node: Readline Movement Commands328821
|
||||
Node: Readline Killing Commands329781
|
||||
Node: Readline Arguments331699
|
||||
Node: Searching332743
|
||||
Node: Readline Init File334929
|
||||
Node: Readline Init File Syntax336188
|
||||
Node: Conditional Init Constructs356726
|
||||
Node: Sample Init File360922
|
||||
Node: Bindable Readline Commands364046
|
||||
Node: Commands For Moving365250
|
||||
Node: Commands For History367301
|
||||
Node: Commands For Text372295
|
||||
Node: Commands For Killing375944
|
||||
Node: Numeric Arguments378977
|
||||
Node: Commands For Completion380116
|
||||
Node: Keyboard Macros384307
|
||||
Node: Miscellaneous Commands384994
|
||||
Node: Readline vi Mode390933
|
||||
Node: Programmable Completion391840
|
||||
Node: Programmable Completion Builtins399620
|
||||
Node: A Programmable Completion Example410315
|
||||
Node: Using History Interactively415562
|
||||
Node: Bash History Facilities416246
|
||||
Node: Bash History Builtins419251
|
||||
Node: History Interaction424259
|
||||
Node: Event Designators427879
|
||||
Node: Word Designators429233
|
||||
Node: Modifiers430993
|
||||
Node: Installing Bash432804
|
||||
Node: Basic Installation433941
|
||||
Node: Compilers and Options437199
|
||||
Node: Compiling For Multiple Architectures437940
|
||||
Node: Installation Names439633
|
||||
Node: Specifying the System Type440451
|
||||
Node: Sharing Defaults441167
|
||||
Node: Operation Controls441840
|
||||
Node: Optional Features442798
|
||||
Node: Reporting Bugs453598
|
||||
Node: Major Differences From The Bourne Shell454792
|
||||
Node: GNU Free Documentation License471642
|
||||
Node: Indexes496819
|
||||
Node: Builtin Index497273
|
||||
Node: Reserved Word Index504100
|
||||
Node: Variable Index506548
|
||||
Node: Function Index522518
|
||||
Node: Concept Index536302
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user