to a closing right paren, rejecting the format if it's not a `)'
when the loop breaks
Report from Andrey Kovalev <i.not.student@yandex.ru>
+
+ 9/6
+ ---
+jobs.c,jobs.h
+ - notify_and_cleanup: now takes an argument saying which job to notify
+ about; if arg is -1 it notifies about all jobs as previously
+ - maybe_print_job_notifications: convenience function to encapsulate
+ policy about when to call notify_of_job_status in one place; called
+ by notify_and_cleanup
+ - notify_of_job_status,maybe_print_job_notifications: now take an int
+ argument with the same semantics as notify_and_cleanup
+ - wait_for_any_job: now call notify_of_job_status only on the job we
+ just retrieved and will return
+ - wait_for: don't call notify_and_cleanup if posixly_correct unless
+ the shell is not currently interactive, since posix says we can
+ notify in a non-interactive shell when a foreground job changes
+ state
+
+jobs.c,parse.y,eval.c,execute_cmd.c,builtins/jobs.def,trap.c
+ - notify_and_cleanup: changed all callers appropriately
+
+builtins/evalfile.c
+ - _evalfile: renamed to evalfile_internal
+ - evalfile_internal: increment and decrement (or unwind-protect) the
+ value of want_job_notifications; increment it to a non-zero value
+ if the shell is interactive and the compatibility level is <= 52
+ (see change to notify_and_cleanup of 8/26)
+
+jobs.c
+ - maybe_print_job_notifications: remove clause testing sourcelevel;
+ use want_job_notifications for this
extern int errno;
#endif
-/* Flags for _evalfile() */
+/* Flags for evalfile_internal() */
#define FEVAL_ENOENTOK 0x001
#define FEVAL_BUILTIN 0x002
#define FEVAL_UNWINDPROT 0x004
int sourcelevel = 0;
static int
-_evalfile (const char *filename, int flags)
+evalfile_internal (const char *filename, int flags)
{
volatile int old_interactive;
procenv_t old_return_catch;
if (flags & FEVAL_UNWINDPROT)
{
- begin_unwind_frame ("_evalfile");
+ begin_unwind_frame ("evalfile_internal");
unwind_protect_int (return_catch_flag);
unwind_protect_jmp_buf (return_catch);
if (flags & FEVAL_NONINT)
unwind_protect_int (interactive);
unwind_protect_int (sourcelevel);
+ unwind_protect_int (want_job_notifications);
unwind_protect_int (retain_fifos);
}
else
return_catch_flag++;
sourcelevel++;
+ if (interactive_shell && shell_compatibility_level <= 52)
+ want_job_notifications++;
retain_fifos++; /* XXX */
result = parse_and_execute (string, filename, pflags);
if (flags & FEVAL_UNWINDPROT)
- run_unwind_frame ("_evalfile");
+ run_unwind_frame ("evalfile_internal");
else
{
if (flags & FEVAL_NONINT)
#endif
return_catch_flag--;
sourcelevel--;
+ if (interactive_shell && shell_compatibility_level <= 52)
+ want_job_notifications--;
retain_fifos--;
COPY_PROCENV (old_return_catch, return_catch);
}
flags = FEVAL_ENOENTOK|FEVAL_RETRY;
if (force_noninteractive)
flags |= FEVAL_NONINT;
- result = _evalfile (filename, flags);
+ result = evalfile_internal (filename, flags);
free (filename);
return result;
}
flags = FEVAL_RETRY;
if (force_noninteractive)
flags |= FEVAL_NONINT;
- result = _evalfile (filename, flags);
+ result = evalfile_internal (filename, flags);
free (filename);
return result;
}
remember_on_history is set. We use FEVAL_BUILTIN to return
the result of parse_and_execute. */
flags = FEVAL_ENOENTOK|FEVAL_HISTORY|FEVAL_REGFILE|FEVAL_BUILTIN;
- return (_evalfile (filename, flags));
+ return (evalfile_internal (filename, flags));
}
#endif /* HISTORY */
/* POSIX shells exit if non-interactive and file error. */
if (posixly_correct && interactive_shell == 0 && executing_command_builtin == 0)
flags |= FEVAL_LONGJMP;
- rval = _evalfile (filename, flags);
+ rval = evalfile_internal (filename, flags);
run_return_trap ();
return rval;
list_all_jobs (form);
/* POSIX says to remove terminated jobs from the list after the jobs
builtin reports their status. */
- notify_and_cleanup (); /* the notify part will be a no-op */
+ notify_and_cleanup (-1); /* the notify part will be a no-op */
break;
case JSTATE_RUNNING:
list_running_jobs (form);
}
/* POSIX says to remove terminated jobs from the list after the jobs
builtin reports their status. */
- notify_and_cleanup ();
+ notify_and_cleanup (-1); /* XXX - why here? list_one_job already deletes dead jobs */
return (any_failed ? EXECUTION_FAILURE : EXECUTION_SUCCESS);
}
only be referenced; assignment to them is not allowed.
*\b* Expands to the positional parameters, starting from one. When
the expansion is not within double quotes, each positional para-
- meter expands to a separate word. In contexts where it is per-
- formed, those words are subject to further word splitting and
- pathname expansion. When the expansion occurs within double
- quotes, it expands to a single word with the value of each para-
- meter separated by the first character of the I\bIF\bFS\bS special vari-
- able. That is, "\b"$\b$*\b*"\b" is equivalent to "\b"$\b$1\b1_\bc$\b$2\b2_\bc.\b..\b..\b."\b", where _\bc is
- the first character of the value of the I\bIF\bFS\bS variable. If I\bIF\bFS\bS is
- unset, the parameters are separated by spaces. If I\bIF\bFS\bS is null,
- the parameters are joined without intervening separators.
+ meter expands to a separate word. In contexts where these ex-
+ pansions are performed, those words are subject to further word
+ splitting and pathname expansion. When the expansion occurs
+ within double quotes, it expands to a single word with the value
+ of each parameter separated by the first character of the I\bIF\bFS\bS
+ special variable. That is, "\b"$\b$*\b*"\b" is equivalent to "\b"$\b$1\b1_\bc$\b$2\b2_\bc.\b..\b..\b."\b",
+ where _\bc is the first character of the value of the I\bIF\bFS\bS variable.
+ If I\bIF\bFS\bS is unset, the parameters are separated by spaces. If I\bIF\bFS\bS
+ is null, the parameters are joined without intervening separa-
+ tors.
@\b@ Expands to the positional parameters, starting from one. In
contexts where word splitting is performed, this expands each
positional parameter to a separate word; if not within double
word. When there are no positional parameters, "\b"$\b$@\b@"\b" and $\b$@\b@ ex-
pand to nothing (i.e., they are removed).
#\b# Expands to the number of positional parameters in decimal.
- ?\b? Expands to the exit status of the most recently executed fore-
- ground command.
+ ?\b? Expands to the exit status of the most recently executed com-
+ mand.
-\b- Expands to the current option flags as specified upon invoca-
tion, by the s\bse\bet\bt builtin command, or those set by the shell it-
self (such as the -\b-i\bi option).
The shell learns immediately whenever a job changes state. Normally,
b\bba\bas\bsh\bh waits until it is about to print a prompt before reporting changes
- in a job's status so as to not interrupt any other output. If the -\b-b\bb
- option to the s\bse\bet\bt builtin command is enabled, b\bba\bas\bsh\bh reports such changes
- immediately. Any trap on S\bSI\bIG\bGC\bCH\bHL\bLD\bD is executed for each child that ex-
- its.
-
- If an attempt to exit b\bba\bas\bsh\bh is made while jobs are stopped (or, if the
- c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs shell option has been enabled using the s\bsh\bho\bop\bpt\bt builtin, run-
+ in a job's status so as to not interrupt any other output, though it
+ will notify of changes in a job's status after a command in a list com-
+ pletes, before executing the next command. If the -\b-b\bb option to the s\bse\bet\bt
+ builtin command is enabled, b\bba\bas\bsh\bh reports such changes immediately. Any
+ trap on S\bSI\bIG\bGC\bCH\bHL\bLD\bD is executed for each child that exits.
+
+ If an attempt to exit b\bba\bas\bsh\bh is made while jobs are stopped (or, if the
+ c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs shell option has been enabled using the s\bsh\bho\bop\bpt\bt builtin, run-
ning), the shell prints a warning message, and, if the c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs option
- is enabled, lists the jobs and their statuses. The j\bjo\bob\bbs\bs command may
- then be used to inspect their status. If a second attempt to exit is
- made without an intervening command, the shell does not print another
+ is enabled, lists the jobs and their statuses. The j\bjo\bob\bbs\bs command may
+ then be used to inspect their status. If a second attempt to exit is
+ made without an intervening command, the shell does not print another
warning, and any stopped jobs are terminated.
- When the shell is waiting for a job or process using the w\bwa\bai\bit\bt builtin,
- and job control is enabled, w\bwa\bai\bit\bt will return when the job changes
- state. The -\b-f\bf option causes w\bwa\bai\bit\bt to wait until the job or process ter-
+ When the shell is waiting for a job or process using the w\bwa\bai\bit\bt builtin,
+ and job control is enabled, w\bwa\bai\bit\bt will return when the job changes
+ state. The -\b-f\bf option causes w\bwa\bai\bit\bt to wait until the job or process ter-
minates before returning.
P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG
When executing interactively, b\bba\bas\bsh\bh displays the primary prompt P\bPS\bS1\b1 when
- it is ready to read a command, and the secondary prompt P\bPS\bS2\b2 when it
- needs more input to complete a command. B\bBa\bas\bsh\bh displays P\bPS\bS0\b0 after it
- reads a command but before executing it. B\bBa\bas\bsh\bh displays P\bPS\bS4\b4 as de-
- scribed above before tracing each command when the -\b-x\bx option is en-
- abled. B\bBa\bas\bsh\bh allows these prompt strings to be customized by inserting
- a number of backslash-escaped special characters that are decoded as
+ it is ready to read a command, and the secondary prompt P\bPS\bS2\b2 when it
+ needs more input to complete a command. B\bBa\bas\bsh\bh displays P\bPS\bS0\b0 after it
+ reads a command but before executing it. B\bBa\bas\bsh\bh displays P\bPS\bS4\b4 as de-
+ scribed above before tracing each command when the -\b-x\bx option is en-
+ abled. B\bBa\bas\bsh\bh allows these prompt strings to be customized by inserting
+ a number of backslash-escaped special characters that are decoded as
follows:
\\b\a\ba an ASCII bell character (07)
- \\b\d\bd the date in "Weekday Month Date" format (e.g., "Tue May
+ \\b\d\bd the date in "Weekday Month Date" format (e.g., "Tue May
26")
\\b\D\bD{\b{_\bf_\bo_\br_\bm_\ba_\bt}\b}
the _\bf_\bo_\br_\bm_\ba_\bt is passed to _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) and the result is in-
serted into the prompt string; an empty _\bf_\bo_\br_\bm_\ba_\bt results in
- a locale-specific time representation. The braces are
+ a locale-specific time representation. The braces are
required
\\b\e\be an ASCII escape character (033)
\\b\h\bh the hostname up to the first "."
\\b\l\bl the basename of the shell's terminal device name
\\b\n\bn newline
\\b\r\br carriage return
- \\b\s\bs the name of the shell, the basename of $\b$0\b0 (the portion
+ \\b\s\bs the name of the shell, the basename of $\b$0\b0 (the portion
following the final slash)
\\b\t\bt the current time in 24-hour HH:MM:SS format
\\b\T\bT the current time in 12-hour HH:MM:SS format
\\b\u\bu the username of the current user
\\b\v\bv the version of b\bba\bas\bsh\bh (e.g., 2.00)
\\b\V\bV the release of b\bba\bas\bsh\bh, version + patch level (e.g., 2.00.0)
- \\b\w\bw the value of the P\bPW\bWD\bD shell variable ($\b$P\bPW\bWD\bD), with $\b$H\bHO\bOM\bME\bE
- abbreviated with a tilde (uses the value of the
+ \\b\w\bw the value of the P\bPW\bWD\bD shell variable ($\b$P\bPW\bWD\bD), with $\b$H\bHO\bOM\bME\bE
+ abbreviated with a tilde (uses the value of the
P\bPR\bRO\bOM\bMP\bPT\bT_\b_D\bDI\bIR\bRT\bTR\bRI\bIM\bM variable)
\\b\W\bW the basename of $\b$P\bPW\bWD\bD, with $\b$H\bHO\bOM\bME\bE abbreviated with a tilde
\\b\!\b! the history number of this command
\\b\$\b$ if the effective UID is 0, a #\b#, otherwise a $\b$
\\b\_\bn_\bn_\bn the character corresponding to the octal number _\bn_\bn_\bn
\\b\\\b\ a backslash
- \\b\[\b[ begin a sequence of non-printing characters, which could
- be used to embed a terminal control sequence into the
+ \\b\[\b[ begin a sequence of non-printing characters, which could
+ be used to embed a terminal control sequence into the
prompt
\\b\]\b] end a sequence of non-printing characters
- The command number and the history number are usually different: the
- history number of a command is its position in the history list, which
- may include commands restored from the history file (see H\bHI\bIS\bST\bTO\bOR\bRY\bY be-
- low), while the command number is the position in the sequence of com-
- mands executed during the current shell session. After the string is
- decoded, it is expanded via parameter expansion, command substitution,
- arithmetic expansion, and quote removal, subject to the value of the
+ The command number and the history number are usually different: the
+ history number of a command is its position in the history list, which
+ may include commands restored from the history file (see H\bHI\bIS\bST\bTO\bOR\bRY\bY be-
+ low), while the command number is the position in the sequence of com-
+ mands executed during the current shell session. After the string is
+ decoded, it is expanded via parameter expansion, command substitution,
+ arithmetic expansion, and quote removal, subject to the value of the
p\bpr\bro\bom\bmp\bpt\btv\bva\bar\brs\bs shell option (see the description of the s\bsh\bho\bop\bpt\bt command under
- S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). This can have unwanted side effects if
- escaped portions of the string appear within command substitution or
+ S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). This can have unwanted side effects if
+ escaped portions of the string appear within command substitution or
contain characters special to word expansion.
R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE
- This is the library that handles reading input when using an interac-
+ This is the library that handles reading input when using an interac-
tive shell, unless the -\b--\b-n\bno\boe\bed\bdi\bit\bti\bin\bng\bg option is given at shell invocation.
Line editing is also used when using the -\b-e\be option to the r\bre\bea\bad\bd builtin.
By default, the line editing commands are similar to those of Emacs. A
vi-style line editing interface is also available. Line editing can be
- enabled at any time using the -\b-o\bo e\bem\bma\bac\bcs\bs or -\b-o\bo v\bvi\bi options to the s\bse\bet\bt
- builtin (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). To turn off line editing
- after the shell is running, use the +\b+o\bo e\bem\bma\bac\bcs\bs or +\b+o\bo v\bvi\bi options to the
+ enabled at any time using the -\b-o\bo e\bem\bma\bac\bcs\bs or -\b-o\bo v\bvi\bi options to the s\bse\bet\bt
+ builtin (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). To turn off line editing
+ after the shell is running, use the +\b+o\bo e\bem\bma\bac\bcs\bs or +\b+o\bo v\bvi\bi options to the
s\bse\bet\bt builtin.
R\bRe\bea\bad\bdl\bli\bin\bne\be N\bNo\bot\bta\bat\bti\bio\bon\bn
In this section, the Emacs-style notation is used to denote keystrokes.
- Control keys are denoted by C-_\bk_\be_\by, e.g., C-n means Control-N. Simi-
- larly, _\bm_\be_\bt_\ba keys are denoted by M-_\bk_\be_\by, so M-x means Meta-X. (On key-
- boards without a _\bm_\be_\bt_\ba key, M-_\bx means ESC _\bx, i.e., press the Escape key
- then the _\bx key. This makes ESC the _\bm_\be_\bt_\ba _\bp_\br_\be_\bf_\bi_\bx. The combination M-C-_\bx
- means ESC-Control-_\bx, or press the Escape key then hold the Control key
- while pressing the _\bx key.)
+ Control keys are denoted by C-_\bk_\be_\by, e.g., C-n means Control-N. Simi-
+ larly, _\bm_\be_\bt_\ba keys are denoted by M-_\bk_\be_\by, so M-x means Meta-X.
+
+ On keyboards without a _\bM_\be_\bt_\ba key, M-_\bx means ESC _\bx, i.e., press the Es-
+ cape key then the _\bx key. This makes ESC the _\bm_\be_\bt_\ba _\bp_\br_\be_\bf_\bi_\bx. The combina-
+ tion M-C-_\bx means ESC-Control-_\bx, or press the Escape key then hold the
+ Control key while pressing the _\bx key.)
+
+ On some keyboards, the Meta key modifier produces meta characters with
+ the eighth bit (0200) set (you can use the e\ben\bna\bab\bbl\ble\be-\b-m\bme\bet\bta\ba-\b-k\bke\bey\by variable to
+ control whether or not it does this, if the keyboard allows it). On
+ many others, the terminal or terminal emulator converts the metafied
+ key to a key sequence beginning with ESC as described in the preceding
+ paragraph.
+
+ If the _\bM_\be_\bt_\ba key produces a key sequence with the ESC meta prefix, you
+ can make M-_\bk_\be_\by key bindings you specify (see R\bRe\bea\bad\bdl\bli\bin\bne\be K\bKe\bey\by B\bBi\bin\bnd\bdi\bin\bng\bgs\bs be-
+ low) do the same thing by setting the f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx variable.
Readline commands may be given numeric _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs, which normally act as
- a repeat count. Sometimes, however, it is the sign of the argument
- that is significant. Passing a negative argument to a command that
- acts in the forward direction (e.g., k\bki\bil\bll\bl-\b-l\bli\bin\bne\be) causes that command to
- act in a backward direction. Commands whose behavior with arguments
+ a repeat count. Sometimes, however, it is the sign of the argument
+ that is significant. Passing a negative argument to a command that
+ acts in the forward direction (e.g., k\bki\bil\bll\bl-\b-l\bli\bin\bne\be) causes that command to
+ act in a backward direction. Commands whose behavior with arguments
deviates from this are noted below.
- When a command is described as _\bk_\bi_\bl_\bl_\bi_\bn_\bg text, the text deleted is saved
+ When a command is described as _\bk_\bi_\bl_\bl_\bi_\bn_\bg text, the text deleted is saved
for possible future retrieval (_\by_\ba_\bn_\bk_\bi_\bn_\bg). The killed text is saved in a
_\bk_\bi_\bl_\bl _\br_\bi_\bn_\bg. Consecutive kills cause the text to be accumulated into one
unit, which can be yanked all at once. Commands which do not kill text
separate the chunks of text on the kill ring.
R\bRe\bea\bad\bdl\bli\bin\bne\be I\bIn\bni\bit\bti\bia\bal\bli\biz\bza\bat\bti\bio\bon\bn
- Readline is customized by putting commands in an initialization file
- (the _\bi_\bn_\bp_\bu_\bt_\br_\bc file). The name of this file is taken from the value of
+ Readline is customized by putting commands in an initialization file
+ (the _\bi_\bn_\bp_\bu_\bt_\br_\bc file). The name of this file is taken from the value of
the I\bIN\bNP\bPU\bUT\bTR\bRC\bC variable. If that variable is unset, the default is _\b~_\b/_\b._\bi_\bn_\b-
- _\bp_\bu_\bt_\br_\bc. If that file does not exist or cannot be read, the ultimate
- default is _\b/_\be_\bt_\bc_\b/_\bi_\bn_\bp_\bu_\bt_\br_\bc. When a program which uses the readline li-
- brary starts up, the initialization file is read, and the key bindings
- and variables are set. There are only a few basic constructs allowed
- in the readline initialization file. Blank lines are ignored. Lines
- beginning with a #\b# are comments. Lines beginning with a $\b$ indicate
- conditional constructs. Other lines denote key bindings and variable
+ _\bp_\bu_\bt_\br_\bc. If that file does not exist or cannot be read, the ultimate
+ default is _\b/_\be_\bt_\bc_\b/_\bi_\bn_\bp_\bu_\bt_\br_\bc. When a program which uses the readline li-
+ brary starts up, the initialization file is read, and the key bindings
+ and variables are set. There are only a few basic constructs allowed
+ in the readline initialization file. Blank lines are ignored. Lines
+ beginning with a #\b# are comments. Lines beginning with a $\b$ indicate
+ conditional constructs. Other lines denote key bindings and variable
settings.
- The default key-bindings may be changed with an _\bi_\bn_\bp_\bu_\bt_\br_\bc file. Other
+ The default key-bindings may be changed with an _\bi_\bn_\bp_\bu_\bt_\br_\bc file. Other
programs that use this library may add their own commands and bindings.
For example, placing
or
C-Meta-u: universal-argument
- into the _\bi_\bn_\bp_\bu_\bt_\br_\bc would make M-C-u execute the readline command _\bu_\bn_\bi_\bv_\be_\br_\b-
+ into the _\bi_\bn_\bp_\bu_\bt_\br_\bc would make M-C-u execute the readline command _\bu_\bn_\bi_\bv_\be_\br_\b-
_\bs_\ba_\bl_\b-_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt.
- The following symbolic character names are recognized: _\bR_\bU_\bB_\bO_\bU_\bT, _\bD_\bE_\bL,
+ The following symbolic character names are recognized: _\bR_\bU_\bB_\bO_\bU_\bT, _\bD_\bE_\bL,
_\bE_\bS_\bC, _\bL_\bF_\bD, _\bN_\bE_\bW_\bL_\bI_\bN_\bE, _\bR_\bE_\bT, _\bR_\bE_\bT_\bU_\bR_\bN, _\bS_\bP_\bC, _\bS_\bP_\bA_\bC_\bE, and _\bT_\bA_\bB.
- In addition to command names, readline allows keys to be bound to a
+ In addition to command names, readline allows keys to be bound to a
string that is inserted when the key is pressed (a _\bm_\ba_\bc_\br_\bo).
R\bRe\bea\bad\bdl\bli\bin\bne\be K\bKe\bey\by B\bBi\bin\bnd\bdi\bin\bng\bgs\bs
- The syntax for controlling key bindings in the _\bi_\bn_\bp_\bu_\bt_\br_\bc file is simple.
- All that is required is the name of the command or the text of a macro
+ The syntax for controlling key bindings in the _\bi_\bn_\bp_\bu_\bt_\br_\bc file is simple.
+ All that is required is the name of the command or the text of a macro
and a key sequence to which it should be bound. The name may be speci-
fied in one of two ways: as a symbolic key name, possibly with _\bM_\be_\bt_\ba_\b- or
_\bC_\bo_\bn_\bt_\br_\bo_\bl_\b- prefixes, or as a key sequence.
Meta-Rubout: backward-kill-word
Control-o: "> output"
- In the above example, _\bC_\b-_\bu is bound to the function u\bun\bni\biv\bve\ber\brs\bsa\bal\bl-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt,
- _\bM_\b-_\bD_\bE_\bL is bound to the function b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd, and _\bC_\b-_\bo is bound to
- run the macro expressed on the right hand side (that is, to insert the
+ In the above example, _\bC_\b-_\bu is bound to the function u\bun\bni\biv\bve\ber\brs\bsa\bal\bl-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt,
+ _\bM_\b-_\bD_\bE_\bL is bound to the function b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd, and _\bC_\b-_\bo is bound to
+ run the macro expressed on the right hand side (that is, to insert the
text "> output" into the line).
- In the second form, "\b"k\bke\bey\bys\bse\beq\bq"\b":_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be or _\bm_\ba_\bc_\br_\bo, k\bke\bey\bys\bse\beq\bq differs
- from k\bke\bey\byn\bna\bam\bme\be above in that strings denoting an entire key sequence may
- be specified by placing the sequence within double quotes. Some GNU
- Emacs style key escapes can be used, as in the following example, but
+ In the second form, "\b"k\bke\bey\bys\bse\beq\bq"\b":_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be or _\bm_\ba_\bc_\br_\bo, k\bke\bey\bys\bse\beq\bq differs
+ from k\bke\bey\byn\bna\bam\bme\be above in that strings denoting an entire key sequence may
+ be specified by placing the sequence within double quotes. Some GNU
+ Emacs style key escapes can be used, as in the following example, but
the symbolic character names are not recognized.
"\C-u": universal-argument
"\e[11~": "Function Key 1"
In this example, _\bC_\b-_\bu is again bound to the function u\bun\bni\biv\bve\ber\brs\bsa\bal\bl-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt.
- _\bC_\b-_\bx _\bC_\b-_\br is bound to the function r\bre\be-\b-r\bre\bea\bad\bd-\b-i\bin\bni\bit\bt-\b-f\bfi\bil\ble\be, and _\bE_\bS_\bC _\b[ _\b1 _\b1 _\b~ is
+ _\bC_\b-_\bx _\bC_\b-_\br is bound to the function r\bre\be-\b-r\bre\bea\bad\bd-\b-i\bin\bni\bit\bt-\b-f\bfi\bil\ble\be, and _\bE_\bS_\bC _\b[ _\b1 _\b1 _\b~ is
bound to insert the text "Function Key 1".
The full set of GNU Emacs style escape sequences is
\\b\C\bC-\b- control prefix
- \\b\M\bM-\b- meta prefix
+ \\b\M\bM-\b- adding the meta prefix or converting the following char-
+ acter to a meta character, as described below under
+ f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx
\\b\e\be an escape character
\\b\\\b\ backslash
\\b\"\b" literal "
\\b\'\b' literal '
- In addition to the GNU Emacs style escape sequences, a second set of
+ In addition to the GNU Emacs style escape sequences, a second set of
backslash escapes is available:
\\b\a\ba alert (bell)
\\b\b\bb backspace
\\b\r\br carriage return
\\b\t\bt horizontal tab
\\b\v\bv vertical tab
- \\b\_\bn_\bn_\bn the eight-bit character whose value is the octal value
+ \\b\_\bn_\bn_\bn the eight-bit character whose value is the octal value
_\bn_\bn_\bn (one to three digits)
- \\b\x\bx_\bH_\bH the eight-bit character whose value is the hexadecimal
+ \\b\x\bx_\bH_\bH the eight-bit character whose value is the hexadecimal
value _\bH_\bH (one or two hex digits)
When entering the text of a macro, single or double quotes must be used
to indicate a macro definition. Unquoted text is assumed to be a func-
- tion name. In the macro body, the backslash escapes described above
- are expanded. Backslash will quote any other character in the macro
+ tion name. In the macro body, the backslash escapes described above
+ are expanded. Backslash will quote any other character in the macro
text, including " and '.
- B\bBa\bas\bsh\bh allows the current readline key bindings to be displayed or modi-
- fied with the b\bbi\bin\bnd\bd builtin command. The editing mode may be switched
- during interactive use by using the -\b-o\bo option to the s\bse\bet\bt builtin com-
+ B\bBa\bas\bsh\bh allows the current readline key bindings to be displayed or modi-
+ fied with the b\bbi\bin\bnd\bd builtin command. The editing mode may be switched
+ during interactive use by using the -\b-o\bo option to the s\bse\bet\bt builtin com-
mand (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
R\bRe\bea\bad\bdl\bli\bin\bne\be V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs
s\bse\bet\bt _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\b-_\bn_\ba_\bm_\be _\bv_\ba_\bl_\bu_\be
or using the b\bbi\bin\bnd\bd builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
- Except where noted, readline variables can take the values O\bOn\bn or O\bOf\bff\bf
- (without regard to case). Unrecognized variable names are ignored.
+ Except where noted, readline variables can take the values O\bOn\bn or O\bOf\bff\bf
+ (without regard to case). Unrecognized variable names are ignored.
When readline reads a variable value, empty or null values, "on" (case-
- insensitive), and "1" are equivalent to O\bOn\bn. All other values are
+ insensitive), and "1" are equivalent to O\bOn\bn. All other values are
equivalent to O\bOf\bff\bf. The variables and their default values are:
a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br
- A string variable that controls the text color and background
- when displaying the text in the active region (see the descrip-
- tion of e\ben\bna\bab\bbl\ble\be-\b-a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn below). This string must not take
+ A string variable that controls the text color and background
+ when displaying the text in the active region (see the descrip-
+ tion of e\ben\bna\bab\bbl\ble\be-\b-a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn below). This string must not take
up any physical character positions on the display, so it should
- consist only of terminal escape sequences. It is output to the
- terminal before displaying the text in the active region. This
- variable is reset to the default value whenever the terminal
- type changes. The default value is the string that puts the
- terminal in standout mode, as obtained from the terminal's ter-
+ consist only of terminal escape sequences. It is output to the
+ terminal before displaying the text in the active region. This
+ variable is reset to the default value whenever the terminal
+ type changes. The default value is the string that puts the
+ terminal in standout mode, as obtained from the terminal's ter-
minfo description. A sample value might be "\e[01;33m".
a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn-\b-e\ben\bnd\bd-\b-c\bco\bol\blo\bor\br
- A string variable that "undoes" the effects of a\bac\bct\bti\biv\bve\be-\b-r\bre\be-\b-
- g\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br and restores "normal" terminal display appear-
- ance after displaying text in the active region. This string
- must not take up any physical character positions on the dis-
- play, so it should consist only of terminal escape sequences.
- It is output to the terminal after displaying the text in the
- active region. This variable is reset to the default value
- whenever the terminal type changes. The default value is the
- string that restores the terminal from standout mode, as ob-
+ A string variable that "undoes" the effects of a\bac\bct\bti\biv\bve\be-\b-r\bre\be-\b-
+ g\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br and restores "normal" terminal display appear-
+ ance after displaying text in the active region. This string
+ must not take up any physical character positions on the dis-
+ play, so it should consist only of terminal escape sequences.
+ It is output to the terminal after displaying the text in the
+ active region. This variable is reset to the default value
+ whenever the terminal type changes. The default value is the
+ string that restores the terminal from standout mode, as ob-
tained from the terminal's terminfo description. A sample value
might be "\e[0m".
b\bbe\bel\bll\bl-\b-s\bst\bty\byl\ble\be (\b(a\bau\bud\bdi\bib\bbl\ble\be)\b)
- Controls what happens when readline wants to ring the terminal
+ Controls what happens when readline wants to ring the terminal
bell. If set to n\bno\bon\bne\be, readline never rings the bell. If set to
- v\bvi\bis\bsi\bib\bbl\ble\be, readline uses a visible bell if one is available. If
+ v\bvi\bis\bsi\bib\bbl\ble\be, readline uses a visible bell if one is available. If
set to a\bau\bud\bdi\bib\bbl\ble\be, readline attempts to ring the terminal's bell.
b\bbi\bin\bnd\bd-\b-t\btt\bty\by-\b-s\bsp\bpe\bec\bci\bia\bal\bl-\b-c\bch\bha\bar\brs\bs (\b(O\bOn\bn)\b)
- If set to O\bOn\bn (the default), readline attempts to bind the con-
+ If set to O\bOn\bn (the default), readline attempts to bind the con-
trol characters that are treated specially by the kernel's ter-
- minal driver to their readline equivalents. These override the
- default readline bindings described here. Type "stty -a" at a
+ minal driver to their readline equivalents. These override the
+ default readline bindings described here. Type "stty -a" at a
b\bba\bas\bsh\bh prompt to see your current terminal settings, including the
special control characters (usually c\bcc\bch\bha\bar\brs\bs).
b\bbl\bli\bin\bnk\bk-\b-m\bma\bat\btc\bch\bhi\bin\bng\bg-\b-p\bpa\bar\bre\ben\bn (\b(O\bOf\bff\bf)\b)
If set to O\bOn\bn, readline attempts to briefly move the cursor to an
opening parenthesis when a closing parenthesis is inserted.
c\bco\bol\blo\bor\bre\bed\bd-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-p\bpr\bre\bef\bfi\bix\bx (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, when listing completions, readline displays the
+ If set to O\bOn\bn, when listing completions, readline displays the
common prefix of the set of possible completions using a differ-
- ent color. The color definitions are taken from the value of
+ ent color. The color definitions are taken from the value of
the L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS environment variable. If there is a color defini-
- tion in $\b$L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS for the custom suffix "readline-colored-com-
- pletion-prefix", readline uses this color for the common prefix
+ tion in $\b$L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS for the custom suffix "readline-colored-com-
+ pletion-prefix", readline uses this color for the common prefix
instead of its default.
c\bco\bol\blo\bor\bre\bed\bd-\b-s\bst\bta\bat\bts\bs (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, readline displays possible completions using dif-
- ferent colors to indicate their file type. The color defini-
- tions are taken from the value of the L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS environment
+ If set to O\bOn\bn, readline displays possible completions using dif-
+ ferent colors to indicate their file type. The color defini-
+ tions are taken from the value of the L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS environment
variable.
c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn (\b("#\b#")\b)
- The string that is inserted when the readline i\bin\bns\bse\ber\brt\bt-\b-c\bco\bom\bmm\bme\ben\bnt\bt
+ The string that is inserted when the readline i\bin\bns\bse\ber\brt\bt-\b-c\bco\bom\bmm\bme\ben\bnt\bt
command is executed. This command is bound to M\bM-\b-#\b# in emacs mode
and to #\b# in vi command mode.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-d\bdi\bis\bsp\bpl\bla\bay\by-\b-w\bwi\bid\bdt\bth\bh (\b(-\b-1\b1)\b)
- 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
+ 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.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-i\big\bgn\bno\bor\bre\be-\b-c\bca\bas\bse\be (\b(O\bOf\bff\bf)\b)
If set to O\bOn\bn, readline performs filename matching and completion
in a case-insensitive fashion.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-m\bma\bap\bp-\b-c\bca\bas\bse\be (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, and c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-i\big\bgn\bno\bor\bre\be-\b-c\bca\bas\bse\be is enabled, readline
- treats hyphens (_\b-) and underscores (_\b_) as equivalent when per-
+ If set to O\bOn\bn, and c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-i\big\bgn\bno\bor\bre\be-\b-c\bca\bas\bse\be is enabled, readline
+ treats hyphens (_\b-) and underscores (_\b_) as equivalent when per-
forming case-insensitive filename matching and completion.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-p\bpr\bre\bef\bfi\bix\bx-\b-d\bdi\bis\bsp\bpl\bla\bay\by-\b-l\ble\ben\bng\bgt\bth\bh (\b(0\b0)\b)
- The length in characters of the common prefix of a list of pos-
- sible completions that is displayed without modification. When
- set to a value greater than zero, common prefixes longer than
- this value are replaced with an ellipsis when displaying possi-
+ The length in characters of the common prefix of a list of pos-
+ sible completions that is displayed without modification. When
+ set to a value greater than zero, common prefixes longer than
+ this value are replaced with an ellipsis when displaying possi-
ble completions.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-q\bqu\bue\ber\bry\by-\b-i\bit\bte\bem\bms\bs (\b(1\b10\b00\b0)\b)
- This determines when the user is queried about viewing the num-
- ber of possible completions generated by the p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\be-\b-
- t\bti\bio\bon\bns\bs command. It may be set to any integer value greater than
- or equal to zero. If the number of possible completions is
- greater than or equal to the value of this variable, readline
- will ask whether or not the user wishes to view them; otherwise
- they are simply listed on the terminal. A zero value means
+ This determines when the user is queried about viewing the num-
+ ber of possible completions generated by the p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\be-\b-
+ t\bti\bio\bon\bns\bs command. It may be set to any integer value greater than
+ or equal to zero. If the number of possible completions is
+ greater than or equal to the value of this variable, readline
+ will ask whether or not the user wishes to view them; otherwise
+ they are simply listed on the terminal. A zero value means
readline should never ask; negative values are treated as zero.
c\bco\bon\bnv\bve\ber\brt\bt-\b-m\bme\bet\bta\ba (\b(O\bOn\bn)\b)
- If set to O\bOn\bn, readline will convert characters with the eighth
- bit set to an ASCII key sequence by stripping the eighth bit and
- prefixing an escape character (in effect, using escape as the
- _\bm_\be_\bt_\ba _\bp_\br_\be_\bf_\bi_\bx). The default is _\bO_\bn, but readline will set it to
- _\bO_\bf_\bf if the locale contains eight-bit characters. This variable
- is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE locale category, and may change if
- the locale is changed.
+ If set to O\bOn\bn, readline will convert characters it reads with the
+ eighth bit set to an ASCII key sequence by stripping the eighth
+ bit and prefixing it with an escape character (converting the
+ character to have the _\bm_\be_\bt_\ba _\bp_\br_\be_\bf_\bi_\bx). The default is _\bO_\bn, but
+ readline will set it to _\bO_\bf_\bf if the locale contains characters
+ whose encodings may include bytes with the eighth bit set. This
+ variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE locale category, and may
+ change if the locale is changed. This variable also affects key
+ bindings; see the description of f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx below.
d\bdi\bis\bsa\bab\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn (\b(O\bOf\bff\bf)\b)
If set to O\bOn\bn, readline will inhibit word completion. Completion
- characters will be inserted into the line as if they had been
+ characters will be inserted into the line as if they had been
mapped to s\bse\bel\blf\bf-\b-i\bin\bns\bse\ber\brt\bt.
e\bec\bch\bho\bo-\b-c\bco\bon\bnt\btr\bro\bol\bl-\b-c\bch\bha\bar\bra\bac\bct\bte\ber\brs\bs (\b(O\bOn\bn)\b)
- When set to O\bOn\bn, on operating systems that indicate they support
+ When set to O\bOn\bn, on operating systems that indicate they support
it, readline echoes a character corresponding to a signal gener-
ated from the keyboard.
e\bed\bdi\bit\bti\bin\bng\bg-\b-m\bmo\bod\bde\be (\b(e\bem\bma\bac\bcs\bs)\b)
ilar to _\bE_\bm_\ba_\bc_\bs or _\bv_\bi. e\bed\bdi\bit\bti\bin\bng\bg-\b-m\bmo\bod\bde\be can be set to either e\bem\bma\bac\bcs\bs or
v\bvi\bi.
e\bem\bma\bac\bcs\bs-\b-m\bmo\bod\bde\be-\b-s\bst\btr\bri\bin\bng\bg (\b(@\b@)\b)
- If the _\bs_\bh_\bo_\bw_\b-_\bm_\bo_\bd_\be_\b-_\bi_\bn_\b-_\bp_\br_\bo_\bm_\bp_\bt variable is enabled, this string is
+ If the _\bs_\bh_\bo_\bw_\b-_\bm_\bo_\bd_\be_\b-_\bi_\bn_\b-_\bp_\br_\bo_\bm_\bp_\bt variable is enabled, this string is
displayed immediately before the last line of the primary prompt
when emacs editing mode is active. The value is expanded like a
- key binding, so the standard set of meta- and control prefixes
- and backslash escape sequences is available. Use the \1 and \2
- escapes to begin and end sequences of non-printing characters,
- which can be used to embed a terminal control sequence into the
+ key binding, so the standard set of meta- and control prefixes
+ and backslash escape sequences is available. Use the \1 and \2
+ escapes to begin and end sequences of non-printing characters,
+ which can be used to embed a terminal control sequence into the
mode string.
e\ben\bna\bab\bbl\ble\be-\b-a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn (\b(O\bOn\bn)\b)
- The _\bp_\bo_\bi_\bn_\bt is the current cursor position, and _\bm_\ba_\br_\bk refers to a
- saved cursor position. The text between the point and mark is
- referred to as the _\br_\be_\bg_\bi_\bo_\bn. When this variable is set to _\bO_\bn,
- readline allows certain commands to designate the region as _\ba_\bc_\b-
- _\bt_\bi_\bv_\be. When the region is active, readline highlights the text
- in the region using the value of the a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br,
- which defaults to the string that enables the terminal's stand-
- out mode. The active region shows the text inserted by brack-
- eted-paste and any matching text found by incremental and non-
+ The _\bp_\bo_\bi_\bn_\bt is the current cursor position, and _\bm_\ba_\br_\bk refers to a
+ saved cursor position. The text between the point and mark is
+ referred to as the _\br_\be_\bg_\bi_\bo_\bn. When this variable is set to _\bO_\bn,
+ readline allows certain commands to designate the region as _\ba_\bc_\b-
+ _\bt_\bi_\bv_\be. When the region is active, readline highlights the text
+ in the region using the value of the a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br,
+ which defaults to the string that enables the terminal's stand-
+ out mode. The active region shows the text inserted by brack-
+ eted-paste and any matching text found by incremental and non-
incremental history searches.
e\ben\bna\bab\bbl\ble\be-\b-b\bbr\bra\bac\bck\bke\bet\bte\bed\bd-\b-p\bpa\bas\bst\bte\be (\b(O\bOn\bn)\b)
- When set to O\bOn\bn, readline configures the terminal to insert each
- paste into the editing buffer as a single string of characters,
- instead of treating each character as if it had been read from
+ When set to O\bOn\bn, readline configures the terminal to insert each
+ paste into the editing buffer as a single string of characters,
+ instead of treating each character as if it had been read from
the keyboard. This prevents readline from executing any editing
commands bound to key sequences appearing in the pasted text.
e\ben\bna\bab\bbl\ble\be-\b-k\bke\bey\byp\bpa\bad\bd (\b(O\bOf\bff\bf)\b)
pad when it is called. Some systems need this to enable the ar-
row keys.
e\ben\bna\bab\bbl\ble\be-\b-m\bme\bet\bta\ba-\b-k\bke\bey\by (\b(O\bOn\bn)\b)
- When set to O\bOn\bn, 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.
+ When set to O\bOn\bn, 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;
+ this variable checks for the terminal capability that indicates
+ the terminal can enable and disable a mode that sets the eighth
+ bit of a character (0200) if the Meta key is held down when the
+ character is typed (a meta character).
+ f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx (\b(O\bOf\bff\bf)\b)
+ If set to O\bOn\bn, readline modifies its behavior when binding key
+ sequences containing \M- or Meta- (see K\bKe\bey\by B\bBi\bin\bnd\bdi\bin\bng\bgs\bs above) by
+ converting a key sequence of the form \M-_\bC or Meta-_\bC to the two-
+ character sequence E\bES\bSC\bC_\bC (adding the meta prefix). If
+ f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx is set to O\bOf\bff\bf (the default), readline uses the
+ value of the c\bco\bon\bnv\bve\ber\brt\bt-\b-m\bme\bet\bta\ba variable to determine whether to per-
+ form this conversion: if c\bco\bon\bnv\bve\ber\brt\bt-\b-m\bme\bet\bta\ba is O\bOn\bn, readline performs
+ the conversion described above; if it is O\bOf\bff\bf, Readline converts
+ _\bC to a meta character by setting the eighth bit (0200).
e\bex\bxp\bpa\ban\bnd\bd-\b-t\bti\bil\bld\bde\be (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, tilde expansion is performed when readline at-
+ If set to O\bOn\bn, tilde expansion is performed when readline at-
tempts word completion.
h\bhi\bis\bst\bto\bor\bry\by-\b-p\bpr\bre\bes\bse\ber\brv\bve\be-\b-p\bpo\boi\bin\bnt\bt (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, the history code attempts to place point at the
- same location on each history line retrieved with p\bpr\bre\bev\bvi\bio\bou\bus\bs-\b-h\bhi\bis\bs-\b-
+ If set to O\bOn\bn, the history code attempts to place point at the
+ same location on each history line retrieved with p\bpr\bre\bev\bvi\bio\bou\bus\bs-\b-h\bhi\bis\bs-\b-
t\bto\bor\bry\by or n\bne\bex\bxt\bt-\b-h\bhi\bis\bst\bto\bor\bry\by.
h\bhi\bis\bst\bto\bor\bry\by-\b-s\bsi\biz\bze\be (\b(u\bun\bns\bse\bet\bt)\b)
- Set the maximum number of history entries saved in the history
- list. If set to zero, any existing history entries are deleted
+ Set the maximum number of history entries saved in the history
+ list. If set to zero, any existing history entries are deleted
and no new entries are saved. If set to a value less than zero,
- the number of history entries is not limited. By default, the
- number of history entries is set to the value of the H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE
- shell variable. If an attempt is made to set _\bh_\bi_\bs_\bt_\bo_\br_\by_\b-_\bs_\bi_\bz_\be to a
+ the number of history entries is not limited. By default, the
+ number of history entries is set to the value of the H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE
+ shell variable. If an attempt is made to set _\bh_\bi_\bs_\bt_\bo_\br_\by_\b-_\bs_\bi_\bz_\be to a
non-numeric value, the maximum number of history entries will be
set to 500.
h\bho\bor\bri\biz\bzo\bon\bnt\bta\bal\bl-\b-s\bsc\bcr\bro\bol\bll\bl-\b-m\bmo\bod\bde\be (\b(O\bOf\bff\bf)\b)
- When set to O\bOn\bn, makes readline use a single line for display,
+ When set to O\bOn\bn, makes readline use a single line for display,
scrolling the input horizontally on a single screen line when it
- becomes longer than the screen width rather than wrapping to a
- new line. This setting is automatically enabled for terminals
+ becomes longer than the screen width rather than wrapping to a
+ new line. This setting is automatically enabled for terminals
of height 1.
i\bin\bnp\bpu\but\bt-\b-m\bme\bet\bta\ba (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, readline will enable eight-bit input (that is, it
+ If set to O\bOn\bn, readline will enable eight-bit input (that is, it
will not strip the eighth bit from the characters it reads), re-
- gardless of what the terminal claims it can support. The name
- m\bme\bet\bta\ba-\b-f\bfl\bla\bag\bg is a synonym for this variable. The default is _\bO_\bf_\bf,
- but readline will set it to _\bO_\bn if the locale contains eight-bit
- characters. This variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE locale
- category, and may change if the locale is changed.
+ gardless of what the terminal claims it can support. The name
+ m\bme\bet\bta\ba-\b-f\bfl\bla\bag\bg is a synonym for this variable. The default is _\bO_\bf_\bf,
+ but readline will set it to _\bO_\bn if the locale contains characters
+ whose encodings may include bytes with the eighth bit set. This
+ variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE locale category, and may
+ change if the locale is changed.
i\bis\bse\bea\bar\brc\bch\bh-\b-t\bte\ber\brm\bmi\bin\bna\bat\bto\bor\brs\bs (\b("C\bC-\b-[\b[C\bC-\b-J\bJ")\b)
The string of characters that should terminate an incremental
search without subsequently executing the character as a com-
If set to O\bOn\bn, readline will display characters with the eighth
bit set directly rather than as a meta-prefixed escape sequence.
The default is _\bO_\bf_\bf, but readline will set it to _\bO_\bn if the locale
- contains eight-bit characters. This variable is dependent on
- the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE locale category, and may change if the locale is
- changed.
+ contains characters whose encodings may include bytes with the
+ eighth bit set. This variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE lo-
+ cale category, and may change if the locale is changed.
p\bpa\bag\bge\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs (\b(O\bOn\bn)\b)
If set to O\bOn\bn, readline uses an internal _\bm_\bo_\br_\be-like pager to dis-
play a screenful of possible completions at a time.
There may be only one active coprocess at a time.
-GNU Bash 5.3 2024 August 16 _\bB_\bA_\bS_\bH(1)
+GNU Bash 5.3 2024 September 5 _\bB_\bA_\bS_\bH(1)
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
-.\" Last Change: Fri Aug 23 09:09:35 EDT 2024
+.\" Last Change: Thu Sep 5 15:41:56 EDT 2024
.\"
.\" bash_builtins, strip all but Built-Ins section
.\" avoid a warning about an undefined register
.\" .if !rzY .nr zY 0
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
-.TH BASH 1 "2024 August 23" "GNU Bash 5.3"
+.TH BASH 1 "2024 September 5" "GNU Bash 5.3"
.\"
.ie \n(.g \{\
.ds ' \(aq
Expands to the number of positional parameters in decimal.
.TP
.B ?
-Expands to the exit status of the most recently executed foreground
-command.
+Expands to the exit status of the most recently executed command.
.TP
.B \-
Expands to the current option flags as specified upon invocation,
.B bash
waits until it is about to print a prompt before reporting
changes in a job's status so as to not interrupt
-any other output. If the
+any other output,
+though it will notify of changes in a job's status after a command in
+a list completes, before executing the next command.
+If the
.B \-b
option to the
.B set
This is bash.info, produced by makeinfo version 7.1 from bashref.texi.
This text is a brief description of the features that are present in the
-Bash shell (version 5.3, 16 August 2024).
+Bash shell (version 5.3, 5 September 2024).
- This is Edition 5.3, last updated 16 August 2024, of ‘The GNU Bash
+ This is Edition 5.3, last updated 5 September 2024, of ‘The GNU Bash
Reference Manual’, for ‘Bash’, Version 5.3.
Copyright © 1988-2023 Free Software Foundation, Inc.
*************
This text is a brief description of the features that are present in the
-Bash shell (version 5.3, 16 August 2024). The Bash home page is
+Bash shell (version 5.3, 5 September 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
- This is Edition 5.3, last updated 16 August 2024, of ‘The GNU Bash
+ This is Edition 5.3, last updated 5 September 2024, of ‘The GNU Bash
Reference Manual’, for ‘Bash’, Version 5.3.
Bash contains features that appear in other popular shells, and some
Each clause must be terminated with ‘;;’, ‘;&’, or ‘;;&’. The WORD
undergoes tilde expansion, parameter expansion, command
- substitution, arithmetic expansion, and quote removal (*note Shell
- Parameter Expansion::) before matching is attempted. Each PATTERN
- undergoes tilde expansion, parameter expansion, command
- substitution, arithmetic expansion, process substitution, and quote
- removal.
+ substitution, process substitution, arithmetic expansion, and quote
+ removal (*note Shell Parameter Expansion::) before the shell
+ attempts to match the pattern. Each PATTERN undergoes tilde
+ expansion, parameter expansion, command substitution, arithmetic
+ expansion, process substitution, and quote removal.
There may be an arbitrary number of ‘case’ clauses, each terminated
by a ‘;;’, ‘;&’, or ‘;;&’. The first pattern that matches
‘*’
($*) Expands to the positional parameters, starting from one. When
the expansion is not within double quotes, each positional
- parameter expands to a separate word. In contexts where it is
- performed, those words are subject to further word splitting and
- filename expansion. When the expansion occurs within double
- quotes, it expands to a single word with the value of each
+ parameter expands to a separate word. In contexts where these
+ expansions are performed, those words are subject to further word
+ splitting and filename expansion. When the expansion occurs within
+ double quotes, it expands to a single word with the value of each
parameter separated by the first character of the ‘IFS’ special
variable. That is, ‘"$*"’ is equivalent to ‘"$1C$2C..."’, where C
is the first character of the value of the ‘IFS’ variable. If
‘?’
($?) Expands to the exit status of the most recently executed
- foreground command.
+ command.
‘-’
($-, a hyphen.) Expands to the current option flags as specified
is stopped is 'Stopped(SIGNAME)', where SIGNAME is, for example,
‘SIGTSTP’.
- 6. Alias expansion is always enabled, even in non-interactive shells.
+ 6. If the shell is interactive, Bash does not perform job
+ notifications between executing commands in lists separated by ‘;’
+ or newline. Non-interactive shells print status messages after a
+ foreground job in a list completes.
+
+ 7. If the shell is interactive, Bash waits until the next prompt
+ before printing the status of a background job that changes status
+ or a foreground job that terminates due to a signal.
+ Non-interactive shells print status messages after a foreground job
+ completes.
- 7. Reserved words appearing in a context where reserved words are
+ 8. Alias expansion is always enabled, even in non-interactive shells.
+
+ 9. Reserved words appearing in a context where reserved words are
recognized do not undergo alias expansion.
- 8. Alias expansion is performed when initially parsing a command
+ 10. Alias expansion is performed when initially parsing a command
substitution. The default mode generally defers it, when enabled,
until the command substitution is executed. This means that
command substitution will not expand aliases that are defined after
the command substitution is initially parsed (e.g., as part of a
function definition).
- 9. The POSIX ‘PS1’ and ‘PS2’ expansions of ‘!’ to the history number
+ 11. The POSIX ‘PS1’ and ‘PS2’ expansions of ‘!’ to the history number
and ‘!!’ to ‘!’ are enabled, and parameter expansion is performed
on the values of ‘PS1’ and ‘PS2’ regardless of the setting of the
‘promptvars’ option.
- 10. The POSIX startup files are executed (‘$ENV’) rather than the
+ 12. The POSIX startup files are executed (‘$ENV’) rather than the
normal Bash files.
- 11. Tilde expansion is only performed on assignments preceding a
+ 13. Tilde expansion is only performed on assignments preceding a
command name, rather than on all assignment statements on the line.
- 12. The default history file is ‘~/.sh_history’ (this is the default
+ 14. The default history file is ‘~/.sh_history’ (this is the default
value the shell assigns to ‘$HISTFILE’).
- 13. Redirection operators do not perform filename expansion on the
+ 15. Redirection operators do not perform filename expansion on the
word in the redirection unless the shell is interactive.
- 14. Redirection operators do not perform word splitting on the word in
+ 16. Redirection operators do not perform word splitting on the word in
the redirection.
- 15. Function names must be valid shell ‘name’s. That is, they may not
+ 17. Function names must be valid shell ‘name’s. That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit. Declaring a function with an invalid
name causes a fatal syntax error in non-interactive shells.
- 16. Function names may not be the same as one of the POSIX special
+ 18. Function names may not be the same as one of the POSIX special
builtins.
- 17. Even if a shell function whose name contains a slash was defined
+ 19. Even if a shell function whose name contains a slash was defined
before entering POSIX mode, the shell will not execute a function
whose name contains one or more slashes.
- 18. POSIX special builtins are found before shell functions during
+ 20. POSIX special builtins are found before shell functions during
command lookup, including output printed by the ‘type’ and
‘command’ builtins.
- 19. When printing shell function definitions (e.g., by ‘type’), Bash
+ 21. When printing shell function definitions (e.g., by ‘type’), Bash
does not print the ‘function’ keyword.
- 20. Literal tildes that appear as the first character in elements of
+ 22. Literal tildes that appear as the first character in elements of
the ‘PATH’ variable are not expanded as described above under *note
Tilde Expansion::.
- 21. The ‘time’ reserved word may be used by itself as a command. When
+ 23. The ‘time’ reserved word may be used by itself as a command. When
used in this way, it displays timing statistics for the shell and
its completed children. The ‘TIMEFORMAT’ variable controls the
format of the timing information.
- 22. When parsing and expanding a ${...} expansion that appears within
+ 24. When parsing and expanding a ${...} expansion that appears within
double quotes, single quotes are no longer special and cannot be
used to quote a closing brace or other special character, unless
the operator is one of those defined to perform pattern removal.
In this case, they do not have to appear as matched pairs.
- 23. The parser does not recognize ‘time’ as a reserved word if the
+ 25. The parser does not recognize ‘time’ as a reserved word if the
next token begins with a ‘-’.
- 24. The ‘!’ character does not introduce history expansion within a
+ 26. The ‘!’ character does not introduce history expansion within a
double-quoted string, even if the ‘histexpand’ option is enabled.
- 25. If a POSIX special builtin returns an error status, a
+ 27. If a POSIX special builtin returns an error status, a
non-interactive shell exits. The fatal errors are those listed in
the POSIX standard, and include things like passing incorrect
options, redirection errors, variable assignment errors for
assignments preceding the command name, and so on.
- 26. The ‘unset’ builtin with the ‘-v’ option specified returns a fatal
+ 28. The ‘unset’ builtin with the ‘-v’ option specified returns a fatal
error if it attempts to unset a ‘readonly’ or ‘non-unsettable’
variable, or encounters a variable name argument that is an invalid
identifier, which causes a non-interactive shell to exit.
- 27. When asked to unset a variable that appears in an assignment
+ 29. When asked to unset a variable that appears in an assignment
statement preceding the command, the ‘unset’ builtin attempts to
unset a variable of the same name in the current or previous scope
as well. This implements the required "if an assigned variable is
further modified by the utility, the modifications made by the
utility shall persist" behavior.
- 28. A non-interactive shell exits with an error status if a variable
+ 30. A non-interactive shell exits with an error status if a variable
assignment error occurs when no command name follows the assignment
statements. A variable assignment error occurs, for example, when
trying to assign a value to a readonly variable.
- 29. A non-interactive shell exits with an error status if a variable
+ 31. A non-interactive shell exits with an error status if a variable
assignment error occurs in an assignment statement preceding a
special builtin, but not with any other simple command. For any
other simple command, the shell aborts execution of that command,
perform any further processing of the command in which the error
occurred").
- 30. A non-interactive shell exits with an error status if the
+ 32. A non-interactive shell exits with an error status if the
iteration variable in a ‘for’ statement or the selection variable
in a ‘select’ statement is a readonly variable or has an invalid
name.
- 31. Non-interactive shells exit if FILENAME in ‘.’ FILENAME is not
+ 33. Non-interactive shells exit if FILENAME in ‘.’ FILENAME is not
found.
- 32. Non-interactive shells exit if a syntax error in an arithmetic
+ 34. Non-interactive shells exit if a syntax error in an arithmetic
expansion results in an invalid expression.
- 33. Non-interactive shells exit if a parameter expansion error occurs.
+ 35. Non-interactive shells exit if a parameter expansion error occurs.
- 34. Non-interactive shells exit if there is a syntax error in a script
+ 36. Non-interactive shells exit if there is a syntax error in a script
read with the ‘.’ or ‘source’ builtins, or in a string processed by
the ‘eval’ builtin.
- 35. While variable indirection is available, it may not be applied to
+ 37. While variable indirection is available, it may not be applied to
the ‘#’ and ‘?’ special parameters.
- 36. Expanding the ‘*’ special parameter in a pattern context where the
+ 38. Expanding the ‘*’ special parameter in a pattern context where the
expansion is double-quoted does not treat the ‘$*’ as if it were
double-quoted.
- 37. Assignment statements preceding POSIX special builtins persist in
+ 39. Assignment statements preceding POSIX special builtins persist in
the shell environment after the builtin completes.
- 38. The ‘command’ builtin does not prevent builtins that take
+ 40. The ‘command’ builtin does not prevent builtins that take
assignment statements as arguments from expanding them as
assignment statements; when not in POSIX mode, assignment builtins
lose their assignment statement expansion properties when preceded
by ‘command’.
- 39. The ‘bg’ builtin uses the required format to describe each job
+ 41. The ‘bg’ builtin uses the required format to describe each job
placed in the background, which does not include an indication of
whether the job is the current or previous job.
- 40. The output of ‘kill -l’ prints all the signal names on a single
+ 42. The output of ‘kill -l’ prints all the signal names on a single
line, separated by spaces, without the ‘SIG’ prefix.
- 41. The ‘kill’ builtin does not accept signal names with a ‘SIG’
+ 43. The ‘kill’ builtin does not accept signal names with a ‘SIG’
prefix.
- 42. The ‘export’ and ‘readonly’ builtin commands display their output
+ 44. The ‘export’ and ‘readonly’ builtin commands display their output
in the format required by POSIX.
- 43. If the ‘export’ and ‘readonly’ builtin commands get an argument
+ 45. If the ‘export’ and ‘readonly’ builtin commands get an argument
that is not a valid identifier, and they are not operating on shell
functions, they return an error. This will cause a non-interactive
shell to exit because these are special builtins.
- 44. The ‘trap’ builtin displays signal names without the leading
+ 46. The ‘trap’ builtin displays signal names without the leading
‘SIG’.
- 45. The ‘trap’ builtin doesn't check the first argument for a possible
+ 47. The ‘trap’ builtin doesn't check the first argument for a possible
signal specification and revert the signal handling to the original
disposition if it is, unless that argument consists solely of
digits and is a valid signal number. If users want to reset the
handler for a given signal to the original disposition, they should
use ‘-’ as the first argument.
- 46. ‘trap -p’ without arguments displays signals whose dispositions
+ 48. ‘trap -p’ without arguments displays signals whose dispositions
are set to SIG_DFL and those that were ignored when the shell
started, not just trapped signals.
- 47. The ‘.’ and ‘source’ builtins do not search the current directory
+ 49. The ‘.’ and ‘source’ builtins do not search the current directory
for the filename argument if it is not found by searching ‘PATH’.
- 48. Enabling POSIX mode has the effect of setting the
+ 50. Enabling POSIX mode has the effect of setting the
‘inherit_errexit’ option, so subshells spawned to execute command
substitutions inherit the value of the ‘-e’ option from the parent
shell. When the ‘inherit_errexit’ option is not enabled, Bash
clears the ‘-e’ option in such subshells.
- 49. Enabling POSIX mode has the effect of setting the ‘shift_verbose’
+ 51. Enabling POSIX mode has the effect of setting the ‘shift_verbose’
option, so numeric arguments to ‘shift’ that exceed the number of
positional parameters will result in an error message.
- 50. When the ‘alias’ builtin displays alias definitions, it does not
+ 52. When the ‘alias’ builtin displays alias definitions, it does not
display them with a leading ‘alias ’ unless the ‘-p’ option is
supplied.
- 51. When the ‘set’ builtin is invoked without options, it does not
+ 53. When the ‘set’ builtin is invoked without options, it does not
display shell function names and definitions.
- 52. When the ‘set’ builtin is invoked without options, it displays
+ 54. When the ‘set’ builtin is invoked without options, it displays
variable values without quotes, unless they contain shell
metacharacters, even if the result contains nonprinting characters.
- 53. When the ‘cd’ builtin is invoked in logical mode, and the pathname
+ 55. When the ‘cd’ builtin is invoked in logical mode, and the pathname
constructed from ‘$PWD’ and the directory name supplied as an
argument does not refer to an existing directory, ‘cd’ will fail
instead of falling back to physical mode.
- 54. When the ‘cd’ builtin cannot change a directory because the length
+ 56. When the ‘cd’ builtin cannot change a directory because the length
of the pathname constructed from ‘$PWD’ and the directory name
supplied as an argument exceeds ‘PATH_MAX’ when canonicalized, ‘cd’
will attempt to use the supplied directory name.
- 55. The ‘pwd’ builtin verifies that the value it prints is the same as
+ 57. The ‘pwd’ builtin verifies that the value it prints is the same as
the current directory, even if it is not asked to check the file
system with the ‘-P’ option.
- 56. When listing the history, the ‘fc’ builtin does not include an
+ 58. When listing the history, the ‘fc’ builtin does not include an
indication of whether or not a history entry has been modified.
- 57. The default editor used by ‘fc’ is ‘ed’.
+ 59. The default editor used by ‘fc’ is ‘ed’.
- 58. ‘fc’ treats extra arguments as an error instead of ignoring them.
+ 60. ‘fc’ treats extra arguments as an error instead of ignoring them.
- 59. If there are too many arguments supplied to ‘fc -s’, ‘fc’ prints
+ 61. If there are too many arguments supplied to ‘fc -s’, ‘fc’ prints
an error message and returns failure.
- 60. The ‘type’ and ‘command’ builtins will not report a non-executable
+ 62. The ‘type’ and ‘command’ builtins will not report a non-executable
file as having been found, though the shell will attempt to execute
such a file if it is the only so-named file found in ‘$PATH’.
- 61. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when
+ 63. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when
the ‘v’ command is run, instead of checking ‘$VISUAL’ and
‘$EDITOR’.
- 62. When the ‘xpg_echo’ option is enabled, Bash does not attempt to
+ 64. When the ‘xpg_echo’ option is enabled, Bash does not attempt to
interpret any arguments to ‘echo’ as options. Each argument is
displayed, after escape characters are converted.
- 63. The ‘ulimit’ builtin uses a block size of 512 bytes for the ‘-c’
+ 65. The ‘ulimit’ builtin uses a block size of 512 bytes for the ‘-c’
and ‘-f’ options.
- 64. The arrival of ‘SIGCHLD’ when a trap is set on ‘SIGCHLD’ does not
+ 66. The arrival of ‘SIGCHLD’ when a trap is set on ‘SIGCHLD’ does not
interrupt the ‘wait’ builtin and cause it to return immediately.
The trap command is run once for each child that exits.
- 65. The ‘read’ builtin may be interrupted by a signal for which a trap
+ 67. The ‘read’ builtin may be interrupted by a signal for which a trap
has been set. If Bash receives a trapped signal while executing
‘read’, the trap handler executes and ‘read’ returns an exit status
greater than 128.
- 66. The ‘printf’ builtin uses ‘double’ (via ‘strtod’) to convert
+ 68. The ‘printf’ builtin uses ‘double’ (via ‘strtod’) to convert
arguments corresponding to floating point conversion specifiers,
instead of ‘long double’ if it's available. The ‘L’ length
modifier forces ‘printf’ to use ‘long double’ if it's available.
- 67. Bash removes an exited background process's status from the list
+ 69. Bash removes an exited background process's status from the list
of such statuses after the ‘wait’ builtin is used to obtain it.
- 68. A double quote character (‘"’) is treated specially when it
+ 70. A double quote character (‘"’) is treated specially when it
appears in a backquoted command substitution in the body of a
here-document that undergoes expansion. That means, for example,
that a backslash preceding a double quote character will escape it
and the backslash will be removed.
- 69. The ‘test’ builtin compares strings using the current locale when
+ 71. The ‘test’ builtin compares strings using the current locale when
processing the ‘<’ and ‘>’ binary operators.
- 70. The ‘test’ builtin's ‘-t’ unary primary requires an argument.
+ 72. The ‘test’ builtin's ‘-t’ unary primary requires an argument.
Historical versions of ‘test’ made the argument optional in certain
cases, and Bash attempts to accommodate those for backwards
compatibility.
- 71. Command substitutions don't set the ‘?’ special parameter. The
+ 73. Command substitutions don't set the ‘?’ special parameter. The
exit status of a simple command without a command word is still the
exit status of the last command substitution that occurred while
evaluating the variable assignments and redirections in that
as bindable command names, and displays any key sequences
bound to those commands, instead of treating the arguments as
key sequences to bind.
+ • Interactive shells will notify the user of completed jobs
+ while sourcing a script. Newer versions defer notification
+ until script execution completes.
\1f
File: bash.info, Node: Job Control, Next: Command Line Editing, Prev: Bash Features, Up: Top
The shell learns immediately whenever a job changes state. Normally,
Bash waits until it is about to print a prompt before reporting changes
-in a job's status so as to not interrupt any other output. If the ‘-b’
-option to the ‘set’ builtin is enabled, Bash reports such changes
-immediately (*note The Set Builtin::). Any trap on ‘SIGCHLD’ is
-executed for each child process that exits.
+in a job's status so as to not interrupt any other output, though it
+will notify of changes in a job's status after a command in a list
+completes, before executing the next command. If the ‘-b’ option to the
+‘set’ builtin is enabled, Bash reports such changes immediately (*note
+The Set Builtin::). Any trap on ‘SIGCHLD’ is executed for each child
+process that exits.
If an attempt to exit Bash is made while jobs are stopped, (or
running, if the ‘checkjobs’ option is enabled - see *note The Shopt
The text ‘M-k’ is read as 'Meta-K' and describes the character
produced when the Meta key (if you have one) is depressed, and the <k>
-key is pressed. The Meta key is labeled <ALT> on many keyboards. On
-keyboards with two keys labeled <ALT> (usually to either side of the
-space bar), the <ALT> on the left side is generally set to work as a
-Meta key. The <ALT> key on the right may also be configured to work as
-a Meta key or may be configured as some other modifier, such as a
-Compose key for typing accented characters.
+key is pressed (a “meta character”). The Meta key is labeled <ALT> on
+many keyboards. On keyboards with two keys labeled <ALT> (usually to
+either side of the space bar), the <ALT> on the left side is generally
+set to work as a Meta key. The <ALT> key on the right may also be
+configured to work as a Meta key or may be configured as some other
+modifier, such as a Compose key for typing accented characters.
+
+ On some keyboards, the Meta key modifier produces meta characters
+with the eighth bit (0200) set (you can use the ‘enable-meta-key’
+variable to control whether or not it does this, if the keyboard allows
+it). On many others, the terminal or terminal emulator converts the
+metafied key to a key sequence beginning with <ESC> as described in the
+next paragraph.
If you do not have a Meta or <ALT> key, or another key working as a
-Meta key, the identical keystroke can be generated by typing <ESC>
-_first_, and then typing <k>. Either process is known as “metafying”
-the <k> key.
+Meta key, you can generally achieve the latter effect by typing <ESC>
+_first_, and then typing <k>. The <ESC> character is known as the “meta
+prefix”).
+
+ Either process is known as “metafying” the <k> key.
The text ‘M-C-k’ is read as 'Meta-Control-k' and describes the
-character produced by “metafying” ‘C-k’.
+character produced by metafying ‘C-k’.
In addition, several keys have their own names. Specifically, <DEL>,
<ESC>, <LFD>, <SPC>, <RET>, and <TAB> all stand for themselves when seen
limit is ‘100’.
‘convert-meta’
- If set to ‘on’, Readline will convert characters with the
- eighth bit set to an ASCII key sequence by stripping the
+ If set to ‘on’, Readline will convert characters it reads with
+ the eighth bit set to an ASCII key sequence by stripping the
eighth bit and prefixing an <ESC> character, converting them
to a meta-prefixed key sequence. The default value is ‘on’,
- but will be set to ‘off’ if the locale is one that contains
- eight-bit characters. This variable is dependent on the
- ‘LC_CTYPE’ locale category, and may change if the locale is
- changed.
+ but Readline will set it to ‘off’ if the locale contains
+ characters whose encodings may include bytes with the eighth
+ bit set. This variable is dependent on the ‘LC_CTYPE’ locale
+ category, and may change if the locale is changed. This
+ variable also affects key bindings; see the description of
+ ‘force-meta-prefix’ below.
‘disable-completion’
If set to ‘On’, Readline will inhibit word completion.
‘enable-meta-key’
When set to ‘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 ‘on’.
+ On many terminals, the Meta key is used to send eight-bit
+ characters; this variable checks for the terminal capability
+ that indicates the terminal can enable and disable a mode that
+ sets the eighth bit of a character (0200) if the Meta key is
+ held down when the character is typed (a meta character). The
+ default is ‘on’.
‘expand-tilde’
If set to ‘on’, tilde expansion is performed when Readline
attempts word completion. The default is ‘off’.
+ ‘force-meta-prefix’
+ If set to ‘on’, Readline modifies its behavior when binding
+ key sequences containing ‘\M-’ or ‘Meta-’ (see ‘Key Bindings’
+ in *note Readline Init File Syntax::) by converting a key
+ sequence of the form ‘\M-’C or ‘Meta-’C to the two-character
+ sequence ‘ESC’C (adding the meta prefix). If
+ ‘force-meta-prefix’ is set to ‘off’ (the default), Readline
+ uses the value of the ‘convert-meta’ variable to determine
+ whether to perform this conversion: if ‘convert-meta’ is ‘on’,
+ Readline performs the conversion described above; if it is
+ ‘off’, Readline converts C to a meta character by setting the
+ eighth bit (0200). The default is ‘off’.
+
‘history-preserve-point’
If set to ‘on’, the history code attempts to place the point
(the current cursor position) at the same location on each
not clear the eighth bit in the characters it reads),
regardless of what the terminal claims it can support. The
default value is ‘off’, but Readline will set it to ‘on’ if
- the locale contains eight-bit characters. The name
- ‘meta-flag’ is a synonym for this variable. This variable is
- dependent on the ‘LC_CTYPE’ locale category, and may change if
- the locale is changed.
+ the locale contains characters whose encodings may include
+ bytes with the eighth bit set. The name ‘meta-flag’ is a
+ synonym for this variable. This variable is dependent on the
+ ‘LC_CTYPE’ locale category, and may change if the locale is
+ changed.
‘isearch-terminators’
The string of characters that should terminate an incremental
If set to ‘on’, Readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
sequence. The default is ‘off’, but Readline will set it to
- ‘on’ if the locale contains eight-bit characters. This
- variable is dependent on the ‘LC_CTYPE’ locale category, and
- may change if the locale is changed.
+ ‘on’ if the locale contains characters whose encodings may
+ include bytes with the eighth bit set. This variable is
+ dependent on the ‘LC_CTYPE’ locale category, and may change if
+ the locale is changed.
‘page-completions’
If set to ‘on’, Readline uses an internal ‘more’-like pager to
‘\C-’
control prefix
‘\M-’
- meta prefix
+ adding the meta prefix or converting the following character
+ to a meta character, as described above under
+ ‘force-meta-prefix’ (see ‘Variable Settings’ in *note Readline
+ Init File Syntax::).
‘\e’
an escape character
‘\\’
* COPROC: Bash Variables. (line 278)
* DIRSTACK: Bash Variables. (line 282)
* disable-completion: Readline Init File Syntax.
- (line 151)
+ (line 153)
* echo-control-characters: Readline Init File Syntax.
- (line 156)
+ (line 158)
* editing-mode: Readline Init File Syntax.
- (line 161)
+ (line 163)
* EMACS: Bash Variables. (line 292)
* emacs-mode-string: Readline Init File Syntax.
- (line 167)
+ (line 169)
* enable-active-region: Readline Init File Syntax.
- (line 177)
+ (line 179)
* enable-bracketed-paste: Readline Init File Syntax.
- (line 190)
+ (line 192)
* enable-keypad: Readline Init File Syntax.
- (line 199)
+ (line 201)
* ENV: Bash Variables. (line 297)
* EPOCHREALTIME: Bash Variables. (line 302)
* EPOCHSECONDS: Bash Variables. (line 310)
* EUID: Bash Variables. (line 317)
* EXECIGNORE: Bash Variables. (line 321)
* expand-tilde: Readline Init File Syntax.
- (line 210)
+ (line 216)
* FCEDIT: Bash Variables. (line 334)
* FIGNORE: Bash Variables. (line 338)
+* force-meta-prefix: Readline Init File Syntax.
+ (line 220)
* FUNCNAME: Bash Variables. (line 344)
* FUNCNEST: Bash Variables. (line 361)
* GLOBIGNORE: Bash Variables. (line 366)
* HISTFILESIZE: Bash Variables. (line 456)
* HISTIGNORE: Bash Variables. (line 467)
* history-preserve-point: Readline Init File Syntax.
- (line 214)
+ (line 233)
* history-size: Readline Init File Syntax.
- (line 220)
+ (line 239)
* HISTSIZE: Bash Variables. (line 489)
* HISTTIMEFORMAT: Bash Variables. (line 496)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
- (line 229)
+ (line 248)
* HOSTFILE: Bash Variables. (line 505)
* HOSTNAME: Bash Variables. (line 516)
* HOSTTYPE: Bash Variables. (line 519)
(line 18)
* IGNOREEOF: Bash Variables. (line 522)
* input-meta: Readline Init File Syntax.
- (line 238)
+ (line 257)
* INPUTRC: Bash Variables. (line 532)
* INSIDE_EMACS: Bash Variables. (line 536)
* isearch-terminators: Readline Init File Syntax.
- (line 248)
+ (line 268)
* keymap: Readline Init File Syntax.
- (line 255)
+ (line 275)
* LANG: Creating Internationalized Scripts.
(line 51)
* LANG <1>: Bash Variables. (line 542)
(line 27)
* MAPFILE: Bash Variables. (line 597)
* mark-modified-lines: Readline Init File Syntax.
- (line 285)
+ (line 305)
* mark-symlinked-directories: Readline Init File Syntax.
- (line 290)
+ (line 310)
* match-hidden-files: Readline Init File Syntax.
- (line 295)
+ (line 315)
* menu-complete-display-prefix: Readline Init File Syntax.
- (line 302)
+ (line 322)
* meta-flag: Readline Init File Syntax.
- (line 238)
+ (line 257)
* OLDPWD: Bash Variables. (line 601)
* OPTARG: Bourne Shell Variables.
(line 34)
(line 38)
* OSTYPE: Bash Variables. (line 608)
* output-meta: Readline Init File Syntax.
- (line 307)
+ (line 327)
* page-completions: Readline Init File Syntax.
- (line 315)
+ (line 336)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 611)
* READLINE_POINT: Bash Variables. (line 684)
* REPLY: Bash Variables. (line 688)
* revert-all-at-newline: Readline Init File Syntax.
- (line 325)
+ (line 346)
* search-ignore-case: Readline Init File Syntax.
- (line 332)
+ (line 353)
* SECONDS: Bash Variables. (line 691)
* SHELL: Bash Variables. (line 701)
* SHELLOPTS: Bash Variables. (line 706)
* SHLVL: Bash Variables. (line 715)
* show-all-if-ambiguous: Readline Init File Syntax.
- (line 337)
+ (line 358)
* show-all-if-unmodified: Readline Init File Syntax.
- (line 343)
+ (line 364)
* show-mode-in-prompt: Readline Init File Syntax.
- (line 352)
+ (line 373)
* skip-completed-text: Readline Init File Syntax.
- (line 358)
+ (line 379)
* SRANDOM: Bash Variables. (line 720)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TMPDIR: Bash Variables. (line 779)
* UID: Bash Variables. (line 783)
* vi-cmd-mode-string: Readline Init File Syntax.
- (line 371)
+ (line 392)
* vi-ins-mode-string: Readline Init File Syntax.
- (line 382)
+ (line 403)
* visible-stats: Readline Init File Syntax.
- (line 393)
+ (line 414)
\1f
File: bash.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Indexes
\1f
Tag Table:
-Node: Top\7f897
-Node: Introduction\7f2834
-Node: What is Bash?\7f3047
-Node: What is a shell?\7f4188
-Node: Definitions\7f6767
-Node: Basic Shell Features\7f9943
-Node: Shell Syntax\7f11163
-Node: Shell Operation\7f12190
-Node: Quoting\7f13488
-Node: Escape Character\7f14801
-Node: Single Quotes\7f15299
-Node: Double Quotes\7f15648
-Node: ANSI-C Quoting\7f16991
-Node: Locale Translation\7f18376
-Node: Creating Internationalized Scripts\7f19720
-Node: Comments\7f23918
-Node: Shell Commands\7f24553
-Node: Reserved Words\7f25492
-Node: Simple Commands\7f26357
-Node: Pipelines\7f27016
-Node: Lists\7f30079
-Node: Compound Commands\7f31951
-Node: Looping Constructs\7f32960
-Node: Conditional Constructs\7f35504
-Node: Command Grouping\7f50325
-Node: Coprocesses\7f51812
-Node: GNU Parallel\7f54508
-Node: Shell Functions\7f55426
-Node: Shell Parameters\7f63532
-Node: Positional Parameters\7f68065
-Node: Special Parameters\7f69000
-Node: Shell Expansions\7f72306
-Node: Brace Expansion\7f74495
-Node: Tilde Expansion\7f77158
-Node: Shell Parameter Expansion\7f79924
-Node: Command Substitution\7f99031
-Node: Arithmetic Expansion\7f102564
-Node: Process Substitution\7f103529
-Node: Word Splitting\7f104666
-Node: Filename Expansion\7f106807
-Node: Pattern Matching\7f109903
-Node: Quote Removal\7f115136
-Node: Redirections\7f115440
-Node: Executing Commands\7f125249
-Node: Simple Command Expansion\7f125916
-Node: Command Search and Execution\7f128027
-Node: Command Execution Environment\7f130435
-Node: Environment\7f133744
-Node: Exit Status\7f135448
-Node: Signals\7f137233
-Node: Shell Scripts\7f140847
-Node: Shell Builtin Commands\7f143939
-Node: Bourne Shell Builtins\7f146050
-Node: Bash Builtins\7f170820
-Node: Modifying Shell Behavior\7f205919
-Node: The Set Builtin\7f206261
-Node: The Shopt Builtin\7f217844
-Node: Special Builtins\7f234806
-Node: Shell Variables\7f235795
-Node: Bourne Shell Variables\7f236229
-Node: Bash Variables\7f238422
-Node: Bash Features\7f275617
-Node: Invoking Bash\7f276631
-Node: Bash Startup Files\7f283030
-Node: Interactive Shells\7f288333
-Node: What is an Interactive Shell?\7f288741
-Node: Is this Shell Interactive?\7f289407
-Node: Interactive Shell Behavior\7f290231
-Node: Bash Conditional Expressions\7f293985
-Node: Shell Arithmetic\7f299159
-Node: Aliases\7f302241
-Node: Arrays\7f305196
-Node: The Directory Stack\7f311995
-Node: Directory Stack Builtins\7f312792
-Node: Controlling the Prompt\7f317241
-Node: The Restricted Shell\7f320379
-Node: Bash POSIX Mode\7f323166
-Node: Shell Compatibility Mode\7f340677
-Node: Job Control\7f349444
-Node: Job Control Basics\7f349901
-Node: Job Control Builtins\7f355075
-Node: Job Control Variables\7f361019
-Node: Command Line Editing\7f362196
-Node: Introduction and Notation\7f363900
-Node: Readline Interaction\7f365544
-Node: Readline Bare Essentials\7f366732
-Node: Readline Movement Commands\7f368550
-Node: Readline Killing Commands\7f369547
-Node: Readline Arguments\7f371525
-Node: Searching\7f372582
-Node: Readline Init File\7f374811
-Node: Readline Init File Syntax\7f376093
-Node: Conditional Init Constructs\7f401031
-Node: Sample Init File\7f405396
-Node: Bindable Readline Commands\7f408517
-Node: Commands For Moving\7f409742
-Node: Commands For History\7f411969
-Node: Commands For Text\7f417174
-Node: Commands For Killing\7f421308
-Node: Numeric Arguments\7f424109
-Node: Commands For Completion\7f425261
-Node: Keyboard Macros\7f429577
-Node: Miscellaneous Commands\7f430278
-Node: Readline vi Mode\7f436932
-Node: Programmable Completion\7f437884
-Node: Programmable Completion Builtins\7f445841
-Node: A Programmable Completion Example\7f457407
-Node: Using History Interactively\7f462752
-Node: Bash History Facilities\7f463433
-Node: Bash History Builtins\7f466545
-Node: History Interaction\7f471788
-Node: Event Designators\7f476113
-Node: Word Designators\7f477696
-Node: Modifiers\7f479848
-Node: Installing Bash\7f481757
-Node: Basic Installation\7f482891
-Node: Compilers and Options\7f486770
-Node: Compiling For Multiple Architectures\7f487520
-Node: Installation Names\7f489269
-Node: Specifying the System Type\7f491503
-Node: Sharing Defaults\7f492249
-Node: Operation Controls\7f492963
-Node: Optional Features\7f493982
-Node: Reporting Bugs\7f505784
-Node: Major Differences From The Bourne Shell\7f507133
-Node: GNU Free Documentation License\7f526868
-Node: Indexes\7f552045
-Node: Builtin Index\7f552496
-Node: Reserved Word Index\7f559594
-Node: Variable Index\7f562039
-Node: Function Index\7f579170
-Node: Concept Index\7f593026
+Node: Top\7f901
+Node: Introduction\7f2842
+Node: What is Bash?\7f3055
+Node: What is a shell?\7f4196
+Node: Definitions\7f6775
+Node: Basic Shell Features\7f9951
+Node: Shell Syntax\7f11171
+Node: Shell Operation\7f12198
+Node: Quoting\7f13496
+Node: Escape Character\7f14809
+Node: Single Quotes\7f15307
+Node: Double Quotes\7f15656
+Node: ANSI-C Quoting\7f16999
+Node: Locale Translation\7f18384
+Node: Creating Internationalized Scripts\7f19728
+Node: Comments\7f23926
+Node: Shell Commands\7f24561
+Node: Reserved Words\7f25500
+Node: Simple Commands\7f26365
+Node: Pipelines\7f27024
+Node: Lists\7f30087
+Node: Compound Commands\7f31959
+Node: Looping Constructs\7f32968
+Node: Conditional Constructs\7f35512
+Node: Command Grouping\7f50373
+Node: Coprocesses\7f51860
+Node: GNU Parallel\7f54556
+Node: Shell Functions\7f55474
+Node: Shell Parameters\7f63580
+Node: Positional Parameters\7f68113
+Node: Special Parameters\7f69048
+Node: Shell Expansions\7f72358
+Node: Brace Expansion\7f74547
+Node: Tilde Expansion\7f77210
+Node: Shell Parameter Expansion\7f79976
+Node: Command Substitution\7f99083
+Node: Arithmetic Expansion\7f102616
+Node: Process Substitution\7f103581
+Node: Word Splitting\7f104718
+Node: Filename Expansion\7f106859
+Node: Pattern Matching\7f109955
+Node: Quote Removal\7f115188
+Node: Redirections\7f115492
+Node: Executing Commands\7f125301
+Node: Simple Command Expansion\7f125968
+Node: Command Search and Execution\7f128079
+Node: Command Execution Environment\7f130487
+Node: Environment\7f133796
+Node: Exit Status\7f135500
+Node: Signals\7f137285
+Node: Shell Scripts\7f140899
+Node: Shell Builtin Commands\7f143991
+Node: Bourne Shell Builtins\7f146102
+Node: Bash Builtins\7f170872
+Node: Modifying Shell Behavior\7f205971
+Node: The Set Builtin\7f206313
+Node: The Shopt Builtin\7f217896
+Node: Special Builtins\7f234858
+Node: Shell Variables\7f235847
+Node: Bourne Shell Variables\7f236281
+Node: Bash Variables\7f238474
+Node: Bash Features\7f275669
+Node: Invoking Bash\7f276683
+Node: Bash Startup Files\7f283082
+Node: Interactive Shells\7f288385
+Node: What is an Interactive Shell?\7f288793
+Node: Is this Shell Interactive?\7f289459
+Node: Interactive Shell Behavior\7f290283
+Node: Bash Conditional Expressions\7f294037
+Node: Shell Arithmetic\7f299211
+Node: Aliases\7f302293
+Node: Arrays\7f305248
+Node: The Directory Stack\7f312047
+Node: Directory Stack Builtins\7f312844
+Node: Controlling the Prompt\7f317293
+Node: The Restricted Shell\7f320431
+Node: Bash POSIX Mode\7f323218
+Node: Shell Compatibility Mode\7f341267
+Node: Job Control\7f350218
+Node: Job Control Basics\7f350675
+Node: Job Control Builtins\7f355972
+Node: Job Control Variables\7f361916
+Node: Command Line Editing\7f363093
+Node: Introduction and Notation\7f364797
+Node: Readline Interaction\7f366892
+Node: Readline Bare Essentials\7f368080
+Node: Readline Movement Commands\7f369898
+Node: Readline Killing Commands\7f370895
+Node: Readline Arguments\7f372873
+Node: Searching\7f373930
+Node: Readline Init File\7f376159
+Node: Readline Init File Syntax\7f377441
+Node: Conditional Init Constructs\7f403981
+Node: Sample Init File\7f408346
+Node: Bindable Readline Commands\7f411467
+Node: Commands For Moving\7f412692
+Node: Commands For History\7f414919
+Node: Commands For Text\7f420124
+Node: Commands For Killing\7f424258
+Node: Numeric Arguments\7f427059
+Node: Commands For Completion\7f428211
+Node: Keyboard Macros\7f432527
+Node: Miscellaneous Commands\7f433228
+Node: Readline vi Mode\7f439882
+Node: Programmable Completion\7f440834
+Node: Programmable Completion Builtins\7f448791
+Node: A Programmable Completion Example\7f460357
+Node: Using History Interactively\7f465702
+Node: Bash History Facilities\7f466383
+Node: Bash History Builtins\7f469495
+Node: History Interaction\7f474738
+Node: Event Designators\7f479063
+Node: Word Designators\7f480646
+Node: Modifiers\7f482798
+Node: Installing Bash\7f484707
+Node: Basic Installation\7f485841
+Node: Compilers and Options\7f489720
+Node: Compiling For Multiple Architectures\7f490470
+Node: Installation Names\7f492219
+Node: Specifying the System Type\7f494453
+Node: Sharing Defaults\7f495199
+Node: Operation Controls\7f495913
+Node: Optional Features\7f496932
+Node: Reporting Bugs\7f508734
+Node: Major Differences From The Bourne Shell\7f510083
+Node: GNU Free Documentation License\7f529818
+Node: Indexes\7f554995
+Node: Builtin Index\7f555446
+Node: Reserved Word Index\7f562544
+Node: Variable Index\7f564989
+Node: Function Index\7f582261
+Node: Concept Index\7f596117
\1f
End Tag Table
bashref.texi.
This text is a brief description of the features that are present in the
-Bash shell (version 5.3, 16 August 2024).
+Bash shell (version 5.3, 5 September 2024).
- This is Edition 5.3, last updated 16 August 2024, of ‘The GNU Bash
+ This is Edition 5.3, last updated 5 September 2024, of ‘The GNU Bash
Reference Manual’, for ‘Bash’, Version 5.3.
Copyright © 1988-2023 Free Software Foundation, Inc.
*************
This text is a brief description of the features that are present in the
-Bash shell (version 5.3, 16 August 2024). The Bash home page is
+Bash shell (version 5.3, 5 September 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
- This is Edition 5.3, last updated 16 August 2024, of ‘The GNU Bash
+ This is Edition 5.3, last updated 5 September 2024, of ‘The GNU Bash
Reference Manual’, for ‘Bash’, Version 5.3.
Bash contains features that appear in other popular shells, and some
Each clause must be terminated with ‘;;’, ‘;&’, or ‘;;&’. The WORD
undergoes tilde expansion, parameter expansion, command
- substitution, arithmetic expansion, and quote removal (*note Shell
- Parameter Expansion::) before matching is attempted. Each PATTERN
- undergoes tilde expansion, parameter expansion, command
- substitution, arithmetic expansion, process substitution, and quote
- removal.
+ substitution, process substitution, arithmetic expansion, and quote
+ removal (*note Shell Parameter Expansion::) before the shell
+ attempts to match the pattern. Each PATTERN undergoes tilde
+ expansion, parameter expansion, command substitution, arithmetic
+ expansion, process substitution, and quote removal.
There may be an arbitrary number of ‘case’ clauses, each terminated
by a ‘;;’, ‘;&’, or ‘;;&’. The first pattern that matches
‘*’
($*) Expands to the positional parameters, starting from one. When
the expansion is not within double quotes, each positional
- parameter expands to a separate word. In contexts where it is
- performed, those words are subject to further word splitting and
- filename expansion. When the expansion occurs within double
- quotes, it expands to a single word with the value of each
+ parameter expands to a separate word. In contexts where these
+ expansions are performed, those words are subject to further word
+ splitting and filename expansion. When the expansion occurs within
+ double quotes, it expands to a single word with the value of each
parameter separated by the first character of the ‘IFS’ special
variable. That is, ‘"$*"’ is equivalent to ‘"$1C$2C..."’, where C
is the first character of the value of the ‘IFS’ variable. If
‘?’
($?) Expands to the exit status of the most recently executed
- foreground command.
+ command.
‘-’
($-, a hyphen.) Expands to the current option flags as specified
is stopped is 'Stopped(SIGNAME)', where SIGNAME is, for example,
‘SIGTSTP’.
- 6. Alias expansion is always enabled, even in non-interactive shells.
+ 6. If the shell is interactive, Bash does not perform job
+ notifications between executing commands in lists separated by ‘;’
+ or newline. Non-interactive shells print status messages after a
+ foreground job in a list completes.
+
+ 7. If the shell is interactive, Bash waits until the next prompt
+ before printing the status of a background job that changes status
+ or a foreground job that terminates due to a signal.
+ Non-interactive shells print status messages after a foreground job
+ completes.
- 7. Reserved words appearing in a context where reserved words are
+ 8. Alias expansion is always enabled, even in non-interactive shells.
+
+ 9. Reserved words appearing in a context where reserved words are
recognized do not undergo alias expansion.
- 8. Alias expansion is performed when initially parsing a command
+ 10. Alias expansion is performed when initially parsing a command
substitution. The default mode generally defers it, when enabled,
until the command substitution is executed. This means that
command substitution will not expand aliases that are defined after
the command substitution is initially parsed (e.g., as part of a
function definition).
- 9. The POSIX ‘PS1’ and ‘PS2’ expansions of ‘!’ to the history number
+ 11. The POSIX ‘PS1’ and ‘PS2’ expansions of ‘!’ to the history number
and ‘!!’ to ‘!’ are enabled, and parameter expansion is performed
on the values of ‘PS1’ and ‘PS2’ regardless of the setting of the
‘promptvars’ option.
- 10. The POSIX startup files are executed (‘$ENV’) rather than the
+ 12. The POSIX startup files are executed (‘$ENV’) rather than the
normal Bash files.
- 11. Tilde expansion is only performed on assignments preceding a
+ 13. Tilde expansion is only performed on assignments preceding a
command name, rather than on all assignment statements on the line.
- 12. The default history file is ‘~/.sh_history’ (this is the default
+ 14. The default history file is ‘~/.sh_history’ (this is the default
value the shell assigns to ‘$HISTFILE’).
- 13. Redirection operators do not perform filename expansion on the
+ 15. Redirection operators do not perform filename expansion on the
word in the redirection unless the shell is interactive.
- 14. Redirection operators do not perform word splitting on the word in
+ 16. Redirection operators do not perform word splitting on the word in
the redirection.
- 15. Function names must be valid shell ‘name’s. That is, they may not
+ 17. Function names must be valid shell ‘name’s. That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit. Declaring a function with an invalid
name causes a fatal syntax error in non-interactive shells.
- 16. Function names may not be the same as one of the POSIX special
+ 18. Function names may not be the same as one of the POSIX special
builtins.
- 17. Even if a shell function whose name contains a slash was defined
+ 19. Even if a shell function whose name contains a slash was defined
before entering POSIX mode, the shell will not execute a function
whose name contains one or more slashes.
- 18. POSIX special builtins are found before shell functions during
+ 20. POSIX special builtins are found before shell functions during
command lookup, including output printed by the ‘type’ and
‘command’ builtins.
- 19. When printing shell function definitions (e.g., by ‘type’), Bash
+ 21. When printing shell function definitions (e.g., by ‘type’), Bash
does not print the ‘function’ keyword.
- 20. Literal tildes that appear as the first character in elements of
+ 22. Literal tildes that appear as the first character in elements of
the ‘PATH’ variable are not expanded as described above under *note
Tilde Expansion::.
- 21. The ‘time’ reserved word may be used by itself as a command. When
+ 23. The ‘time’ reserved word may be used by itself as a command. When
used in this way, it displays timing statistics for the shell and
its completed children. The ‘TIMEFORMAT’ variable controls the
format of the timing information.
- 22. When parsing and expanding a ${...} expansion that appears within
+ 24. When parsing and expanding a ${...} expansion that appears within
double quotes, single quotes are no longer special and cannot be
used to quote a closing brace or other special character, unless
the operator is one of those defined to perform pattern removal.
In this case, they do not have to appear as matched pairs.
- 23. The parser does not recognize ‘time’ as a reserved word if the
+ 25. The parser does not recognize ‘time’ as a reserved word if the
next token begins with a ‘-’.
- 24. The ‘!’ character does not introduce history expansion within a
+ 26. The ‘!’ character does not introduce history expansion within a
double-quoted string, even if the ‘histexpand’ option is enabled.
- 25. If a POSIX special builtin returns an error status, a
+ 27. If a POSIX special builtin returns an error status, a
non-interactive shell exits. The fatal errors are those listed in
the POSIX standard, and include things like passing incorrect
options, redirection errors, variable assignment errors for
assignments preceding the command name, and so on.
- 26. The ‘unset’ builtin with the ‘-v’ option specified returns a fatal
+ 28. The ‘unset’ builtin with the ‘-v’ option specified returns a fatal
error if it attempts to unset a ‘readonly’ or ‘non-unsettable’
variable, or encounters a variable name argument that is an invalid
identifier, which causes a non-interactive shell to exit.
- 27. When asked to unset a variable that appears in an assignment
+ 29. When asked to unset a variable that appears in an assignment
statement preceding the command, the ‘unset’ builtin attempts to
unset a variable of the same name in the current or previous scope
as well. This implements the required "if an assigned variable is
further modified by the utility, the modifications made by the
utility shall persist" behavior.
- 28. A non-interactive shell exits with an error status if a variable
+ 30. A non-interactive shell exits with an error status if a variable
assignment error occurs when no command name follows the assignment
statements. A variable assignment error occurs, for example, when
trying to assign a value to a readonly variable.
- 29. A non-interactive shell exits with an error status if a variable
+ 31. A non-interactive shell exits with an error status if a variable
assignment error occurs in an assignment statement preceding a
special builtin, but not with any other simple command. For any
other simple command, the shell aborts execution of that command,
perform any further processing of the command in which the error
occurred").
- 30. A non-interactive shell exits with an error status if the
+ 32. A non-interactive shell exits with an error status if the
iteration variable in a ‘for’ statement or the selection variable
in a ‘select’ statement is a readonly variable or has an invalid
name.
- 31. Non-interactive shells exit if FILENAME in ‘.’ FILENAME is not
+ 33. Non-interactive shells exit if FILENAME in ‘.’ FILENAME is not
found.
- 32. Non-interactive shells exit if a syntax error in an arithmetic
+ 34. Non-interactive shells exit if a syntax error in an arithmetic
expansion results in an invalid expression.
- 33. Non-interactive shells exit if a parameter expansion error occurs.
+ 35. Non-interactive shells exit if a parameter expansion error occurs.
- 34. Non-interactive shells exit if there is a syntax error in a script
+ 36. Non-interactive shells exit if there is a syntax error in a script
read with the ‘.’ or ‘source’ builtins, or in a string processed by
the ‘eval’ builtin.
- 35. While variable indirection is available, it may not be applied to
+ 37. While variable indirection is available, it may not be applied to
the ‘#’ and ‘?’ special parameters.
- 36. Expanding the ‘*’ special parameter in a pattern context where the
+ 38. Expanding the ‘*’ special parameter in a pattern context where the
expansion is double-quoted does not treat the ‘$*’ as if it were
double-quoted.
- 37. Assignment statements preceding POSIX special builtins persist in
+ 39. Assignment statements preceding POSIX special builtins persist in
the shell environment after the builtin completes.
- 38. The ‘command’ builtin does not prevent builtins that take
+ 40. The ‘command’ builtin does not prevent builtins that take
assignment statements as arguments from expanding them as
assignment statements; when not in POSIX mode, assignment builtins
lose their assignment statement expansion properties when preceded
by ‘command’.
- 39. The ‘bg’ builtin uses the required format to describe each job
+ 41. The ‘bg’ builtin uses the required format to describe each job
placed in the background, which does not include an indication of
whether the job is the current or previous job.
- 40. The output of ‘kill -l’ prints all the signal names on a single
+ 42. The output of ‘kill -l’ prints all the signal names on a single
line, separated by spaces, without the ‘SIG’ prefix.
- 41. The ‘kill’ builtin does not accept signal names with a ‘SIG’
+ 43. The ‘kill’ builtin does not accept signal names with a ‘SIG’
prefix.
- 42. The ‘export’ and ‘readonly’ builtin commands display their output
+ 44. The ‘export’ and ‘readonly’ builtin commands display their output
in the format required by POSIX.
- 43. If the ‘export’ and ‘readonly’ builtin commands get an argument
+ 45. If the ‘export’ and ‘readonly’ builtin commands get an argument
that is not a valid identifier, and they are not operating on shell
functions, they return an error. This will cause a non-interactive
shell to exit because these are special builtins.
- 44. The ‘trap’ builtin displays signal names without the leading
+ 46. The ‘trap’ builtin displays signal names without the leading
‘SIG’.
- 45. The ‘trap’ builtin doesn't check the first argument for a possible
+ 47. The ‘trap’ builtin doesn't check the first argument for a possible
signal specification and revert the signal handling to the original
disposition if it is, unless that argument consists solely of
digits and is a valid signal number. If users want to reset the
handler for a given signal to the original disposition, they should
use ‘-’ as the first argument.
- 46. ‘trap -p’ without arguments displays signals whose dispositions
+ 48. ‘trap -p’ without arguments displays signals whose dispositions
are set to SIG_DFL and those that were ignored when the shell
started, not just trapped signals.
- 47. The ‘.’ and ‘source’ builtins do not search the current directory
+ 49. The ‘.’ and ‘source’ builtins do not search the current directory
for the filename argument if it is not found by searching ‘PATH’.
- 48. Enabling POSIX mode has the effect of setting the
+ 50. Enabling POSIX mode has the effect of setting the
‘inherit_errexit’ option, so subshells spawned to execute command
substitutions inherit the value of the ‘-e’ option from the parent
shell. When the ‘inherit_errexit’ option is not enabled, Bash
clears the ‘-e’ option in such subshells.
- 49. Enabling POSIX mode has the effect of setting the ‘shift_verbose’
+ 51. Enabling POSIX mode has the effect of setting the ‘shift_verbose’
option, so numeric arguments to ‘shift’ that exceed the number of
positional parameters will result in an error message.
- 50. When the ‘alias’ builtin displays alias definitions, it does not
+ 52. When the ‘alias’ builtin displays alias definitions, it does not
display them with a leading ‘alias ’ unless the ‘-p’ option is
supplied.
- 51. When the ‘set’ builtin is invoked without options, it does not
+ 53. When the ‘set’ builtin is invoked without options, it does not
display shell function names and definitions.
- 52. When the ‘set’ builtin is invoked without options, it displays
+ 54. When the ‘set’ builtin is invoked without options, it displays
variable values without quotes, unless they contain shell
metacharacters, even if the result contains nonprinting characters.
- 53. When the ‘cd’ builtin is invoked in logical mode, and the pathname
+ 55. When the ‘cd’ builtin is invoked in logical mode, and the pathname
constructed from ‘$PWD’ and the directory name supplied as an
argument does not refer to an existing directory, ‘cd’ will fail
instead of falling back to physical mode.
- 54. When the ‘cd’ builtin cannot change a directory because the length
+ 56. When the ‘cd’ builtin cannot change a directory because the length
of the pathname constructed from ‘$PWD’ and the directory name
supplied as an argument exceeds ‘PATH_MAX’ when canonicalized, ‘cd’
will attempt to use the supplied directory name.
- 55. The ‘pwd’ builtin verifies that the value it prints is the same as
+ 57. The ‘pwd’ builtin verifies that the value it prints is the same as
the current directory, even if it is not asked to check the file
system with the ‘-P’ option.
- 56. When listing the history, the ‘fc’ builtin does not include an
+ 58. When listing the history, the ‘fc’ builtin does not include an
indication of whether or not a history entry has been modified.
- 57. The default editor used by ‘fc’ is ‘ed’.
+ 59. The default editor used by ‘fc’ is ‘ed’.
- 58. ‘fc’ treats extra arguments as an error instead of ignoring them.
+ 60. ‘fc’ treats extra arguments as an error instead of ignoring them.
- 59. If there are too many arguments supplied to ‘fc -s’, ‘fc’ prints
+ 61. If there are too many arguments supplied to ‘fc -s’, ‘fc’ prints
an error message and returns failure.
- 60. The ‘type’ and ‘command’ builtins will not report a non-executable
+ 62. The ‘type’ and ‘command’ builtins will not report a non-executable
file as having been found, though the shell will attempt to execute
such a file if it is the only so-named file found in ‘$PATH’.
- 61. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when
+ 63. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when
the ‘v’ command is run, instead of checking ‘$VISUAL’ and
‘$EDITOR’.
- 62. When the ‘xpg_echo’ option is enabled, Bash does not attempt to
+ 64. When the ‘xpg_echo’ option is enabled, Bash does not attempt to
interpret any arguments to ‘echo’ as options. Each argument is
displayed, after escape characters are converted.
- 63. The ‘ulimit’ builtin uses a block size of 512 bytes for the ‘-c’
+ 65. The ‘ulimit’ builtin uses a block size of 512 bytes for the ‘-c’
and ‘-f’ options.
- 64. The arrival of ‘SIGCHLD’ when a trap is set on ‘SIGCHLD’ does not
+ 66. The arrival of ‘SIGCHLD’ when a trap is set on ‘SIGCHLD’ does not
interrupt the ‘wait’ builtin and cause it to return immediately.
The trap command is run once for each child that exits.
- 65. The ‘read’ builtin may be interrupted by a signal for which a trap
+ 67. The ‘read’ builtin may be interrupted by a signal for which a trap
has been set. If Bash receives a trapped signal while executing
‘read’, the trap handler executes and ‘read’ returns an exit status
greater than 128.
- 66. The ‘printf’ builtin uses ‘double’ (via ‘strtod’) to convert
+ 68. The ‘printf’ builtin uses ‘double’ (via ‘strtod’) to convert
arguments corresponding to floating point conversion specifiers,
instead of ‘long double’ if it's available. The ‘L’ length
modifier forces ‘printf’ to use ‘long double’ if it's available.
- 67. Bash removes an exited background process's status from the list
+ 69. Bash removes an exited background process's status from the list
of such statuses after the ‘wait’ builtin is used to obtain it.
- 68. A double quote character (‘"’) is treated specially when it
+ 70. A double quote character (‘"’) is treated specially when it
appears in a backquoted command substitution in the body of a
here-document that undergoes expansion. That means, for example,
that a backslash preceding a double quote character will escape it
and the backslash will be removed.
- 69. The ‘test’ builtin compares strings using the current locale when
+ 71. The ‘test’ builtin compares strings using the current locale when
processing the ‘<’ and ‘>’ binary operators.
- 70. The ‘test’ builtin's ‘-t’ unary primary requires an argument.
+ 72. The ‘test’ builtin's ‘-t’ unary primary requires an argument.
Historical versions of ‘test’ made the argument optional in certain
cases, and Bash attempts to accommodate those for backwards
compatibility.
- 71. Command substitutions don't set the ‘?’ special parameter. The
+ 73. Command substitutions don't set the ‘?’ special parameter. The
exit status of a simple command without a command word is still the
exit status of the last command substitution that occurred while
evaluating the variable assignments and redirections in that
as bindable command names, and displays any key sequences
bound to those commands, instead of treating the arguments as
key sequences to bind.
+ • Interactive shells will notify the user of completed jobs
+ while sourcing a script. Newer versions defer notification
+ until script execution completes.
\1f
File: bashref.info, Node: Job Control, Next: Command Line Editing, Prev: Bash Features, Up: Top
The shell learns immediately whenever a job changes state. Normally,
Bash waits until it is about to print a prompt before reporting changes
-in a job's status so as to not interrupt any other output. If the ‘-b’
-option to the ‘set’ builtin is enabled, Bash reports such changes
-immediately (*note The Set Builtin::). Any trap on ‘SIGCHLD’ is
-executed for each child process that exits.
+in a job's status so as to not interrupt any other output, though it
+will notify of changes in a job's status after a command in a list
+completes, before executing the next command. If the ‘-b’ option to the
+‘set’ builtin is enabled, Bash reports such changes immediately (*note
+The Set Builtin::). Any trap on ‘SIGCHLD’ is executed for each child
+process that exits.
If an attempt to exit Bash is made while jobs are stopped, (or
running, if the ‘checkjobs’ option is enabled - see *note The Shopt
The text ‘M-k’ is read as 'Meta-K' and describes the character
produced when the Meta key (if you have one) is depressed, and the <k>
-key is pressed. The Meta key is labeled <ALT> on many keyboards. On
-keyboards with two keys labeled <ALT> (usually to either side of the
-space bar), the <ALT> on the left side is generally set to work as a
-Meta key. The <ALT> key on the right may also be configured to work as
-a Meta key or may be configured as some other modifier, such as a
-Compose key for typing accented characters.
+key is pressed (a “meta character”). The Meta key is labeled <ALT> on
+many keyboards. On keyboards with two keys labeled <ALT> (usually to
+either side of the space bar), the <ALT> on the left side is generally
+set to work as a Meta key. The <ALT> key on the right may also be
+configured to work as a Meta key or may be configured as some other
+modifier, such as a Compose key for typing accented characters.
+
+ On some keyboards, the Meta key modifier produces meta characters
+with the eighth bit (0200) set (you can use the ‘enable-meta-key’
+variable to control whether or not it does this, if the keyboard allows
+it). On many others, the terminal or terminal emulator converts the
+metafied key to a key sequence beginning with <ESC> as described in the
+next paragraph.
If you do not have a Meta or <ALT> key, or another key working as a
-Meta key, the identical keystroke can be generated by typing <ESC>
-_first_, and then typing <k>. Either process is known as “metafying”
-the <k> key.
+Meta key, you can generally achieve the latter effect by typing <ESC>
+_first_, and then typing <k>. The <ESC> character is known as the “meta
+prefix”).
+
+ Either process is known as “metafying” the <k> key.
The text ‘M-C-k’ is read as 'Meta-Control-k' and describes the
-character produced by “metafying” ‘C-k’.
+character produced by metafying ‘C-k’.
In addition, several keys have their own names. Specifically, <DEL>,
<ESC>, <LFD>, <SPC>, <RET>, and <TAB> all stand for themselves when seen
limit is ‘100’.
‘convert-meta’
- If set to ‘on’, Readline will convert characters with the
- eighth bit set to an ASCII key sequence by stripping the
+ If set to ‘on’, Readline will convert characters it reads with
+ the eighth bit set to an ASCII key sequence by stripping the
eighth bit and prefixing an <ESC> character, converting them
to a meta-prefixed key sequence. The default value is ‘on’,
- but will be set to ‘off’ if the locale is one that contains
- eight-bit characters. This variable is dependent on the
- ‘LC_CTYPE’ locale category, and may change if the locale is
- changed.
+ but Readline will set it to ‘off’ if the locale contains
+ characters whose encodings may include bytes with the eighth
+ bit set. This variable is dependent on the ‘LC_CTYPE’ locale
+ category, and may change if the locale is changed. This
+ variable also affects key bindings; see the description of
+ ‘force-meta-prefix’ below.
‘disable-completion’
If set to ‘On’, Readline will inhibit word completion.
‘enable-meta-key’
When set to ‘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 ‘on’.
+ On many terminals, the Meta key is used to send eight-bit
+ characters; this variable checks for the terminal capability
+ that indicates the terminal can enable and disable a mode that
+ sets the eighth bit of a character (0200) if the Meta key is
+ held down when the character is typed (a meta character). The
+ default is ‘on’.
‘expand-tilde’
If set to ‘on’, tilde expansion is performed when Readline
attempts word completion. The default is ‘off’.
+ ‘force-meta-prefix’
+ If set to ‘on’, Readline modifies its behavior when binding
+ key sequences containing ‘\M-’ or ‘Meta-’ (see ‘Key Bindings’
+ in *note Readline Init File Syntax::) by converting a key
+ sequence of the form ‘\M-’C or ‘Meta-’C to the two-character
+ sequence ‘ESC’C (adding the meta prefix). If
+ ‘force-meta-prefix’ is set to ‘off’ (the default), Readline
+ uses the value of the ‘convert-meta’ variable to determine
+ whether to perform this conversion: if ‘convert-meta’ is ‘on’,
+ Readline performs the conversion described above; if it is
+ ‘off’, Readline converts C to a meta character by setting the
+ eighth bit (0200). The default is ‘off’.
+
‘history-preserve-point’
If set to ‘on’, the history code attempts to place the point
(the current cursor position) at the same location on each
not clear the eighth bit in the characters it reads),
regardless of what the terminal claims it can support. The
default value is ‘off’, but Readline will set it to ‘on’ if
- the locale contains eight-bit characters. The name
- ‘meta-flag’ is a synonym for this variable. This variable is
- dependent on the ‘LC_CTYPE’ locale category, and may change if
- the locale is changed.
+ the locale contains characters whose encodings may include
+ bytes with the eighth bit set. The name ‘meta-flag’ is a
+ synonym for this variable. This variable is dependent on the
+ ‘LC_CTYPE’ locale category, and may change if the locale is
+ changed.
‘isearch-terminators’
The string of characters that should terminate an incremental
If set to ‘on’, Readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
sequence. The default is ‘off’, but Readline will set it to
- ‘on’ if the locale contains eight-bit characters. This
- variable is dependent on the ‘LC_CTYPE’ locale category, and
- may change if the locale is changed.
+ ‘on’ if the locale contains characters whose encodings may
+ include bytes with the eighth bit set. This variable is
+ dependent on the ‘LC_CTYPE’ locale category, and may change if
+ the locale is changed.
‘page-completions’
If set to ‘on’, Readline uses an internal ‘more’-like pager to
‘\C-’
control prefix
‘\M-’
- meta prefix
+ adding the meta prefix or converting the following character
+ to a meta character, as described above under
+ ‘force-meta-prefix’ (see ‘Variable Settings’ in *note Readline
+ Init File Syntax::).
‘\e’
an escape character
‘\\’
* COPROC: Bash Variables. (line 278)
* DIRSTACK: Bash Variables. (line 282)
* disable-completion: Readline Init File Syntax.
- (line 151)
+ (line 153)
* echo-control-characters: Readline Init File Syntax.
- (line 156)
+ (line 158)
* editing-mode: Readline Init File Syntax.
- (line 161)
+ (line 163)
* EMACS: Bash Variables. (line 292)
* emacs-mode-string: Readline Init File Syntax.
- (line 167)
+ (line 169)
* enable-active-region: Readline Init File Syntax.
- (line 177)
+ (line 179)
* enable-bracketed-paste: Readline Init File Syntax.
- (line 190)
+ (line 192)
* enable-keypad: Readline Init File Syntax.
- (line 199)
+ (line 201)
* ENV: Bash Variables. (line 297)
* EPOCHREALTIME: Bash Variables. (line 302)
* EPOCHSECONDS: Bash Variables. (line 310)
* EUID: Bash Variables. (line 317)
* EXECIGNORE: Bash Variables. (line 321)
* expand-tilde: Readline Init File Syntax.
- (line 210)
+ (line 216)
* FCEDIT: Bash Variables. (line 334)
* FIGNORE: Bash Variables. (line 338)
+* force-meta-prefix: Readline Init File Syntax.
+ (line 220)
* FUNCNAME: Bash Variables. (line 344)
* FUNCNEST: Bash Variables. (line 361)
* GLOBIGNORE: Bash Variables. (line 366)
* HISTFILESIZE: Bash Variables. (line 456)
* HISTIGNORE: Bash Variables. (line 467)
* history-preserve-point: Readline Init File Syntax.
- (line 214)
+ (line 233)
* history-size: Readline Init File Syntax.
- (line 220)
+ (line 239)
* HISTSIZE: Bash Variables. (line 489)
* HISTTIMEFORMAT: Bash Variables. (line 496)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
- (line 229)
+ (line 248)
* HOSTFILE: Bash Variables. (line 505)
* HOSTNAME: Bash Variables. (line 516)
* HOSTTYPE: Bash Variables. (line 519)
(line 18)
* IGNOREEOF: Bash Variables. (line 522)
* input-meta: Readline Init File Syntax.
- (line 238)
+ (line 257)
* INPUTRC: Bash Variables. (line 532)
* INSIDE_EMACS: Bash Variables. (line 536)
* isearch-terminators: Readline Init File Syntax.
- (line 248)
+ (line 268)
* keymap: Readline Init File Syntax.
- (line 255)
+ (line 275)
* LANG: Creating Internationalized Scripts.
(line 51)
* LANG <1>: Bash Variables. (line 542)
(line 27)
* MAPFILE: Bash Variables. (line 597)
* mark-modified-lines: Readline Init File Syntax.
- (line 285)
+ (line 305)
* mark-symlinked-directories: Readline Init File Syntax.
- (line 290)
+ (line 310)
* match-hidden-files: Readline Init File Syntax.
- (line 295)
+ (line 315)
* menu-complete-display-prefix: Readline Init File Syntax.
- (line 302)
+ (line 322)
* meta-flag: Readline Init File Syntax.
- (line 238)
+ (line 257)
* OLDPWD: Bash Variables. (line 601)
* OPTARG: Bourne Shell Variables.
(line 34)
(line 38)
* OSTYPE: Bash Variables. (line 608)
* output-meta: Readline Init File Syntax.
- (line 307)
+ (line 327)
* page-completions: Readline Init File Syntax.
- (line 315)
+ (line 336)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 611)
* READLINE_POINT: Bash Variables. (line 684)
* REPLY: Bash Variables. (line 688)
* revert-all-at-newline: Readline Init File Syntax.
- (line 325)
+ (line 346)
* search-ignore-case: Readline Init File Syntax.
- (line 332)
+ (line 353)
* SECONDS: Bash Variables. (line 691)
* SHELL: Bash Variables. (line 701)
* SHELLOPTS: Bash Variables. (line 706)
* SHLVL: Bash Variables. (line 715)
* show-all-if-ambiguous: Readline Init File Syntax.
- (line 337)
+ (line 358)
* show-all-if-unmodified: Readline Init File Syntax.
- (line 343)
+ (line 364)
* show-mode-in-prompt: Readline Init File Syntax.
- (line 352)
+ (line 373)
* skip-completed-text: Readline Init File Syntax.
- (line 358)
+ (line 379)
* SRANDOM: Bash Variables. (line 720)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TMPDIR: Bash Variables. (line 779)
* UID: Bash Variables. (line 783)
* vi-cmd-mode-string: Readline Init File Syntax.
- (line 371)
+ (line 392)
* vi-ins-mode-string: Readline Init File Syntax.
- (line 382)
+ (line 403)
* visible-stats: Readline Init File Syntax.
- (line 393)
+ (line 414)
\1f
File: bashref.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Indexes
\1f
Tag Table:
-Node: Top\7f900
-Node: Introduction\7f2840
-Node: What is Bash?\7f3056
-Node: What is a shell?\7f4200
-Node: Definitions\7f6782
-Node: Basic Shell Features\7f9961
-Node: Shell Syntax\7f11184
-Node: Shell Operation\7f12214
-Node: Quoting\7f13515
-Node: Escape Character\7f14831
-Node: Single Quotes\7f15332
-Node: Double Quotes\7f15684
-Node: ANSI-C Quoting\7f17030
-Node: Locale Translation\7f18418
-Node: Creating Internationalized Scripts\7f19765
-Node: Comments\7f23966
-Node: Shell Commands\7f24604
-Node: Reserved Words\7f25546
-Node: Simple Commands\7f26414
-Node: Pipelines\7f27076
-Node: Lists\7f30142
-Node: Compound Commands\7f32017
-Node: Looping Constructs\7f33029
-Node: Conditional Constructs\7f35576
-Node: Command Grouping\7f50400
-Node: Coprocesses\7f51890
-Node: GNU Parallel\7f54589
-Node: Shell Functions\7f55510
-Node: Shell Parameters\7f63619
-Node: Positional Parameters\7f68155
-Node: Special Parameters\7f69093
-Node: Shell Expansions\7f72402
-Node: Brace Expansion\7f74594
-Node: Tilde Expansion\7f77260
-Node: Shell Parameter Expansion\7f80029
-Node: Command Substitution\7f99139
-Node: Arithmetic Expansion\7f102675
-Node: Process Substitution\7f103643
-Node: Word Splitting\7f104783
-Node: Filename Expansion\7f106927
-Node: Pattern Matching\7f110026
-Node: Quote Removal\7f115262
-Node: Redirections\7f115569
-Node: Executing Commands\7f125381
-Node: Simple Command Expansion\7f126051
-Node: Command Search and Execution\7f128165
-Node: Command Execution Environment\7f130576
-Node: Environment\7f133888
-Node: Exit Status\7f135595
-Node: Signals\7f137383
-Node: Shell Scripts\7f141000
-Node: Shell Builtin Commands\7f144095
-Node: Bourne Shell Builtins\7f146209
-Node: Bash Builtins\7f170982
-Node: Modifying Shell Behavior\7f206084
-Node: The Set Builtin\7f206429
-Node: The Shopt Builtin\7f218015
-Node: Special Builtins\7f234980
-Node: Shell Variables\7f235972
-Node: Bourne Shell Variables\7f236409
-Node: Bash Variables\7f238605
-Node: Bash Features\7f275803
-Node: Invoking Bash\7f276820
-Node: Bash Startup Files\7f283222
-Node: Interactive Shells\7f288528
-Node: What is an Interactive Shell?\7f288939
-Node: Is this Shell Interactive?\7f289608
-Node: Interactive Shell Behavior\7f290435
-Node: Bash Conditional Expressions\7f294192
-Node: Shell Arithmetic\7f299369
-Node: Aliases\7f302454
-Node: Arrays\7f305412
-Node: The Directory Stack\7f312214
-Node: Directory Stack Builtins\7f313014
-Node: Controlling the Prompt\7f317466
-Node: The Restricted Shell\7f320607
-Node: Bash POSIX Mode\7f323397
-Node: Shell Compatibility Mode\7f340911
-Node: Job Control\7f349681
-Node: Job Control Basics\7f350141
-Node: Job Control Builtins\7f355318
-Node: Job Control Variables\7f361265
-Node: Command Line Editing\7f362445
-Node: Introduction and Notation\7f364152
-Node: Readline Interaction\7f365799
-Node: Readline Bare Essentials\7f366990
-Node: Readline Movement Commands\7f368811
-Node: Readline Killing Commands\7f369811
-Node: Readline Arguments\7f371792
-Node: Searching\7f372852
-Node: Readline Init File\7f375084
-Node: Readline Init File Syntax\7f376369
-Node: Conditional Init Constructs\7f401310
-Node: Sample Init File\7f405678
-Node: Bindable Readline Commands\7f408802
-Node: Commands For Moving\7f410030
-Node: Commands For History\7f412260
-Node: Commands For Text\7f417468
-Node: Commands For Killing\7f421605
-Node: Numeric Arguments\7f424409
-Node: Commands For Completion\7f425564
-Node: Keyboard Macros\7f429883
-Node: Miscellaneous Commands\7f430587
-Node: Readline vi Mode\7f437244
-Node: Programmable Completion\7f438199
-Node: Programmable Completion Builtins\7f446159
-Node: A Programmable Completion Example\7f457728
-Node: Using History Interactively\7f463076
-Node: Bash History Facilities\7f463760
-Node: Bash History Builtins\7f466875
-Node: History Interaction\7f472121
-Node: Event Designators\7f476449
-Node: Word Designators\7f478035
-Node: Modifiers\7f480190
-Node: Installing Bash\7f482102
-Node: Basic Installation\7f483239
-Node: Compilers and Options\7f487121
-Node: Compiling For Multiple Architectures\7f487874
-Node: Installation Names\7f489626
-Node: Specifying the System Type\7f491863
-Node: Sharing Defaults\7f492612
-Node: Operation Controls\7f493329
-Node: Optional Features\7f494351
-Node: Reporting Bugs\7f506156
-Node: Major Differences From The Bourne Shell\7f507508
-Node: GNU Free Documentation License\7f527246
-Node: Indexes\7f552426
-Node: Builtin Index\7f552880
-Node: Reserved Word Index\7f559981
-Node: Variable Index\7f562429
-Node: Function Index\7f579563
-Node: Concept Index\7f593422
+Node: Top\7f904
+Node: Introduction\7f2848
+Node: What is Bash?\7f3064
+Node: What is a shell?\7f4208
+Node: Definitions\7f6790
+Node: Basic Shell Features\7f9969
+Node: Shell Syntax\7f11192
+Node: Shell Operation\7f12222
+Node: Quoting\7f13523
+Node: Escape Character\7f14839
+Node: Single Quotes\7f15340
+Node: Double Quotes\7f15692
+Node: ANSI-C Quoting\7f17038
+Node: Locale Translation\7f18426
+Node: Creating Internationalized Scripts\7f19773
+Node: Comments\7f23974
+Node: Shell Commands\7f24612
+Node: Reserved Words\7f25554
+Node: Simple Commands\7f26422
+Node: Pipelines\7f27084
+Node: Lists\7f30150
+Node: Compound Commands\7f32025
+Node: Looping Constructs\7f33037
+Node: Conditional Constructs\7f35584
+Node: Command Grouping\7f50448
+Node: Coprocesses\7f51938
+Node: GNU Parallel\7f54637
+Node: Shell Functions\7f55558
+Node: Shell Parameters\7f63667
+Node: Positional Parameters\7f68203
+Node: Special Parameters\7f69141
+Node: Shell Expansions\7f72454
+Node: Brace Expansion\7f74646
+Node: Tilde Expansion\7f77312
+Node: Shell Parameter Expansion\7f80081
+Node: Command Substitution\7f99191
+Node: Arithmetic Expansion\7f102727
+Node: Process Substitution\7f103695
+Node: Word Splitting\7f104835
+Node: Filename Expansion\7f106979
+Node: Pattern Matching\7f110078
+Node: Quote Removal\7f115314
+Node: Redirections\7f115621
+Node: Executing Commands\7f125433
+Node: Simple Command Expansion\7f126103
+Node: Command Search and Execution\7f128217
+Node: Command Execution Environment\7f130628
+Node: Environment\7f133940
+Node: Exit Status\7f135647
+Node: Signals\7f137435
+Node: Shell Scripts\7f141052
+Node: Shell Builtin Commands\7f144147
+Node: Bourne Shell Builtins\7f146261
+Node: Bash Builtins\7f171034
+Node: Modifying Shell Behavior\7f206136
+Node: The Set Builtin\7f206481
+Node: The Shopt Builtin\7f218067
+Node: Special Builtins\7f235032
+Node: Shell Variables\7f236024
+Node: Bourne Shell Variables\7f236461
+Node: Bash Variables\7f238657
+Node: Bash Features\7f275855
+Node: Invoking Bash\7f276872
+Node: Bash Startup Files\7f283274
+Node: Interactive Shells\7f288580
+Node: What is an Interactive Shell?\7f288991
+Node: Is this Shell Interactive?\7f289660
+Node: Interactive Shell Behavior\7f290487
+Node: Bash Conditional Expressions\7f294244
+Node: Shell Arithmetic\7f299421
+Node: Aliases\7f302506
+Node: Arrays\7f305464
+Node: The Directory Stack\7f312266
+Node: Directory Stack Builtins\7f313066
+Node: Controlling the Prompt\7f317518
+Node: The Restricted Shell\7f320659
+Node: Bash POSIX Mode\7f323449
+Node: Shell Compatibility Mode\7f341501
+Node: Job Control\7f350455
+Node: Job Control Basics\7f350915
+Node: Job Control Builtins\7f356215
+Node: Job Control Variables\7f362162
+Node: Command Line Editing\7f363342
+Node: Introduction and Notation\7f365049
+Node: Readline Interaction\7f367147
+Node: Readline Bare Essentials\7f368338
+Node: Readline Movement Commands\7f370159
+Node: Readline Killing Commands\7f371159
+Node: Readline Arguments\7f373140
+Node: Searching\7f374200
+Node: Readline Init File\7f376432
+Node: Readline Init File Syntax\7f377717
+Node: Conditional Init Constructs\7f404260
+Node: Sample Init File\7f408628
+Node: Bindable Readline Commands\7f411752
+Node: Commands For Moving\7f412980
+Node: Commands For History\7f415210
+Node: Commands For Text\7f420418
+Node: Commands For Killing\7f424555
+Node: Numeric Arguments\7f427359
+Node: Commands For Completion\7f428514
+Node: Keyboard Macros\7f432833
+Node: Miscellaneous Commands\7f433537
+Node: Readline vi Mode\7f440194
+Node: Programmable Completion\7f441149
+Node: Programmable Completion Builtins\7f449109
+Node: A Programmable Completion Example\7f460678
+Node: Using History Interactively\7f466026
+Node: Bash History Facilities\7f466710
+Node: Bash History Builtins\7f469825
+Node: History Interaction\7f475071
+Node: Event Designators\7f479399
+Node: Word Designators\7f480985
+Node: Modifiers\7f483140
+Node: Installing Bash\7f485052
+Node: Basic Installation\7f486189
+Node: Compilers and Options\7f490071
+Node: Compiling For Multiple Architectures\7f490824
+Node: Installation Names\7f492576
+Node: Specifying the System Type\7f494813
+Node: Sharing Defaults\7f495562
+Node: Operation Controls\7f496279
+Node: Optional Features\7f497301
+Node: Reporting Bugs\7f509106
+Node: Major Differences From The Bourne Shell\7f510458
+Node: GNU Free Documentation License\7f530196
+Node: Indexes\7f555376
+Node: Builtin Index\7f555830
+Node: Reserved Word Index\7f562931
+Node: Variable Index\7f565379
+Node: Function Index\7f582654
+Node: Concept Index\7f596513
\1f
End Tag Table
@item ?
@vindex $?
-($?) Expands to the exit status of the most recently executed foreground
-command.
+($?) Expands to the exit status of the most recently executed command.
@item -
@vindex $-
example, @code{SIGTSTP}.
@item
-Bash does not perform job notifications between executing commands in
-lists separated by @samp{;} or newline in interactive shells.
+If the shell is interactive, Bash does not perform job notifications
+between executing commands in lists separated by @samp{;} or newline.
+Non-interactive shells print status messages after a foreground job in
+a list completes.
+
+@item
+If the shell is interactive, Bash waits until the next prompt before
+printing the status of a background job that changes status or a foreground
+job that terminates due to a signal.
+Non-interactive shells print status messages after a foreground job completes.
@item
Alias expansion is always enabled, even in non-interactive shells.
The shell learns immediately whenever a job changes state.
Normally, Bash waits until it is about to print a prompt
before reporting changes in a job's status so as to not interrupt
-any other output.
+any other output,
+though it will notify of changes in a job's status after a command in
+a list completes, before executing the next command.
If the @option{-b} option to the @code{set} builtin is enabled,
Bash reports such changes immediately (@pxref{The Set Builtin}).
Any trap on @code{SIGCHLD} is executed for each child process
Copyright (C) 1988-2024 Free Software Foundation, Inc.
@end ignore
-@set LASTCHANGE Mon Aug 26 11:29:52 EDT 2024
+@set LASTCHANGE Thu Sep 5 15:41:56 EDT 2024
@set EDITION 5.3
@set VERSION 5.3
-@set UPDATED 26 August 2024
-@set UPDATED-MONTH August 2024
+@set UPDATED 5 September 2024
+@set UPDATED-MONTH September 2024
if (interactive && bash_input.type != st_string && parser_expanding_alias() == 0)
{
#if defined (JOB_CONTROL)
- notify_and_cleanup ();
+ notify_and_cleanup (-1);
#endif
#if defined (READLINE)
if (no_line_editing || (bash_input.type == st_stdin && parser_will_prompt ()))
QUIT;
#if defined (JOB_CONTROL)
if (command->value.Connection->connector == ';' && job_control && interactive && posixly_correct == 0)
- notify_and_cleanup ();
+ notify_and_cleanup (-1);
#endif
optimize_connection_fork (command); /* XXX */
exec_result = execute_command_internal (command->value.Connection->second,
#define UTF8_SINGLEBYTE(c) (1)
#define UTF8_MBFIRSTCHAR(c) (0)
-#defined VALID_SINGLEBYTE_CHAR(c) (1)
+#define VALID_SINGLEBYTE_CHAR(c) (1)
#endif /* !HANDLE_MULTIBYTE */
static int job_killed_by_signal (int);
-static void notify_of_job_status (void);
+static inline void maybe_print_job_notifications (int);
+static void notify_of_job_status (int);
static void reset_job_indices (void);
static void cleanup_dead_jobs (void);
static int processes_in_job (int);
the shell is not interactive, make sure we turn on the notify bit
so we don't get an unwanted message about the job's termination,
and so delete_job really clears the slot in the jobs table. */
- notify_and_cleanup ();
+ if (posixly_correct == 0 || (interactive_shell == 0 || interactive == 0))
+ notify_and_cleanup (job);
}
wait_for_return:
}
if (jobs_list_frozen == 0) /* must be running a funsub to get here */
{
- notify_of_job_status (); /* XXX */
+#if 1
+ notify_of_job_status (i); /* XXX */
+#else
+ maybe_print_job_notifications (i);
+#endif
/* kre@munnari.oz.au 01/30/2024 */
delete_job (i, posixly_correct ? DEL_NOBGPID : 0);
/* Print info about dead jobs, and then delete them from the list
of known jobs. This does not actually delete jobs when the
shell is not interactive, because the dead jobs are not marked
- as notified. */
+ as notified.
+ If JOB is >= 0, only print info about that job and then clean it up. */
void
-notify_and_cleanup (void)
+notify_and_cleanup (int job)
{
if (jobs_list_frozen > 0)
return;
- if (want_job_notifications || interactive || interactive_shell == 0)
- notify_of_job_status ();
- else if (interactive_shell && sourcelevel && shell_compatibility_level <= 52)
- notify_of_job_status (); /* XXX - was not dependent on BASH_COMPAT */
+ maybe_print_job_notifications (job);
if (jobs_list_frozen < 0)
return; /* status changes only */
that this process belongs to is no longer running, then notify the user
of that fact now. */
if (children_exited && asynchronous_notification && interactive && executing_builtin == 0)
- notify_of_job_status ();
+ notify_of_job_status (-1);
return (children_exited);
}
}
/* Function to call when you want to notify people of changes
- in job status. This prints out all jobs which are pending
- notification to stderr, and marks those printed as already
- notified, thus making them candidates for cleanup. */
+ in job status. This prints out all requested jobs which are
+ pending notification to stderr, and marks those printed as
+ notified, thus making them candidates for cleanup.
+ if WANTED is >=0, we print information only about that job;
+ otherwise we print all jobs whose status has changed. */
static void
-notify_of_job_status (void)
+notify_of_job_status (int wanted)
{
register int job, termsig;
char *dir;
/* XXX could use js.j_firstj here */
for (job = 0, dir = NULL; job < js.j_jobslots; job++)
{
+ if (wanted >= 0 && job != wanted)
+ continue;
+
if (jobs[job] && IS_NOTIFIED (job) == 0)
{
s = raw_job_exit_status (job);
queue_sigchld--;
}
+/* Use this to determine when to conditionally print job notifications. We
+ print notifications if another part of the shell forces it, if we are
+ currently interactive, or if we are not an interactive shell. For
+ compatibility, we can also print notifications if we are sourcing a file
+ in an interactive shell.
+ In a separate inline function so the conditions are in one place. */
+static inline void
+maybe_print_job_notifications (int job)
+{
+ if (want_job_notifications || interactive || interactive_shell == 0)
+ notify_of_job_status (job);
+}
+
/* Initialize the job control mechanism, and set up the tty stuff. */
int
initialize_job_control (int force)
extern void wait_sigint_cleanup (void);
-extern void notify_and_cleanup (void);
+extern void notify_and_cleanup (int);
extern void reap_dead_jobs (void);
extern int start_job (int, int);
extern int kill_pid (pid_t, int, int);
truncate_write:
tempname = history_tempfile (filename);
+ rv = 0;
if ((file = open (tempname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600)) != -1)
{
if (write (file, bp, chars_read - (bp - buffer)) < 0)
of a trap, when the trap is called from flush_child. This call
had better not cause jobs to disappear from the job table in
that case, or we will have big trouble. */
- notify_and_cleanup ();
+ notify_and_cleanup (-1);
#else /* !JOB_CONTROL */
cleanup_dead_jobs ();
#endif /* !JOB_CONTROL */
if (job_control && pipeline_pgrp > 0 && ((subshell_environment & (SUBSHELL_ASYNC|SUBSHELL_PIPE)) == 0))
give_terminal_to (pipeline_pgrp, 1);
- notify_and_cleanup ();
+ notify_and_cleanup (-1);
#endif
#if defined (DEBUGGER)