the SIGCONT succeeds or if the process has terminated so we can
clean it up later.
Report from Earl Chew <earl_chew@yahoo.com>
+
+make_cmd.c
+ - make_simple_command,make_bare_simple_command: now take line number as
+ an argument; used instead of line_number to set the line associated
+ with the simple command
+
+make_cmd.h
+ - make_simple_command,make_bare_simple_command: change prototype
+
+parse.y,builtins/command.def,builtins.jobs.def
+ - make_simple_command,make_bare_simple_command: change callers
+
+ 7/25
+ ----
+parse.y
+ - read_token_word: try to keep track of whether we are parsing the
+ first word of a simple command and set simplecmd_lineno if we
+ are. We start a simple command when we return ASSIGNMENT_WORD
+ or WORD in a command token position. This gives better values for
+ $LINENO in multi-line simple commands
+ - redirection: set simplecmd_lineno if it's -1, meaning this is a
+ simple command with a leading redirection or a null command with
+ only a redirection
+ - pass simplecmd_lineno to make_simple_command if we are starting a
+ simple command (the first ELEMENT)
+ - parse_comsub,xparse_dolparen: save and restore simplecmd_lineno
+ - simple_command,function_def production: reset simplecmd_lineno to -1
+ after parsing a simple command or a function declared as WORD()
+
+ 7/26
+ ----
+doc/bash.1,doc/bashref.texi
+ - xpg_echo: add description of how this can be used to suppress echo
+ option interpretation
+ Inspired by report from Zachary Santer <zsanter@gmail.com>
+
+ 7/27
+ ----
+builtins/printf.def
+ - printf_erange: make out-of-range errors conversion errors even if
+ the conversion function fully consumes the argument.
+ From a report by thomas@habets.se
#include "../shell.h"
#include "../execute_cmd.h"
#include "../flags.h"
+#include "../parser.h"
#include "bashgetopt.h"
#include "common.h"
/* We don't want this to be reparsed (consider command echo 'foo &'), so
just make a simple_command structure and call execute_command with it. */
- command = make_bare_simple_command ();
+ command = make_bare_simple_command (line_number);
command->value.Simple->words = (WORD_LIST *)copy_word_list (list);
command->value.Simple->redirects = (REDIRECT *)NULL;
command->flags |= COMMAND_BUILTIN_FLAGS;
old_quoting = rl_filename_quoting_desired;
old_suppress = rl_completion_suppress_append;
+ bashline_set_filename_hooks ();
+
/* probably don't have to save these, just being safe */
old_line = pcomp_line;
old_ind = pcomp_ind;
#include "../shell.h"
#include "../jobs.h"
#include "../execute_cmd.h"
+#include "../parser.h"
#include "bashgetopt.h"
#include "common.h"
/* Next make a new simple command and execute it. */
begin_unwind_frame ("jobs_builtin");
- command = make_bare_simple_command ();
+ command = make_bare_simple_command (line_number);
command->value.Simple->words = copy_word_list (list);
command->value.Simple->redirects = (REDIRECT *)NULL;
command->flags |= CMD_INHIBIT_EXPANSION;
static void
printf_erange (char *s)
{
- builtin_error (_("warning: %s: %s"), s, strerror(ERANGE));
+ builtin_error (_("%s: %s"), s, strerror(ERANGE));
+ conversion_error = 1;
}
/* We duplicate a lot of what printf(3) does here. */
characters is enabled. The -\b-E\bE option disables the interpreta-
tion of these escape characters, even on systems where they are
interpreted by default. The x\bxp\bpg\bg_\b_e\bec\bch\bho\bo shell option may be used
- to dynamically determine whether or not e\bec\bch\bho\bo expands these es-
- cape characters by default. e\bec\bch\bho\bo does not interpret -\b--\b- to mean
- the end of options. e\bec\bch\bho\bo interprets the following escape se-
- quences:
+ to dynamically determine whether or not e\bec\bch\bho\bo interprets any op-
+ tions and expands these escape characters by default. e\bec\bch\bho\bo does
+ not interpret -\b--\b- to mean the end of options. e\bec\bch\bho\bo interprets
+ the following escape sequences:
\\b\a\ba alert (bell)
\\b\b\bb backspace
\\b\c\bc suppress further output
x\bxp\bpg\bg_\b_e\bec\bch\bho\bo
If set, the e\bec\bch\bho\bo builtin expands backslash-escape se-
- quences by default.
+ quences by default. If the p\bpo\bos\bsi\bix\bx shell option is also
+ enabled, e\bec\bch\bho\bo does not interpret any options.
s\bsu\bus\bsp\bpe\ben\bnd\bd [-\b-f\bf]
- Suspend the execution of this shell until it receives a S\bSI\bIG\bGC\bCO\bON\bNT\bT
- signal. A login shell, or a shell without job control enabled,
- cannot be suspended; the -\b-f\bf option can be used to override this
- and force the suspension. The return status is 0 unless the
- shell is a login shell or job control is not enabled and -\b-f\bf is
+ Suspend the execution of this shell until it receives a S\bSI\bIG\bGC\bCO\bON\bNT\bT
+ signal. A login shell, or a shell without job control enabled,
+ cannot be suspended; the -\b-f\bf option can be used to override this
+ and force the suspension. The return status is 0 unless the
+ shell is a login shell or job control is not enabled and -\b-f\bf is
not supplied.
t\bte\bes\bst\bt _\be_\bx_\bp_\br
[\b[ _\be_\bx_\bp_\br ]\b]
Return a status of 0 (true) or 1 (false) depending on the evalu-
ation of the conditional expression _\be_\bx_\bp_\br. Each operator and op-
- erand must be a separate argument. Expressions are composed of
- the primaries described above under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS.
- t\bte\bes\bst\bt does not accept any options, nor does it accept and ignore
+ erand must be a separate argument. Expressions are composed of
+ the primaries described above under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS.
+ t\bte\bes\bst\bt does not accept any options, nor does it accept and ignore
an argument of -\b--\b- as signifying the end of options.
- Expressions may be combined using the following operators,
- listed in decreasing order of precedence. The evaluation de-
- pends on the number of arguments; see below. Operator prece-
+ Expressions may be combined using the following operators,
+ listed in decreasing order of precedence. The evaluation de-
+ pends on the number of arguments; see below. Operator prece-
dence is used when there are five or more arguments.
!\b! _\be_\bx_\bp_\br True if _\be_\bx_\bp_\br is false.
(\b( _\be_\bx_\bp_\br )\b)
- Returns the value of _\be_\bx_\bp_\br. This may be used to override
+ Returns the value of _\be_\bx_\bp_\br. This may be used to override
the normal precedence of operators.
_\be_\bx_\bp_\br_\b1 -a\ba _\be_\bx_\bp_\br_\b2
True if both _\be_\bx_\bp_\br_\b1 and _\be_\bx_\bp_\br_\b2 are true.
null.
2 arguments
If the first argument is !\b!, the expression is true if and
- only if the second argument is null. If the first argu-
- ment is one of the unary conditional operators listed
- above under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS, the expression is
+ only if the second argument is null. If the first argu-
+ ment is one of the unary conditional operators listed
+ above under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS, the expression is
true if the unary test is true. If the first argument is
not a valid unary conditional operator, the expression is
false.
3 arguments
The following conditions are applied in the order listed.
- If the second argument is one of the binary conditional
+ If the second argument is one of the binary conditional
operators listed above under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS, the
result of the expression is the result of the binary test
- using the first and third arguments as operands. The -\b-a\ba
- and -\b-o\bo operators are considered binary operators when
- there are three arguments. If the first argument is !\b!,
- the value is the negation of the two-argument test using
+ using the first and third arguments as operands. The -\b-a\ba
+ and -\b-o\bo operators are considered binary operators when
+ there are three arguments. If the first argument is !\b!,
+ the value is the negation of the two-argument test using
the second and third arguments. If the first argument is
exactly (\b( and the third argument is exactly )\b), the result
- is the one-argument test of the second argument. Other-
+ is the one-argument test of the second argument. Other-
wise, the expression is false.
4 arguments
The following conditions are applied in the order listed.
If the first argument is !\b!, the result is the negation of
- the three-argument expression composed of the remaining
- arguments. the two-argument test using the second and
- third arguments. If the first argument is exactly (\b( and
- the fourth argument is exactly )\b), the result is the two-
- argument test of the second and third arguments. Other-
+ the three-argument expression composed of the remaining
+ arguments. the two-argument test using the second and
+ third arguments. If the first argument is exactly (\b( and
+ the fourth argument is exactly )\b), the result is the two-
+ argument test of the second and third arguments. Other-
wise, the expression is parsed and evaluated according to
precedence using the rules listed above.
5 or more arguments
- The expression is parsed and evaluated according to
+ The expression is parsed and evaluated according to
precedence using the rules listed above.
If the shell is not in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, when used with t\bte\bes\bst\bt or [\b[, the
- <\b< and >\b> operators sort lexicographically using ASCII ordering.
- When the shell is in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, these operators sort using the
+ <\b< and >\b> operators sort lexicographically using ASCII ordering.
+ When the shell is in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, these operators sort using the
current locale.
- t\bti\bim\bme\bes\bs Print the accumulated user and system times for the shell and
+ t\bti\bim\bme\bes\bs Print the accumulated user and system times for the shell and
for processes run from the shell. The return status is 0.
t\btr\bra\bap\bp [-\b-l\blp\bp] [[_\ba_\bc_\bt_\bi_\bo_\bn] _\bs_\bi_\bg_\bs_\bp_\be_\bc ...]
The _\ba_\bc_\bt_\bi_\bo_\bn is a command that is read and executed when the shell
receives signal(s) _\bs_\bi_\bg_\bs_\bp_\be_\bc. If _\ba_\bc_\bt_\bi_\bo_\bn is absent (and there is a
- single _\bs_\bi_\bg_\bs_\bp_\be_\bc) or -\b-, each specified signal is reset to its
- original disposition (the value it had upon entrance to the
- shell). If _\ba_\bc_\bt_\bi_\bo_\bn is the null string the signal specified by
- each _\bs_\bi_\bg_\bs_\bp_\be_\bc is ignored by the shell and by the commands it in-
+ single _\bs_\bi_\bg_\bs_\bp_\be_\bc) or -\b-, each specified signal is reset to its
+ original disposition (the value it had upon entrance to the
+ shell). If _\ba_\bc_\bt_\bi_\bo_\bn is the null string the signal specified by
+ each _\bs_\bi_\bg_\bs_\bp_\be_\bc is ignored by the shell and by the commands it in-
vokes.
- If no arguments are supplied, t\btr\bra\bap\bp displays the actions associ-
+ If no arguments are supplied, t\btr\bra\bap\bp displays the actions associ-
ated with each trapped signal as a set of t\btr\bra\bap\bp commands that can
- be reused as shell input to restore the current signal disposi-
- tions. If -\b-p\bp is given, and _\ba_\bc_\bt_\bi_\bo_\bn is not present, then t\btr\bra\bap\bp
- displays the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc or, if none
+ be reused as shell input to restore the current signal disposi-
+ tions. If -\b-p\bp is given, and _\ba_\bc_\bt_\bi_\bo_\bn is not present, then t\btr\bra\bap\bp
+ displays the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc or, if none
are supplied, for all trapped signals, as a set of t\btr\bra\bap\bp commands
- that can be reused as shell input to restore the current signal
- dispositions. The -\b-P\bP option behaves similarly, but displays
- only the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. -\b-P\bP re-
- quires at least one _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. The -\b-P\bP or -\b-p\bp options to
- t\btr\bra\bap\bp may be used in a subshell environment (e.g., command sub-
- stitution) and, as long as they are used before t\btr\bra\bap\bp is used to
- change a signal's handling, will display the state of its par-
+ that can be reused as shell input to restore the current signal
+ dispositions. The -\b-P\bP option behaves similarly, but displays
+ only the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. -\b-P\bP re-
+ quires at least one _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. The -\b-P\bP or -\b-p\bp options to
+ t\btr\bra\bap\bp may be used in a subshell environment (e.g., command sub-
+ stitution) and, as long as they are used before t\btr\bra\bap\bp is used to
+ change a signal's handling, will display the state of its par-
ent's traps.
- The -\b-l\bl option causes t\btr\bra\bap\bp to print a list of signal names and
- their corresponding numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal
- name defined in <_\bs_\bi_\bg_\bn_\ba_\bl_\b._\bh>, or a signal number. Signal names
+ The -\b-l\bl option causes t\btr\bra\bap\bp to print a list of signal names and
+ their corresponding numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal
+ name defined in <_\bs_\bi_\bg_\bn_\ba_\bl_\b._\bh>, or a signal number. Signal names
are case insensitive and the S\bSI\bIG\bG prefix is optional.
- If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bEX\bXI\bIT\bT (0) the command _\ba_\bc_\bt_\bi_\bo_\bn is executed on exit
- from the shell. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is D\bDE\bEB\bBU\bUG\bG, the command _\ba_\bc_\bt_\bi_\bo_\bn is
+ If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bEX\bXI\bIT\bT (0) the command _\ba_\bc_\bt_\bi_\bo_\bn is executed on exit
+ from the shell. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is D\bDE\bEB\bBU\bUG\bG, the command _\ba_\bc_\bt_\bi_\bo_\bn is
executed before every _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd, _\bf_\bo_\br command, _\bc_\ba_\bs_\be command,
- _\bs_\be_\bl_\be_\bc_\bt command, (( arithmetic command, [[ conditional command,
+ _\bs_\be_\bl_\be_\bc_\bt command, (( arithmetic command, [[ conditional command,
arithmetic _\bf_\bo_\br command, and before the first command executes in
- a shell function (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR above). Refer to the de-
- scription of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the s\bsh\bho\bop\bpt\bt builtin for de-
- tails of its effect on the D\bDE\bEB\bBU\bUG\bG trap. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is R\bRE\bET\bTU\bUR\bRN\bN,
- the command _\ba_\bc_\bt_\bi_\bo_\bn is executed each time a shell function or a
- script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins finishes execut-
+ a shell function (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR above). Refer to the de-
+ scription of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the s\bsh\bho\bop\bpt\bt builtin for de-
+ tails of its effect on the D\bDE\bEB\bBU\bUG\bG trap. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is R\bRE\bET\bTU\bUR\bRN\bN,
+ the command _\ba_\bc_\bt_\bi_\bo_\bn is executed each time a shell function or a
+ script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins finishes execut-
ing.
- If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bER\bRR\bR, the command _\ba_\bc_\bt_\bi_\bo_\bn is executed whenever a
+ If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bER\bRR\bR, the command _\ba_\bc_\bt_\bi_\bo_\bn is executed whenever a
pipeline (which may consist of a single simple command), a list,
or a compound command returns a non-zero exit status, subject to
- the following conditions. The E\bER\bRR\bR trap is not executed if the
+ the following conditions. The E\bER\bRR\bR trap is not executed if the
failed command is part of the command list immediately following
- a w\bwh\bhi\bil\ble\be or u\bun\bnt\bti\bil\bl keyword, part of the test in an _\bi_\bf statement,
+ a w\bwh\bhi\bil\ble\be or u\bun\bnt\bti\bil\bl keyword, part of the test in an _\bi_\bf statement,
part of a command executed in a &\b&&\b& or |\b||\b| list except the command
- following the final &\b&&\b& or |\b||\b|, any command in a pipeline but the
- last, or if the command's return value is being inverted using
+ following the final &\b&&\b& or |\b||\b|, any command in a pipeline but the
+ last, or if the command's return value is being inverted using
!\b!. These are the same conditions obeyed by the e\ber\brr\bre\bex\bxi\bit\bt (-\b-e\be) op-
tion.
When the shell is not interactive, signals ignored upon entry to
the shell cannot be trapped or reset. Interactive shells permit
trapping signals ignored on entry. Trapped signals that are not
- being ignored are reset to their original values in a subshell
- or subshell environment when one is created. The return status
+ being ignored are reset to their original values in a subshell
+ or subshell environment when one is created. The return status
is false if any _\bs_\bi_\bg_\bs_\bp_\be_\bc is invalid; otherwise t\btr\bra\bap\bp returns true.
t\btr\bru\bue\be Does nothing, returns a 0 status.
t\bty\byp\bpe\be [-\b-a\baf\bft\btp\bpP\bP] _\bn_\ba_\bm_\be [_\bn_\ba_\bm_\be ...]
- With no options, indicate how each _\bn_\ba_\bm_\be would be interpreted if
+ With no options, indicate how each _\bn_\ba_\bm_\be would be interpreted if
used as a command name. If the -\b-t\bt option is used, t\bty\byp\bpe\be prints a
- string which is one of _\ba_\bl_\bi_\ba_\bs, _\bk_\be_\by_\bw_\bo_\br_\bd, _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn, _\bb_\bu_\bi_\bl_\bt_\bi_\bn, or
- _\bf_\bi_\bl_\be if _\bn_\ba_\bm_\be is an alias, shell reserved word, function,
- builtin, or executable disk file, respectively. If the _\bn_\ba_\bm_\be is
- not found, then nothing is printed, and t\bty\byp\bpe\be returns a non-zero
- exit status. If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the
- name of the executable file that would be found by searching
- $\b$P\bPA\bAT\bTH\bH if _\bn_\ba_\bm_\be were specified as a command name, or nothing if
- ``type -t name'' would not return _\bf_\bi_\bl_\be. The -\b-P\bP option forces a
- P\bPA\bAT\bTH\bH search for each _\bn_\ba_\bm_\be, even if ``type -t name'' would not
+ string which is one of _\ba_\bl_\bi_\ba_\bs, _\bk_\be_\by_\bw_\bo_\br_\bd, _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn, _\bb_\bu_\bi_\bl_\bt_\bi_\bn, or
+ _\bf_\bi_\bl_\be if _\bn_\ba_\bm_\be is an alias, shell reserved word, function,
+ builtin, or executable disk file, respectively. If the _\bn_\ba_\bm_\be is
+ not found, then nothing is printed, and t\bty\byp\bpe\be returns a non-zero
+ exit status. If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the
+ name of the executable file that would be found by searching
+ $\b$P\bPA\bAT\bTH\bH if _\bn_\ba_\bm_\be were specified as a command name, or nothing if
+ ``type -t name'' would not return _\bf_\bi_\bl_\be. The -\b-P\bP option forces a
+ P\bPA\bAT\bTH\bH search for each _\bn_\ba_\bm_\be, even if ``type -t name'' would not
return _\bf_\bi_\bl_\be. If a command is hashed, -\b-p\bp and -\b-P\bP print the hashed
- value, which is not necessarily the file that appears first in
- P\bPA\bAT\bTH\bH. If the -\b-a\ba option is used, t\bty\byp\bpe\be prints all of the places
- that contain a command named _\bn_\ba_\bm_\be. This includes aliases, re-
- served words, functions, and builtins, but the path search op-
+ value, which is not necessarily the file that appears first in
+ P\bPA\bAT\bTH\bH. If the -\b-a\ba option is used, t\bty\byp\bpe\be prints all of the places
+ that contain a command named _\bn_\ba_\bm_\be. This includes aliases, re-
+ served words, functions, and builtins, but the path search op-
tions (-\b-p\bp and -\b-P\bP) can be supplied to restrict the output to exe-
- cutable files. t\bty\byp\bpe\be does not consult the table of hashed com-
+ cutable files. t\bty\byp\bpe\be does not consult the table of hashed com-
mands when using -\b-a\ba with -\b-p\bp, and only performs a P\bPA\bAT\bTH\bH search for
- _\bn_\ba_\bm_\be. The -\b-f\bf option suppresses shell function lookup, as with
- the c\bco\bom\bmm\bma\ban\bnd\bd builtin. t\bty\byp\bpe\be returns true if all of the arguments
+ _\bn_\ba_\bm_\be. The -\b-f\bf option suppresses shell function lookup, as with
+ the c\bco\bom\bmm\bma\ban\bnd\bd builtin. t\bty\byp\bpe\be returns true if all of the arguments
are found, false if any are not found.
u\bul\bli\bim\bmi\bit\bt [-\b-H\bHS\bS] -\b-a\ba
u\bul\bli\bim\bmi\bit\bt [-\b-H\bHS\bS] [-\b-b\bbc\bcd\bde\bef\bfi\bik\bkl\blm\bmn\bnp\bpq\bqr\brs\bst\btu\buv\bvx\bxP\bPR\bRT\bT [_\bl_\bi_\bm_\bi_\bt]]
- Provides control over the resources available to the shell and
- to processes started by it, on systems that allow such control.
+ Provides control over the resources available to the shell and
+ to processes started by it, on systems that allow such control.
The -\b-H\bH and -\b-S\bS options specify that the hard or soft limit is set
- for the given resource. A hard limit cannot be increased by a
- non-root user once it is set; a soft limit may be increased up
- to the value of the hard limit. If neither -\b-H\bH nor -\b-S\bS is speci-
+ for the given resource. A hard limit cannot be increased by a
+ non-root user once it is set; a soft limit may be increased up
+ to the value of the hard limit. If neither -\b-H\bH nor -\b-S\bS is speci-
fied, both the soft and hard limits are set. The value of _\bl_\bi_\bm_\bi_\bt
can be a number in the unit specified for the resource or one of
the special values h\bha\bar\brd\bd, s\bso\bof\bft\bt, or u\bun\bnl\bli\bim\bmi\bit\bte\bed\bd, which stand for the
- current hard limit, the current soft limit, and no limit, re-
- spectively. If _\bl_\bi_\bm_\bi_\bt is omitted, the current value of the soft
+ current hard limit, the current soft limit, and no limit, re-
+ spectively. If _\bl_\bi_\bm_\bi_\bt is omitted, the current value of the soft
limit of the resource is printed, unless the -\b-H\bH option is given.
- When more than one resource is specified, the limit name and
- unit, if appropriate, are printed before the value. Other op-
+ When more than one resource is specified, the limit name and
+ unit, if appropriate, are printed before the value. Other op-
tions are interpreted as follows:
-\b-a\ba All current limits are reported; no limits are set
-\b-b\bb The maximum socket buffer size
-\b-c\bc The maximum size of core files created
-\b-d\bd The maximum size of a process's data segment
-\b-e\be The maximum scheduling priority ("nice")
- -\b-f\bf The maximum size of files written by the shell and its
+ -\b-f\bf The maximum size of files written by the shell and its
children
-\b-i\bi The maximum number of pending signals
-\b-k\bk The maximum number of kqueues that may be allocated
-\b-l\bl The maximum size that may be locked into memory
- -\b-m\bm The maximum resident set size (many systems do not honor
+ -\b-m\bm The maximum resident set size (many systems do not honor
this limit)
-\b-n\bn The maximum number of open file descriptors (most systems
do not allow this value to be set)
-\b-r\br The maximum real-time scheduling priority
-\b-s\bs The maximum stack size
-\b-t\bt The maximum amount of cpu time in seconds
- -\b-u\bu The maximum number of processes available to a single
+ -\b-u\bu The maximum number of processes available to a single
user
- -\b-v\bv The maximum amount of virtual memory available to the
+ -\b-v\bv The maximum amount of virtual memory available to the
shell and, on some systems, to its children
-\b-x\bx The maximum number of file locks
-\b-P\bP The maximum number of pseudoterminals
- -\b-R\bR The maximum time a real-time process can run before
+ -\b-R\bR The maximum time a real-time process can run before
blocking, in microseconds
-\b-T\bT The maximum number of threads
- If _\bl_\bi_\bm_\bi_\bt is given, and the -\b-a\ba option is not used, _\bl_\bi_\bm_\bi_\bt is the
- new value of the specified resource. If no option is given,
- then -\b-f\bf is assumed. Values are in 1024-byte increments, except
- for -\b-t\bt, which is in seconds; -\b-R\bR, which is in microseconds; -\b-p\bp,
- which is in units of 512-byte blocks; -\b-P\bP, -\b-T\bT, -\b-b\bb, -\b-k\bk, -\b-n\bn, and
- -\b-u\bu, which are unscaled values; and, when in posix mode, -\b-c\bc and
- -\b-f\bf, which are in 512-byte increments. The return status is 0
- unless an invalid option or argument is supplied, or an error
+ If _\bl_\bi_\bm_\bi_\bt is given, and the -\b-a\ba option is not used, _\bl_\bi_\bm_\bi_\bt is the
+ new value of the specified resource. If no option is given,
+ then -\b-f\bf is assumed. Values are in 1024-byte increments, except
+ for -\b-t\bt, which is in seconds; -\b-R\bR, which is in microseconds; -\b-p\bp,
+ which is in units of 512-byte blocks; -\b-P\bP, -\b-T\bT, -\b-b\bb, -\b-k\bk, -\b-n\bn, and
+ -\b-u\bu, which are unscaled values; and, when in posix mode, -\b-c\bc and
+ -\b-f\bf, which are in 512-byte increments. The return status is 0
+ unless an invalid option or argument is supplied, or an error
occurs while setting a new limit.
u\bum\bma\bas\bsk\bk [-\b-p\bp] [-\b-S\bS] [_\bm_\bo_\bd_\be]
The user file-creation mask is set to _\bm_\bo_\bd_\be. If _\bm_\bo_\bd_\be begins with
- a digit, it is interpreted as an octal number; otherwise it is
- interpreted as a symbolic mode mask similar to that accepted by
- _\bc_\bh_\bm_\bo_\bd(1). If _\bm_\bo_\bd_\be is omitted, the current value of the mask is
- printed. The -\b-S\bS option causes the mask to be printed in sym-
- bolic form; the default output is an octal number. If the -\b-p\bp
+ a digit, it is interpreted as an octal number; otherwise it is
+ interpreted as a symbolic mode mask similar to that accepted by
+ _\bc_\bh_\bm_\bo_\bd(1). If _\bm_\bo_\bd_\be is omitted, the current value of the mask is
+ printed. The -\b-S\bS option causes the mask to be printed in sym-
+ bolic form; the default output is an octal number. If the -\b-p\bp
option is supplied, and _\bm_\bo_\bd_\be is omitted, the output is in a form
that may be reused as input. The return status is 0 if the mode
- was successfully changed or if no _\bm_\bo_\bd_\be argument was supplied,
+ was successfully changed or if no _\bm_\bo_\bd_\be argument was supplied,
and false otherwise.
u\bun\bna\bal\bli\bia\bas\bs [-a\ba] [_\bn_\ba_\bm_\be ...]
- Remove each _\bn_\ba_\bm_\be from the list of defined aliases. If -\b-a\ba is
- supplied, all alias definitions are removed. The return value
+ Remove each _\bn_\ba_\bm_\be from the list of defined aliases. If -\b-a\ba is
+ supplied, all alias definitions are removed. The return value
is true unless a supplied _\bn_\ba_\bm_\be is not a defined alias.
u\bun\bns\bse\bet\bt [-f\bfv\bv] [-n\bn] [_\bn_\ba_\bm_\be ...]
- For each _\bn_\ba_\bm_\be, remove the corresponding variable or function.
+ For each _\bn_\ba_\bm_\be, remove the corresponding variable or function.
If the -\b-v\bv option is given, each _\bn_\ba_\bm_\be refers to a shell variable,
- and that variable is removed. Read-only variables may not be
- unset. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be refers to a shell func-
- tion, and the function definition is removed. If the -\b-n\bn option
- is supplied, and _\bn_\ba_\bm_\be is a variable with the _\bn_\ba_\bm_\be_\br_\be_\bf attribute,
- _\bn_\ba_\bm_\be will be unset rather than the variable it references. -\b-n\bn
- has no effect if the -\b-f\bf option is supplied. If no options are
- supplied, each _\bn_\ba_\bm_\be refers to a variable; if there is no vari-
- able by that name, a function with that name, if any, is unset.
- Each unset variable or function is removed from the environment
- passed to subsequent commands. If any of B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS,
+ and that variable is removed. Read-only variables may not be
+ unset. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be refers to a shell func-
+ tion, and the function definition is removed. If the -\b-n\bn option
+ is supplied, and _\bn_\ba_\bm_\be is a variable with the _\bn_\ba_\bm_\be_\br_\be_\bf attribute,
+ _\bn_\ba_\bm_\be will be unset rather than the variable it references. -\b-n\bn
+ has no effect if the -\b-f\bf option is supplied. If no options are
+ supplied, each _\bn_\ba_\bm_\be refers to a variable; if there is no vari-
+ able by that name, a function with that name, if any, is unset.
+ Each unset variable or function is removed from the environment
+ passed to subsequent commands. If any of B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS,
B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV0\b0, B\bBA\bAS\bSH\bH_\b_C\bCM\bMD\bDS\bS, B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD, B\bBA\bAS\bSH\bH_\b_S\bSU\bUB\bBS\bSH\bHE\bEL\bLL\bL, B\bBA\bAS\bSH\bHP\bPI\bID\bD,
- C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS, D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK, E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE, E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS, F\bFU\bUN\bNC\bC-\b-
- N\bNA\bAM\bME\bE, G\bGR\bRO\bOU\bUP\bPS\bS, H\bHI\bIS\bST\bTC\bCM\bMD\bD, L\bLI\bIN\bNE\bEN\bNO\bO, R\bRA\bAN\bND\bDO\bOM\bM, S\bSE\bEC\bCO\bON\bND\bDS\bS, or S\bSR\bRA\bAN\bND\bDO\bOM\bM are
+ C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS, D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK, E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE, E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS, F\bFU\bUN\bNC\bC-\b-
+ N\bNA\bAM\bME\bE, G\bGR\bRO\bOU\bUP\bPS\bS, H\bHI\bIS\bST\bTC\bCM\bMD\bD, L\bLI\bIN\bNE\bEN\bNO\bO, R\bRA\bAN\bND\bDO\bOM\bM, S\bSE\bEC\bCO\bON\bND\bDS\bS, or S\bSR\bRA\bAN\bND\bDO\bOM\bM are
unset, they lose their special properties, even if they are sub-
sequently reset. The exit status is true unless a _\bn_\ba_\bm_\be is read-
only or may not be unset.
w\bwa\bai\bit\bt [-\b-f\bfn\bn] [-\b-p\bp _\bv_\ba_\br_\bn_\ba_\bm_\be] [_\bi_\bd _\b._\b._\b.]
Wait for each specified child process and return its termination
- status. Each _\bi_\bd may be a process ID or a job specification; if
- a job spec is given, all processes in that job's pipeline are
- waited for. If _\bi_\bd is not given, w\bwa\bai\bit\bt waits for all running
- background jobs and the last-executed process substitution, if
+ status. Each _\bi_\bd may be a process ID or a job specification; if
+ a job spec is given, all processes in that job's pipeline are
+ waited for. If _\bi_\bd is not given, w\bwa\bai\bit\bt waits for all running
+ background jobs and the last-executed process substitution, if
its process id is the same as $\b$!\b!, and the return status is zero.
- If the -\b-n\bn option is supplied, w\bwa\bai\bit\bt waits for a single job from
+ If the -\b-n\bn option is supplied, w\bwa\bai\bit\bt waits for a single job from
the list of _\bi_\bds or, if no _\bi_\bds are supplied, any job, to complete
- and returns its exit status. If none of the supplied arguments
+ and returns its exit status. If none of the supplied arguments
is a child of the shell, or if no arguments are supplied and the
- shell has no unwaited-for children, the exit status is 127. If
- the -\b-p\bp option is supplied, the process or job identifier of the
- job for which the exit status is returned is assigned to the
- variable _\bv_\ba_\br_\bn_\ba_\bm_\be named by the option argument. The variable
- will be unset initially, before any assignment. This is useful
- only when the -\b-n\bn option is supplied. Supplying the -\b-f\bf option,
- when job control is enabled, forces w\bwa\bai\bit\bt to wait for _\bi_\bd to ter-
+ shell has no unwaited-for children, the exit status is 127. If
+ the -\b-p\bp option is supplied, the process or job identifier of the
+ job for which the exit status is returned is assigned to the
+ variable _\bv_\ba_\br_\bn_\ba_\bm_\be named by the option argument. The variable
+ will be unset initially, before any assignment. This is useful
+ only when the -\b-n\bn option is supplied. Supplying the -\b-f\bf option,
+ when job control is enabled, forces w\bwa\bai\bit\bt to wait for _\bi_\bd to ter-
minate before returning its status, instead of returning when it
- changes status. If _\bi_\bd specifies a non-existent process or job,
- the return status is 127. If w\bwa\bai\bit\bt is interrupted by a signal,
- the return status will be greater than 128, as described under
- S\bSI\bIG\bGN\bNA\bAL\bLS\bS above. Otherwise, the return status is the exit status
+ changes status. If _\bi_\bd specifies a non-existent process or job,
+ the return status is 127. If w\bwa\bai\bit\bt is interrupted by a signal,
+ the return status will be greater than 128, as described under
+ S\bSI\bIG\bGN\bNA\bAL\bLS\bS above. Otherwise, the return status is the exit status
of the last process or job waited for.
S\bSH\bHE\bEL\bLL\bL C\bCO\bOM\bMP\bPA\bAT\bTI\bIB\bBI\bIL\bLI\bIT\bTY\bY M\bMO\bOD\bDE\bE
- Bash-4.0 introduced the concept of a _\bs_\bh_\be_\bl_\bl _\bc_\bo_\bm_\bp_\ba_\bt_\bi_\bb_\bi_\bl_\bi_\bt_\by _\bl_\be_\bv_\be_\bl, speci-
- fied as a set of options to the shopt builtin ( c\bco\bom\bmp\bpa\bat\bt3\b31\b1, c\bco\bom\bmp\bpa\bat\bt3\b32\b2,
- c\bco\bom\bmp\bpa\bat\bt4\b40\b0, c\bco\bom\bmp\bpa\bat\bt4\b41\b1, and so on). There is only one current compatibil-
- ity level -- each option is mutually exclusive. The compatibility
- level is intended to allow users to select behavior from previous ver-
- sions that is incompatible with newer versions while they migrate
- scripts to use current features and behavior. It's intended to be a
+ Bash-4.0 introduced the concept of a _\bs_\bh_\be_\bl_\bl _\bc_\bo_\bm_\bp_\ba_\bt_\bi_\bb_\bi_\bl_\bi_\bt_\by _\bl_\be_\bv_\be_\bl, speci-
+ fied as a set of options to the shopt builtin ( c\bco\bom\bmp\bpa\bat\bt3\b31\b1, c\bco\bom\bmp\bpa\bat\bt3\b32\b2,
+ c\bco\bom\bmp\bpa\bat\bt4\b40\b0, c\bco\bom\bmp\bpa\bat\bt4\b41\b1, and so on). There is only one current compatibil-
+ ity level -- each option is mutually exclusive. The compatibility
+ level is intended to allow users to select behavior from previous ver-
+ sions that is incompatible with newer versions while they migrate
+ scripts to use current features and behavior. It's intended to be a
temporary solution.
- This section does not mention behavior that is standard for a particu-
- lar version (e.g., setting c\bco\bom\bmp\bpa\bat\bt3\b32\b2 means that quoting the rhs of the
- regexp matching operator quotes special regexp characters in the word,
+ This section does not mention behavior that is standard for a particu-
+ lar version (e.g., setting c\bco\bom\bmp\bpa\bat\bt3\b32\b2 means that quoting the rhs of the
+ regexp matching operator quotes special regexp characters in the word,
which is default behavior in bash-3.2 and subsequent versions).
- If a user enables, say, c\bco\bom\bmp\bpa\bat\bt3\b32\b2, it may affect the behavior of other
- compatibility levels up to and including the current compatibility
- level. The idea is that each compatibility level controls behavior
- that changed in that version of b\bba\bas\bsh\bh, but that behavior may have been
- present in earlier versions. For instance, the change to use locale-
- based comparisons with the [\b[[\b[ command came in bash-4.1, and earlier
+ If a user enables, say, c\bco\bom\bmp\bpa\bat\bt3\b32\b2, it may affect the behavior of other
+ compatibility levels up to and including the current compatibility
+ level. The idea is that each compatibility level controls behavior
+ that changed in that version of b\bba\bas\bsh\bh, but that behavior may have been
+ present in earlier versions. For instance, the change to use locale-
+ based comparisons with the [\b[[\b[ command came in bash-4.1, and earlier
versions used ASCII-based comparisons, so enabling c\bco\bom\bmp\bpa\bat\bt3\b32\b2 will enable
- ASCII-based comparisons as well. That granularity may not be suffi-
- cient for all uses, and as a result users should employ compatibility
- levels carefully. Read the documentation for a particular feature to
+ ASCII-based comparisons as well. That granularity may not be suffi-
+ cient for all uses, and as a result users should employ compatibility
+ levels carefully. Read the documentation for a particular feature to
find out the current behavior.
- Bash-4.3 introduced a new shell variable: B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT. The value as-
+ Bash-4.3 introduced a new shell variable: B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT. The value as-
signed to this variable (a decimal version number like 4.2, or an inte-
- ger corresponding to the c\bco\bom\bmp\bpa\bat\bt_\bN_\bN option, like 42) determines the com-
+ ger corresponding to the c\bco\bom\bmp\bpa\bat\bt_\bN_\bN option, like 42) determines the com-
patibility level.
- Starting with bash-4.4, Bash has begun deprecating older compatibility
- levels. Eventually, the options will be removed in favor of B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bM-\b-
+ Starting with bash-4.4, Bash has begun deprecating older compatibility
+ levels. Eventually, the options will be removed in favor of B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bM-\b-
P\bPA\bAT\bT.
- Bash-5.0 is the final version for which there will be an individual
- shopt option for the previous version. Users should use B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT on
+ Bash-5.0 is the final version for which there will be an individual
+ shopt option for the previous version. Users should use B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT on
bash-5.0 and later versions.
- The following table describes the behavior changes controlled by each
+ The following table describes the behavior changes controlled by each
compatibility level setting. The c\bco\bom\bmp\bpa\bat\bt_\bN_\bN tag is used as shorthand for
setting the compatibility level to _\bN_\bN using one of the following mecha-
- nisms. For versions prior to bash-5.0, the compatibility level may be
- set using the corresponding c\bco\bom\bmp\bpa\bat\bt_\bN_\bN shopt option. For bash-4.3 and
- later versions, the B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT variable is preferred, and it is re-
+ nisms. For versions prior to bash-5.0, the compatibility level may be
+ set using the corresponding c\bco\bom\bmp\bpa\bat\bt_\bN_\bN shopt option. For bash-4.3 and
+ later versions, the B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT variable is preferred, and it is re-
quired for bash-5.1 and later versions.
c\bco\bom\bmp\bpa\bat\bt3\b31\b1
ator (=~) has no special effect
c\bco\bom\bmp\bpa\bat\bt3\b32\b2
- +\bo interrupting a command list such as "a ; b ; c" causes
- the execution of the next command in the list (in
- bash-4.0 and later versions, the shell acts as if it re-
- ceived the interrupt, so interrupting one command in a
+ +\bo interrupting a command list such as "a ; b ; c" causes
+ the execution of the next command in the list (in
+ bash-4.0 and later versions, the shell acts as if it re-
+ ceived the interrupt, so interrupting one command in a
list aborts the execution of the entire list)
c\bco\bom\bmp\bpa\bat\bt4\b40\b0
- +\bo the <\b< and >\b> operators to the [\b[[\b[ command do not consider
+ +\bo the <\b< and >\b> operators to the [\b[[\b[ command do not consider
the current locale when comparing strings; they use ASCII
ordering. Bash versions prior to bash-4.1 use ASCII col-
- lation and _\bs_\bt_\br_\bc_\bm_\bp(3); bash-4.1 and later use the current
+ lation and _\bs_\bt_\br_\bc_\bm_\bp(3); bash-4.1 and later use the current
locale's collation sequence and _\bs_\bt_\br_\bc_\bo_\bl_\bl(3).
c\bco\bom\bmp\bpa\bat\bt4\b41\b1
- +\bo in _\bp_\bo_\bs_\bi_\bx mode, t\bti\bim\bme\be may be followed by options and still
+ +\bo in _\bp_\bo_\bs_\bi_\bx mode, t\bti\bim\bme\be may be followed by options and still
be recognized as a reserved word (this is POSIX interpre-
tation 267)
+\bo in _\bp_\bo_\bs_\bi_\bx mode, the parser requires that an even number of
- single quotes occur in the _\bw_\bo_\br_\bd portion of a double-
- quoted parameter expansion and treats them specially, so
- that characters within the single quotes are considered
+ single quotes occur in the _\bw_\bo_\br_\bd portion of a double-
+ quoted parameter expansion and treats them specially, so
+ that characters within the single quotes are considered
quoted (this is POSIX interpretation 221)
c\bco\bom\bmp\bpa\bat\bt4\b42\b2
+\bo the replacement string in double-quoted pattern substitu-
- tion does not undergo quote removal, as it does in ver-
+ tion does not undergo quote removal, as it does in ver-
sions after bash-4.2
- +\bo in posix mode, single quotes are considered special when
- expanding the _\bw_\bo_\br_\bd portion of a double-quoted parameter
- expansion and can be used to quote a closing brace or
- other special character (this is part of POSIX interpre-
- tation 221); in later versions, single quotes are not
+ +\bo in posix mode, single quotes are considered special when
+ expanding the _\bw_\bo_\br_\bd portion of a double-quoted parameter
+ expansion and can be used to quote a closing brace or
+ other special character (this is part of POSIX interpre-
+ tation 221); in later versions, single quotes are not
special within double-quoted word expansions
c\bco\bom\bmp\bpa\bat\bt4\b43\b3
- +\bo the shell does not print a warning message if an attempt
- is made to use a quoted compound assignment as an argu-
- ment to declare (e.g., declare -a foo='(1 2)'). Later
+ +\bo the shell does not print a warning message if an attempt
+ is made to use a quoted compound assignment as an argu-
+ ment to declare (e.g., declare -a foo='(1 2)'). Later
versions warn that this usage is deprecated
- +\bo word expansion errors are considered non-fatal errors
- that cause the current command to fail, even in posix
- mode (the default behavior is to make them fatal errors
+ +\bo word expansion errors are considered non-fatal errors
+ that cause the current command to fail, even in posix
+ mode (the default behavior is to make them fatal errors
that cause the shell to exit)
- +\bo when executing a shell function, the loop state
+ +\bo when executing a shell function, the loop state
(while/until/etc.) is not reset, so b\bbr\bre\bea\bak\bk or c\bco\bon\bnt\bti\bin\bnu\bue\be in
that function will break or continue loops in the calling
- context. Bash-4.4 and later reset the loop state to pre-
+ context. Bash-4.4 and later reset the loop state to pre-
vent this
c\bco\bom\bmp\bpa\bat\bt4\b44\b4
- +\bo the shell sets up the values used by B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV and
- B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC so they can expand to the shell's positional
+ +\bo the shell sets up the values used by B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV and
+ B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC so they can expand to the shell's positional
parameters even if extended debugging mode is not enabled
- +\bo a subshell inherits loops from its parent context, so
- b\bbr\bre\bea\bak\bk or c\bco\bon\bnt\bti\bin\bnu\bue\be will cause the subshell to exit.
- Bash-5.0 and later reset the loop state to prevent the
+ +\bo a subshell inherits loops from its parent context, so
+ b\bbr\bre\bea\bak\bk or c\bco\bon\bnt\bti\bin\bnu\bue\be will cause the subshell to exit.
+ Bash-5.0 and later reset the loop state to prevent the
exit
- +\bo variable assignments preceding builtins like e\bex\bxp\bpo\bor\brt\bt and
+ +\bo variable assignments preceding builtins like e\bex\bxp\bpo\bor\brt\bt and
r\bre\bea\bad\bdo\bon\bnl\bly\by that set attributes continue to affect variables
with the same name in the calling environment even if the
shell is not in posix mode
c\bco\bom\bmp\bpa\bat\bt5\b50\b0
- +\bo Bash-5.1 changed the way $\b$R\bRA\bAN\bND\bDO\bOM\bM is generated to intro-
+ +\bo Bash-5.1 changed the way $\b$R\bRA\bAN\bND\bDO\bOM\bM is generated to intro-
duce slightly more randomness. If the shell compatibility
- level is set to 50 or lower, it reverts to the method
- from bash-5.0 and previous versions, so seeding the ran-
- dom number generator by assigning a value to R\bRA\bAN\bND\bDO\bOM\bM will
+ level is set to 50 or lower, it reverts to the method
+ from bash-5.0 and previous versions, so seeding the ran-
+ dom number generator by assigning a value to R\bRA\bAN\bND\bDO\bOM\bM will
produce the same sequence as in bash-5.0
- +\bo If the command hash table is empty, bash versions prior
- to bash-5.1 printed an informational message to that ef-
- fect, even when producing output that can be reused as
- input. Bash-5.1 suppresses that message when the -\b-l\bl op-
+ +\bo If the command hash table is empty, bash versions prior
+ to bash-5.1 printed an informational message to that ef-
+ fect, even when producing output that can be reused as
+ input. Bash-5.1 suppresses that message when the -\b-l\bl op-
tion is supplied.
c\bco\bom\bmp\bpa\bat\bt5\b51\b1
- +\bo The u\bun\bns\bse\bet\bt builtin treats attempts to unset array sub-
- scripts @\b@ and *\b* differently depending on whether the ar-
- ray is indexed or associative, and differently than in
+ +\bo The u\bun\bns\bse\bet\bt builtin treats attempts to unset array sub-
+ scripts @\b@ and *\b* differently depending on whether the ar-
+ ray is indexed or associative, and differently than in
previous versions.
R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTE\bED\bD S\bSH\bHE\bEL\bLL\bL
If b\bba\bas\bsh\bh is started with the name r\brb\bba\bas\bsh\bh, or the -\b-r\br option is supplied at
- invocation, the shell becomes restricted. A restricted shell is used
- to set up an environment more controlled than the standard shell. It
- behaves identically to b\bba\bas\bsh\bh with the exception that the following are
+ invocation, the shell becomes restricted. A restricted shell is used
+ to set up an environment more controlled than the standard shell. It
+ behaves identically to b\bba\bas\bsh\bh with the exception that the following are
disallowed or not performed:
+\bo changing directories with c\bcd\bd
- +\bo setting or unsetting the values of S\bSH\bHE\bEL\bLL\bL, P\bPA\bAT\bTH\bH, H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE, E\bEN\bNV\bV,
+ +\bo setting or unsetting the values of S\bSH\bHE\bEL\bLL\bL, P\bPA\bAT\bTH\bH, H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE, E\bEN\bNV\bV,
or B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV
+\bo specifying command names containing /\b/
- +\bo specifying a filename containing a /\b/ as an argument to the .\b.
+ +\bo specifying a filename containing a /\b/ as an argument to the .\b.
builtin command
- +\bo specifying a filename containing a slash as an argument to the
+ +\bo specifying a filename containing a slash as an argument to the
h\bhi\bis\bst\bto\bor\bry\by builtin command
- +\bo specifying a filename containing a slash as an argument to the
+ +\bo specifying a filename containing a slash as an argument to the
-\b-p\bp option to the h\bha\bas\bsh\bh builtin command
- +\bo importing function definitions from the shell environment at
+ +\bo importing function definitions from the shell environment at
startup
- +\bo parsing the value of S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS from the shell environment at
+ +\bo parsing the value of S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS from the shell environment at
startup
+\bo redirecting output using the >, >|, <>, >&, &>, and >> redirect-
+\bo using the e\bex\bxe\bec\bc builtin command to replace the shell with another
command
- +\bo adding or deleting builtin commands with the -\b-f\bf and -\b-d\bd options
+ +\bo adding or deleting builtin commands with the -\b-f\bf and -\b-d\bd options
to the e\ben\bna\bab\bbl\ble\be builtin command
- +\bo using the e\ben\bna\bab\bbl\ble\be builtin command to enable disabled shell
+ +\bo using the e\ben\bna\bab\bbl\ble\be builtin command to enable disabled shell
builtins
+\bo specifying the -\b-p\bp option to the c\bco\bom\bmm\bma\ban\bnd\bd builtin command
- +\bo turning off restricted mode with s\bse\bet\bt +\b+r\br or s\bsh\bho\bop\bpt\bt -\b-u\bu r\bre\be-\b-
+ +\bo turning off restricted mode with s\bse\bet\bt +\b+r\br or s\bsh\bho\bop\bpt\bt -\b-u\bu r\bre\be-\b-
s\bst\btr\bri\bic\bct\bte\bed\bd_\b_s\bsh\bhe\bel\bll\bl.
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed (see C\bCO\bOM\bM-\b-
- M\bMA\bAN\bND\bD E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN above), r\brb\bba\bas\bsh\bh turns off any restrictions in the shell
+ M\bMA\bAN\bND\bD E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN above), r\brb\bba\bas\bsh\bh turns off any restrictions in the shell
spawned to execute the script.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
_\bB_\ba_\bs_\bh _\bR_\be_\bf_\be_\br_\be_\bn_\bc_\be _\bM_\ba_\bn_\bu_\ba_\bl, Brian Fox and Chet Ramey
_\bT_\bh_\be _\bG_\bn_\bu _\bR_\be_\ba_\bd_\bl_\bi_\bn_\be _\bL_\bi_\bb_\br_\ba_\br_\by, Brian Fox and Chet Ramey
_\bT_\bh_\be _\bG_\bn_\bu _\bH_\bi_\bs_\bt_\bo_\br_\by _\bL_\bi_\bb_\br_\ba_\br_\by, Brian Fox and Chet Ramey
- _\bP_\bo_\br_\bt_\ba_\bb_\bl_\be _\bO_\bp_\be_\br_\ba_\bt_\bi_\bn_\bg _\bS_\by_\bs_\bt_\be_\bm _\bI_\bn_\bt_\be_\br_\bf_\ba_\bc_\be _\b(_\bP_\bO_\bS_\bI_\bX_\b) _\bP_\ba_\br_\bt _\b2_\b: _\bS_\bh_\be_\bl_\bl _\ba_\bn_\bd _\bU_\bt_\bi_\bl_\bi_\b-
+ _\bP_\bo_\br_\bt_\ba_\bb_\bl_\be _\bO_\bp_\be_\br_\ba_\bt_\bi_\bn_\bg _\bS_\by_\bs_\bt_\be_\bm _\bI_\bn_\bt_\be_\br_\bf_\ba_\bc_\be _\b(_\bP_\bO_\bS_\bI_\bX_\b) _\bP_\ba_\br_\bt _\b2_\b: _\bS_\bh_\be_\bl_\bl _\ba_\bn_\bd _\bU_\bt_\bi_\bl_\bi_\b-
_\bt_\bi_\be_\bs, IEEE --
http://pubs.opengroup.org/onlinepubs/9699919799/
http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode
_\b~_\b/_\b._\bb_\ba_\bs_\bh_\br_\bc
The individual per-interactive-shell startup file
_\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bl_\bo_\bg_\bo_\bu_\bt
- The individual login shell cleanup file, executed when a login
+ The individual login shell cleanup file, executed when a login
shell exits
_\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by
- The default value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE, the file in which bash saves the
+ The default value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE, the file in which bash saves the
command history
_\b~_\b/_\b._\bi_\bn_\bp_\bu_\bt_\br_\bc
Individual _\br_\be_\ba_\bd_\bl_\bi_\bn_\be initialization file
B\bBU\bUG\bG R\bRE\bEP\bPO\bOR\bRT\bTS\bS
If you find a bug in b\bba\bas\bsh\bh,\b, you should report it. But first, you should
- make sure that it really is a bug, and that it appears in the latest
- version of b\bba\bas\bsh\bh. The latest version is always available from
+ make sure that it really is a bug, and that it appears in the latest
+ version of b\bba\bas\bsh\bh. The latest version is always available from
_\bf_\bt_\bp_\b:_\b/_\b/_\bf_\bt_\bp_\b._\bg_\bn_\bu_\b._\bo_\br_\bg_\b/_\bp_\bu_\bb_\b/_\bg_\bn_\bu_\b/_\bb_\ba_\bs_\bh_\b/ and _\bh_\bt_\bt_\bp_\b:_\b/_\b/_\bg_\bi_\bt_\b._\bs_\ba_\bv_\ba_\bn_\b-
_\bn_\ba_\bh_\b._\bg_\bn_\bu_\b._\bo_\br_\bg_\b/_\bc_\bg_\bi_\bt_\b/_\bb_\ba_\bs_\bh_\b._\bg_\bi_\bt_\b/_\bs_\bn_\ba_\bp_\bs_\bh_\bo_\bt_\b/_\bb_\ba_\bs_\bh_\b-_\bm_\ba_\bs_\bt_\be_\br_\b._\bt_\ba_\br_\b._\bg_\bz.
- Once you have determined that a bug actually exists, use the _\bb_\ba_\bs_\bh_\bb_\bu_\bg
- command to submit a bug report. If you have a fix, you are encouraged
- to mail that as well! Suggestions and `philosophical' bug reports may
- be mailed to _\bb_\bu_\bg_\b-_\bb_\ba_\bs_\bh_\b@_\bg_\bn_\bu_\b._\bo_\br_\bg or posted to the Usenet newsgroup
+ Once you have determined that a bug actually exists, use the _\bb_\ba_\bs_\bh_\bb_\bu_\bg
+ command to submit a bug report. If you have a fix, you are encouraged
+ to mail that as well! Suggestions and `philosophical' bug reports may
+ be mailed to _\bb_\bu_\bg_\b-_\bb_\ba_\bs_\bh_\b@_\bg_\bn_\bu_\b._\bo_\br_\bg or posted to the Usenet newsgroup
g\bgn\bnu\bu.\b.b\bba\bas\bsh\bh.\b.b\bbu\bug\bg.
ALL bug reports should include:
A description of the bug behaviour
A short script or `recipe' which exercises the bug
- _\bb_\ba_\bs_\bh_\bb_\bu_\bg inserts the first three items automatically into the template
+ _\bb_\ba_\bs_\bh_\bb_\bu_\bg inserts the first three items automatically into the template
it provides for filing a bug report.
Comments and bug reports concerning this manual page should be directed
Shell builtin commands and functions are not stoppable/restartable.
Compound commands and command sequences of the form `a ; b ; c' are not
- handled gracefully when process suspension is attempted. When a
- process is stopped, the shell immediately executes the next command in
- the sequence. It suffices to place the sequence of commands between
- parentheses to force it into a subshell, which may be stopped as a
+ handled gracefully when process suspension is attempted. When a
+ process is stopped, the shell immediately executes the next command in
+ the sequence. It suffices to place the sequence of commands between
+ parentheses to force it into a subshell, which may be stopped as a
unit.
Array variables may not (yet) be exported.
-GNU Bash 5.3 2023 July 19 BASH(1)
+GNU Bash 5.3 2023 July 26 BASH(1)
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
-.\" Last Change: Wed Jul 19 14:23:20 EDT 2023
+.\" Last Change: Wed Jul 26 09:57:28 EDT 2023
.\"
.\" 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 "2023 July 19" "GNU Bash 5.3"
+.TH BASH 1 "2023 July 26" "GNU Bash 5.3"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
Execute commands from
.I file
instead of the standard personal initialization file
-.I ~/.bashrc
+.I \(ti/.bashrc
if the shell is interactive (see
.SM
.B INVOCATION
Do not read either the system-wide startup file
.FN /etc/profile
or any of the personal initialization files
-.IR ~/.bash_profile ,
-.IR ~/.bash_login ,
+.IR \(ti/.bash_profile ,
+.IR \(ti/.bash_login ,
or
-.IR ~/.profile .
+.IR \(ti/.profile .
By default,
.B bash
reads these files when it is invoked as a login shell (see
.TP
.B \-\-norc
Do not read and execute the personal initialization file
-.I ~/.bashrc
+.I \(ti/.bashrc
if the shell is interactive.
This option is on by default if the shell is invoked as
.BR sh .
with the \fB\-\-login\fP option, it first reads and
executes commands from the file \fI/etc/profile\fP, if that
file exists.
-After reading that file, it looks for \fI~/.bash_profile\fP,
-\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads
+After reading that file, it looks for \fI\(ti/.bash_profile\fP,
+\fI\(ti/.bash_login\fP, and \fI\(ti/.profile\fP, in that order, and reads
and executes commands from the first one that exists and is readable.
The
.B \-\-noprofile
When an interactive login shell exits,
or a non-interactive login shell executes the \fBexit\fP builtin command,
.B bash
-reads and executes commands from the file \fI~/.bash_logout\fP, if it
+reads and executes commands from the file \fI\(ti/.bash_logout\fP, if it
exists.
.PP
When an interactive shell that is not a login shell is started,
.B bash
-reads and executes commands from \fI~/.bashrc\fP, if that file exists.
+reads and executes commands from \fI\(ti/.bashrc\fP, if that file exists.
This may be inhibited by using the
.B \-\-norc
option.
The \fB\-\-rcfile\fP \fIfile\fP option will force
.B bash
-to read and execute commands from \fIfile\fP instead of \fI~/.bashrc\fP.
+to read and execute commands from \fIfile\fP instead of \fI\(ti/.bashrc\fP.
.PP
When
.B bash
read and execute commands from
.I /etc/profile
and
-.IR ~/.profile ,
+.IR \(ti/.profile ,
in that order.
The
.B \-\-noprofile
If
.B bash
determines it is being run non-interactively in this fashion,
-it reads and executes commands from \fI~/.bashrc\fP,
+it reads and executes commands from \fI\(ti/.bashrc\fP,
if that file exists and is readable.
It will not do this if invoked as \fBsh\fP.
The
to be matched as a string.
.if t .sp 0.5
.if n .sp 1
-An additional binary operator, \fB=~\fP, is available, with the same
+An additional binary operator, \fB=\(ti\fP, is available, with the same
precedence as \fB==\fP and \fB!=\fP.
When it is used, the string to the right of the operator is considered
a POSIX extended regular expression and matched accordingly
.if t .sp 0.5
.if n .sp 1
The pattern will match if it matches any part of the string.
-Anchor the pattern using the \fB^\fP and \fB$\fP regular expression
+Anchor the pattern using the \fB\(ha\fP and \fB$\fP regular expression
operators to force it to match the entire string.
The array variable
.SM
command.
.TP
.B BASH_REMATCH
-An array variable whose members are assigned by the \fB=~\fP binary
+An array variable whose members are assigned by the \fB=\(ti\fP binary
operator to the \fB[[\fP conditional command.
The element with index 0 is the portion of the string
matching the entire regular expression.
If this parameter is set when \fBbash\fP is executing a shell script,
its value is interpreted as a filename containing commands to
initialize the shell, as in
-.IR ~/.bashrc .
+.IR \(ti/.bashrc .
The value of
.SM
.B BASH_ENV
.B cd
command.
A sample value is
-.if t \f(CW".:~:/usr"\fP.
-.if n ".:~:/usr".
+.if t \f(CW".:\(ti:/usr"\fP.
+.if n ".:\(ti:/usr".
.TP
.B CHILD_MAX
Set the number of exited child status values for the shell to remember.
.B FIGNORE
is excluded from the list of matched filenames.
A sample value is
-.if t \f(CW".o:~"\fP.
-.if n ".o:~".
+.if t \f(CW".o:\(ti"\fP.
+.if n ".o:\(ti".
.TP
.B FUNCNEST
If set to a numeric value greater than 0, defines a maximum function
The name of the file in which command history is saved (see
.SM
.B HISTORY
-below). The default value is \fI~/.bash_history\fP. If unset, the
+below). The default value is \fI\(ti/.bash_history\fP. If unset, the
command history is not saved when a shell exits.
.TP
.B HISTFILESIZE
The filename for the
.B readline
startup file, overriding the default of
-.FN ~/.inputrc
+.FN \(ti/.inputrc
(see
.SM
.B READLINE
Example:
.RS
.PP
-\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq
+\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":\(ti/shell\-mail?"$_ has mail!"\(aq
.PP
.B Bash
can be configured to supply
The second character is the \fIquick substitution\fP
character, which is used as shorthand for re-running the previous
command entered, substituting one string for another in the command.
-The default is `\fB^\fP'.
+The default is `\fB\(ha\fP'.
The optional third character is the character
which indicates that the remainder of the line is a comment when found
as the first character of a word, normally `\fB#\fP'. The history
.B SHELL BUILTIN COMMANDS
below).
.SS Tilde Expansion
-If a word begins with an unquoted tilde character (`\fB~\fP'), all of
+If a word begins with an unquoted tilde character (`\fB\(ti\fP'), all of
the characters preceding the first unquoted slash (or all characters,
if there is no unquoted slash) are considered a \fItilde-prefix\fP.
If none of the characters in the tilde-prefix are quoted, the
Otherwise, the tilde-prefix is replaced with the home directory
associated with the specified login name.
.PP
-If the tilde-prefix is a `~+', the value of the shell variable
+If the tilde-prefix is a `\(ti+', the value of the shell variable
.SM
.B PWD
replaces the tilde-prefix.
-If the tilde-prefix is a `~\-', the value of the shell variable
+If the tilde-prefix is a `\(ti\-', the value of the shell variable
.SM
.BR OLDPWD ,
if it is set, is substituted.
the substitution operation is applied to each member of the
array in turn, and the expansion is the resultant list.
.TP
-${\fIparameter\fP\fB^\fP\fIpattern\fP}
+${\fIparameter\fP\fB\(ha\fP\fIpattern\fP}
.PD 0
.TP
-${\fIparameter\fP\fB^^\fP\fIpattern\fP}
+${\fIparameter\fP\fB\(ha\(ha\fP\fIpattern\fP}
.TP
${\fIparameter\fP\fB,\fP\fIpattern\fP}
.TP
Each character in the expanded value of \fIparameter\fP is tested against
\fIpattern\fP, and, if it matches the pattern, its case is converted.
The pattern should not attempt to match more than one character.
-The \fB^\fP operator converts lowercase letters matching \fIpattern\fP
+The \fB\(ha\fP operator converts lowercase letters matching \fIpattern\fP
to uppercase; the \fB,\fP operator converts matching uppercase letters
to lowercase.
-The \fB^^\fP and \fB,,\fP expansions convert each matched character in the
-expanded value; the \fB^\fP and \fB,\fP expansions match and convert only
+The \fB\(ha\(ha\fP and \fB,,\fP expansions convert each matched character in the
+expanded value; the \fB\(ha\fP and \fB,\fP expansions match and convert only
the first character in the expanded value.
If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches
every character.
is a
.B !
or a
-.B ^
+.B \(ha
then any character not enclosed is matched.
The sorting order of characters in range expressions,
and the characters included in the range,
.B ++\fIid\fP \-\-\fIid\fP
variable pre-increment and pre-decrement
.TP
-.B ! ~
+.B ! \(ti
logical and bitwise negation
.TP
.B **
.B &
bitwise AND
.TP
-.B ^
+.B \(ha
bitwise exclusive OR
.TP
.B |
.B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP
conditional operator
.TP
-.B = *= /= %= += \-= <<= >>= &= ^= |=
+.B = *= /= %= += \-= <<= >>= &= \(ha= |=
assignment
.TP
.B \fIexpr1\fP , \fIexpr2\fP
such as
.SM
.B SIGINT
-(usually generated by \fB^C\fP) that users commonly intend to send
+(usually generated by \fB\(haC\fP) that users commonly intend to send
to that command.
This happens because the shell and the command are in the
-same process group as the terminal, and \fB^C\fP sends
+same process group as the terminal, and \fB\(haC\fP sends
.SM
.B SIGINT
to all processes in that process group.
Typing the
.I suspend
character (typically
-.BR ^Z ,
+.BR \(haZ ,
Control-Z) while a process is running
causes that process to be stopped and returns control to
.BR bash .
Typing the
.I "delayed suspend"
character (typically
-.BR ^Y ,
+.BR \(haY ,
Control-Y) causes the process to be stopped when it
attempts to read input from the terminal, and control to
be returned to
command to continue it in the foreground, or
the
.B kill
-command to kill it. A \fB^Z\fP takes effect immediately,
+command to kill it. A \fB\(haZ\fP takes effect immediately,
and has the additional side effect of causing pending output
and typeahead to be discarded.
.PP
.SM
.B INPUTRC
variable. If that variable is unset, the default is
-.IR ~/.inputrc .
+.IR \(ti/.inputrc .
If that file does not exist or cannot be read, the ultimate default is
.IR /etc/inputrc .
When a program which uses the readline library starts up, the
.br
"\eC\-x\eC\-r": re\-read\-init\-file
.br
-"\ee[11~": "Function Key 1"
+"\ee[11\(ti": "Function Key 1"
.RE
.PP
In this example,
is bound to the function
.BR re\-read\-init\-file ,
and
-.I "ESC [ 1 1 ~"
+.I "ESC [ 1 1 \(ti"
is bound to insert the text
.if t \f(CWFunction Key 1\fP.
.if n ``Function Key 1''.
.B Bash
attempts completion treating the text as a variable (if the
text begins with \fB$\fP), username (if the text begins with
-\fB~\fP), hostname (if the text begins with \fB@\fP), or
+\fB\(ti\fP), hostname (if the text begins with \fB@\fP), or
command (including aliases and functions) in turn. If none
of these produces a match, filename completion is attempted.
.TP
List the possible completions of the text before point,
treating it as a filename.
.TP
-.B complete\-username (M\-~)
+.B complete\-username (M\-\(ti)
Attempt completion on the text before point, treating
it as a username.
.TP
-.B possible\-username\-completions (C\-x ~)
+.B possible\-username\-completions (C\-x \(ti)
List the possible completions of the text before point,
treating it as a username.
.TP
the variable
.SM
.B HISTFILE
-(default \fI~/.bash_history\fP).
+(default \fI\(ti/.bash_history\fP).
The file named by the value of
.SM
.B HISTFILE
If \fIstring\fP is missing, the string from the most recent search is used;
it is an error if there is no previous search string.
.TP
-.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u
+.B \d\s+2\(ha\s-2\u\fIstring1\fP\d\s+2\(ha\s-2\u\fIstring2\fP\d\s+2\(ha\s-2\u
Quick substitution. Repeat the previous command, replacing
.I string1
with
.IR string2 .
Equivalent to
-``!!:s\d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u''
+``!!:s\d\s+2\(ha\s-2\u\fIstring1\fP\d\s+2\(ha\s-2\u\fIstring2\fP\d\s+2\(ha\s-2\u''
(see \fBModifiers\fP below).
.TP
.B !#
.B :
separates the event specification from the word designator.
It may be omitted if the word designator begins with a
-.BR ^ ,
+.BR \(ha ,
.BR $ ,
.BR * ,
.BR \- ,
.I n
The \fIn\fRth word.
.TP
-.B ^
+.B \(ha
The first argument. That is, word 1.
.TP
.B $
option disables the interpretation of these escape characters,
even on systems where they are interpreted by default.
The \fBxpg_echo\fP shell option may be used to
-dynamically determine whether or not \fBecho\fP expands these
-escape characters by default.
+dynamically determine whether or not \fBecho\fP
+interprets any options
+and expands these escape characters by default.
.B echo
does not interpret \fB\-\-\fP to mean the end of options.
.B echo
.B xpg_echo
If set, the \fBecho\fP builtin expands backslash-escape sequences
by default.
+If the \fBposix\fP shell option is also enabled, \fBecho\fP does not
+interpret any options.
.RE
.PD
.TP
.PD 0
.RS
.IP \(bu
-quoting the rhs of the \fB[[\fP command's regexp matching operator (=~)
+quoting the rhs of the \fB[[\fP command's regexp matching operator (=\(ti)
has no special effect
.RE
.PD
\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE --
http://pubs.opengroup.org/onlinepubs/9699919799/
.TP
-http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode
+http://tiswww.case.edu/\(tichet/bash/POSIX -- a description of posix mode
.TP
\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1)
.TP
.FN /etc/profile
The systemwide initialization file, executed for login shells
.TP
-.FN ~/.bash_profile
+.FN \(ti/.bash_profile
The personal initialization file, executed for login shells
.TP
-.FN ~/.bashrc
+.FN \(ti/.bashrc
The individual per-interactive-shell startup file
.TP
-.FN ~/.bash_logout
+.FN \(ti/.bash_logout
The individual login shell cleanup file, executed when a login shell exits
.TP
-.FN ~/.bash_history
+.FN \(ti/.bash_history
The default value of \fBHISTFILE\fP, the file in which bash saves the
command history
.TP
-.FN ~/.inputrc
+.FN \(ti/.inputrc
Individual \fIreadline\fP initialization file
.PD
.SH AUTHORS
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
-<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2023 July 19<TH ALIGN=RIGHT width=33%>BASH(1)
+<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2023 July 26<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
<I>file</I>
instead of the standard personal initialization file
-<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>
+<I>ti/.bashrc</I>
if the shell is interactive (see
<FONT SIZE=-1><B>INVOCATION</B>
<A HREF="file:/etc/profile"><I>/etc/profile</I></A>
or any of the personal initialization files
-<A HREF="file:~/.bash_profile"><I>~/.bash_profile</I></A>,
+<I>ti/.bash_profile</I>,
-<A HREF="file:~/.bash_login"><I>~/.bash_login</I></A>,
+<I>ti/.bash_login</I>,
or
-<A HREF="file:~/.profile"><I>~/.profile</I></A>.
+<I>ti/.profile</I>.
By default,
<B>bash</B>
<DD>
Do not read and execute the personal initialization file
-<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>
+<I>ti/.bashrc</I>
if the shell is interactive.
This option is on by default if the shell is invoked as
with the <B>--login</B> option, it first reads and
executes commands from the file <A HREF="file:/etc/profile"><I>/etc/profile</I></A>, if that
file exists.
-After reading that file, it looks for <A HREF="file:~/.bash_profile"><I>~/.bash_profile</I></A>,
-<A HREF="file:~/.bash_login"><I>~/.bash_login</I></A>, and <A HREF="file:~/.profile"><I>~/.profile</I></A>, in that order, and reads
+After reading that file, it looks for <I>ti/.bash_profile</I>,
+<I>ti/.bash_login</I>, and <I>ti/.profile</I>, in that order, and reads
and executes commands from the first one that exists and is readable.
The
<B>--noprofile</B>
or a non-interactive login shell executes the <B>exit</B> builtin command,
<B>bash</B>
-reads and executes commands from the file <A HREF="file:~/.bash_logout"><I>~/.bash_logout</I></A>, if it
+reads and executes commands from the file <I>ti/.bash_logout</I>, if it
exists.
<P>
When an interactive shell that is not a login shell is started,
<B>bash</B>
-reads and executes commands from <A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>, if that file exists.
+reads and executes commands from <I>ti/.bashrc</I>, if that file exists.
This may be inhibited by using the
<B>--norc</B>
The <B>--rcfile</B> <I>file</I> option will force
<B>bash</B>
-to read and execute commands from <I>file</I> instead of <A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>.
+to read and execute commands from <I>file</I> instead of <I>ti/.bashrc</I>.
<P>
When
<A HREF="file:/etc/profile"><I>/etc/profile</I></A>
and
-<A HREF="file:~/.profile"><I>~/.profile</I></A>,
+<I>ti/.profile</I>,
in that order.
The
<B>bash</B>
determines it is being run non-interactively in this fashion,
-it reads and executes commands from <A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>,
+it reads and executes commands from <I>ti/.bashrc</I>,
if that file exists and is readable.
It will not do this if invoked as <B>sh</B>.
The
<P>
-An additional binary operator, <B>=~</B>, is available, with the same
+An additional binary operator, <B>=ti</B>, is available, with the same
precedence as <B>==</B> and <B>!=</B>.
When it is used, the string to the right of the operator is considered
a POSIX extended regular expression and matched accordingly
The pattern will match if it matches any part of the string.
-Anchor the pattern using the <B>^</B> and <B>$</B> regular expression
+Anchor the pattern using the <B>ha</B> and <B>$</B> regular expression
operators to force it to match the entire string.
The array variable
<FONT SIZE=-1><B>BASH_REMATCH</B>
<DT><B>BASH_REMATCH</B>
<DD>
-An array variable whose members are assigned by the <B>=~</B> binary
+An array variable whose members are assigned by the <B>=ti</B> binary
operator to the <B>[[</B> conditional command.
The element with index 0 is the portion of the string
matching the entire regular expression.
If this parameter is set when <B>bash</B> is executing a shell script,
its value is interpreted as a filename containing commands to
initialize the shell, as in
-<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>.
+<I>ti/.bashrc</I>.
The value of
<FONT SIZE=-1><B>BASH_ENV</B>
command.
A sample value is
-<TT>".:~:/usr"</TT>.
+<TT>".:ti:/usr"</TT>.
<DT><B>CHILD_MAX</B>
</FONT>
is excluded from the list of matched filenames.
A sample value is
-<TT>".o:~"</TT>.
+<TT>".o:ti"</TT>.
<DT><B>FUNCNEST</B>
<FONT SIZE=-1><B>HISTORY</B>
</FONT>
-below). The default value is <A HREF="file:~/.bash_history"><I>~/.bash_history</I></A>. If unset, the
+below). The default value is <I>ti/.bash_history</I>. If unset, the
command history is not saved when a shell exits.
<DT><B>HISTFILESIZE</B>
startup file, overriding the default of
-<A HREF="file:~/.inputrc"><I>~/.inputrc</I></A>
+<I>ti/.inputrc</I>
(see
<FONT SIZE=-1><B>READLINE</B>
<DL COMPACT><DT><DD>
<P>
-<B>MAILPATH</B>=aq/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"aq
+<B>MAILPATH</B>=aq/var/mail/bfox?"You have mail":ti/shell-mail?"$_ has mail!"aq
<P>
<B>Bash</B>
The second character is the <I>quick substitution</I>
character, which is used as shorthand for re-running the previous
command entered, substituting one string for another in the command.
-The default is `<B>^</B>'.
+The default is `<B>ha</B>'.
The optional third character is the character
which indicates that the remainder of the line is a comment when found
as the first character of a word, normally `<B>#</B>'. The history
<A NAME="lbBA"> </A>
<H4>Tilde Expansion</H4>
-If a word begins with an unquoted tilde character (`<B>~</B>'), all of
+If a word begins with an unquoted tilde character (`<B>ti</B>'), all of
the characters preceding the first unquoted slash (or all characters,
if there is no unquoted slash) are considered a <I>tilde-prefix</I>.
If none of the characters in the tilde-prefix are quoted, the
associated with the specified login name.
<P>
-If the tilde-prefix is a `~+', the value of the shell variable
+If the tilde-prefix is a `ti+', the value of the shell variable
<FONT SIZE=-1><B>PWD</B>
</FONT>
replaces the tilde-prefix.
-If the tilde-prefix is a `~-', the value of the shell variable
+If the tilde-prefix is a `ti-', the value of the shell variable
<FONT SIZE=-1><B>OLDPWD</B>,
</FONT>
the substitution operation is applied to each member of the
array in turn, and the expansion is the resultant list.
-<DT>${<I>parameter</I><B>^</B><I>pattern</I>}<DD>
+<DT>${<I>parameter</I><B>ha</B><I>pattern</I>}<DD>
-<DT>${<I>parameter</I><B>^^</B><I>pattern</I>}<DD>
+<DT>${<I>parameter</I><B>haha</B><I>pattern</I>}<DD>
<DT>${<I>parameter</I><B>,</B><I>pattern</I>}<DD>
<DT>${<I>parameter</I><B>,,</B><I>pattern</I>}<DD>
Each character in the expanded value of <I>parameter</I> is tested against
<I>pattern</I>, and, if it matches the pattern, its case is converted.
The pattern should not attempt to match more than one character.
-The <B>^</B> operator converts lowercase letters matching <I>pattern</I>
+The <B>ha</B> operator converts lowercase letters matching <I>pattern</I>
to uppercase; the <B>,</B> operator converts matching uppercase letters
to lowercase.
-The <B>^^</B> and <B>,,</B> expansions convert each matched character in the
-expanded value; the <B>^</B> and <B>,</B> expansions match and convert only
+The <B>haha</B> and <B>,,</B> expansions convert each matched character in the
+expanded value; the <B>ha</B> and <B>,</B> expansions match and convert only
the first character in the expanded value.
If <I>pattern</I> is omitted, it is treated like a <B>?</B>, which matches
every character.
<B>!</B>
or a
-<B>^</B>
+<B>ha</B>
then any character not enclosed is matched.
The sorting order of characters in range expressions,
<DD>
variable pre-increment and pre-decrement
-<DT><B>! ~</B>
+<DT><B>! ti</B>
<DD>
logical and bitwise negation
<DD>
bitwise AND
-<DT><B>^</B>
+<DT><B>ha</B>
<DD>
bitwise exclusive OR
<DD>
conditional operator
-<DT><B>= *= /= %= += -= <<= >>= &= ^= |=</B>
+<DT><B>= *= /= %= += -= <<= >>= &= ha= |=</B>
<DD>
assignment
<FONT SIZE=-1><B>SIGINT</B>
</FONT>
-(usually generated by <B>^C</B>) that users commonly intend to send
+(usually generated by <B>haC</B>) that users commonly intend to send
to that command.
This happens because the shell and the command are in the
-same process group as the terminal, and <B>^C</B> sends
+same process group as the terminal, and <B>haC</B> sends
<FONT SIZE=-1><B>SIGINT</B>
</FONT>
<I>suspend</I>
character (typically
-<B>^Z</B>,
+<B>haZ</B>,
Control-Z) while a process is running
causes that process to be stopped and returns control to
<I>delayed suspend</I>
character (typically
-<B>^Y</B>,
+<B>haY</B>,
Control-Y) causes the process to be stopped when it
attempts to read input from the terminal, and control to
the
<B>kill</B>
-command to kill it. A <B>^Z</B> takes effect immediately,
+command to kill it. A <B>haZ</B> takes effect immediately,
and has the additional side effect of causing pending output
and typeahead to be discarded.
<P>
</FONT>
variable. If that variable is unset, the default is
-<A HREF="file:~/.inputrc"><I>~/.inputrc</I></A>.
+<I>ti/.inputrc</I>.
If that file does not exist or cannot be read, the ultimate default is
<A HREF="file:/etc/inputrc"><I>/etc/inputrc</I></A>.
"\C-x\C-r": re-read-init-file
<BR>
-"\e[11~": "Function Key 1"
+"\e[11ti": "Function Key 1"
</DL>
<P>
<B>re-read-init-file</B>,
and
-<I>ESC [ 1 1 ~</I>
+<I>ESC [ 1 1 ti</I>
is bound to insert the text
<TT>Function Key 1</TT>.
attempts completion treating the text as a variable (if the
text begins with <B>$</B>), username (if the text begins with
-<B>~</B>), hostname (if the text begins with <B>@</B>), or
+<B>ti</B>), hostname (if the text begins with <B>@</B>), or
command (including aliases and functions) in turn. If none
of these produces a match, filename completion is attempted.
<DT><B>possible-completions (M-?)</B>
<DD>
List the possible completions of the text before point,
treating it as a filename.
-<DT><B>complete-username (M-~)</B>
+<DT><B>complete-username (M-ti)</B>
<DD>
Attempt completion on the text before point, treating
it as a username.
-<DT><B>possible-username-completions (C-x ~)</B>
+<DT><B>possible-username-completions (C-x ti)</B>
<DD>
List the possible completions of the text before point,
<FONT SIZE=-1><B>HISTFILE</B>
</FONT>
-(default <A HREF="file:~/.bash_history"><I>~/.bash_history</I></A>).
+(default <I>ti/.bash_history</I>).
The file named by the value of
<FONT SIZE=-1><B>HISTFILE</B>
is followed immediately by a newline.
If <I>string</I> is missing, the string from the most recent search is used;
it is an error if there is no previous search string.
-<DT><B></B><FONT SIZE=+2><B>^</B></FONT><B></B><I>string1</I><FONT SIZE=+2>^</FONT><I>string2</I><FONT SIZE=+2>^</FONT>
+<DT><B></B><FONT SIZE=+2><B>ha</B></FONT><B></B><I>string1</I><FONT SIZE=+2>ha</FONT><I>string2</I><FONT SIZE=+2>ha</FONT>
<DD>
Quick substitution. Repeat the previous command, replacing
<I>string2</I>.
Equivalent to
-``!!:s<FONT SIZE=+2>^</FONT><I>string1</I><FONT SIZE=+2>^</FONT><I>string2</I><FONT SIZE=+2>^</FONT>''
+``!!:s<FONT SIZE=+2>ha</FONT><I>string1</I><FONT SIZE=+2>ha</FONT><I>string2</I><FONT SIZE=+2>ha</FONT>''
(see <B>Modifiers</B> below).
<DT><B>!#</B>
separates the event specification from the word designator.
It may be omitted if the word designator begins with a
-<B>^</B>,
+<B>ha</B>,
<B>$</B>,
<DD>
The <I>n</I>th word.
-<DT><B>^</B>
+<DT><B>ha</B>
<DD>
The first argument. That is, word 1.
option disables the interpretation of these escape characters,
even on systems where they are interpreted by default.
The <B>xpg_echo</B> shell option may be used to
-dynamically determine whether or not <B>echo</B> expands these
-escape characters by default.
+dynamically determine whether or not <B>echo</B>
+interprets any options
+and expands these escape characters by default.
<B>echo</B>
does not interpret <B>--</B> to mean the end of options.
<DD>
If set, the <B>echo</B> builtin expands backslash-escape sequences
by default.
+If the <B>posix</B> shell option is also enabled, <B>echo</B> does not
+interpret any options.
</DL></DL>
<DL COMPACT><DT><DD>
<DL COMPACT>
<DT>*<DD>
-quoting the rhs of the <B>[[</B> command's regexp matching operator (=~)
+quoting the rhs of the <B>[[</B> command's regexp matching operator (=ti)
has no special effect
</DL></DL>
<DT><I>The Gnu History Library</I>, Brian Fox and Chet Ramey<DD>
<DT><I>Portable Operating System Interface (POSIX) Part 2: Shell and Utilities</I>, IEEE --<DD>
<A HREF="http://pubs.opengroup.org/onlinepubs/9699919799/">http://pubs.opengroup.org/onlinepubs/9699919799/</A>
-<DT><A HREF="http://tiswww.case.edu/~chet/bash/POSIX">http://tiswww.case.edu/~chet/bash/POSIX</A> -- a description of posix mode<DD>
+<DT><A HREF="http://tiswww.case.edu/tichet/bash/POSIX">http://tiswww.case.edu/tichet/bash/POSIX</A> -- a description of posix mode<DD>
<DT><I>sh</I>(1), <I>ksh</I>(1), <I>csh</I>(1)<DD>
<DT><I>emacs</I>(1), <I>vi</I>(1)<DD>
<DT><I>readline</I>(3)<DD>
<DD>
The systemwide initialization file, executed for login shells
<DT>
-<A HREF="file:~/.bash_profile"><I>~/.bash_profile</I></A>
+<I>ti/.bash_profile</I>
<DD>
The personal initialization file, executed for login shells
<DT>
-<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>
+<I>ti/.bashrc</I>
<DD>
The individual per-interactive-shell startup file
<DT>
-<A HREF="file:~/.bash_logout"><I>~/.bash_logout</I></A>
+<I>ti/.bash_logout</I>
<DD>
The individual login shell cleanup file, executed when a login shell exits
<DT>
-<A HREF="file:~/.bash_history"><I>~/.bash_history</I></A>
+<I>ti/.bash_history</I>
<DD>
The default value of <B>HISTFILE</B>, the file in which bash saves the
command history
<DT>
-<A HREF="file:~/.inputrc"><I>~/.inputrc</I></A>
+<I>ti/.inputrc</I>
<DD>
Individual <I>readline</I> initialization file
<HR>
<TABLE WIDTH=100%>
<TR>
-<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2023 July 19<TH ALIGN=RIGHT width=33%>BASH(1)
+<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2023 July 26<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
<DT><A HREF="#lbDI">BUGS</A><DD>
</DL>
<HR>
-This document was created by man2html from /usr/local/src/bash/bash-20230719/doc/bash.1.<BR>
-Time: 23 July 2023 18:17:35 EDT
+This document was created by man2html from /usr/local/src/bash/bash-20230724/doc/bash.1.<BR>
+Time: 27 July 2023 13:45:03 EDT
</BODY>
</HTML>
This is bash.info, produced by makeinfo version 6.8 from bashref.texi.
This text is a brief description of the features that are present in the
-Bash shell (version 5.3, 19 July 2023).
+Bash shell (version 5.3, 26 July 2023).
- This is Edition 5.3, last updated 19 July 2023, of 'The GNU Bash
+ This is Edition 5.3, last updated 26 July 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Copyright (C) 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, 19 July 2023). The Bash home page is
+Bash shell (version 5.3, 26 July 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
- This is Edition 5.3, last updated 19 July 2023, of 'The GNU Bash
+ This is Edition 5.3, last updated 26 July 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Bash contains features that appear in other popular shells, and some
$ v=123
$ echo ${v-unset}
123
+ $ echo ${v:-unset-or-null}
+ 123
+ $ unset v
+ $ echo ${v-unset}
+ unset
+ $ v=
+ $ echo ${v:-unset-or-null}
+ unset-or-null
'${PARAMETER:=WORD}'
If PARAMETER is unset or null, the expansion of WORD is assigned to
characters is enabled. The '-E' option disables the interpretation
of these escape characters, even on systems where they are
interpreted by default. The 'xpg_echo' shell option may be used to
- dynamically determine whether or not 'echo' expands these escape
- characters by default. 'echo' does not interpret '--' to mean the
- end of options.
+ dynamically determine whether or not 'echo' interprets any options
+ and expands these escape characters by default. 'echo' does not
+ interpret '--' to mean the end of options.
'echo' interprets the following escape sequences:
'\a'
'xpg_echo'
If set, the 'echo' builtin expands backslash-escape sequences
- by default.
+ by default. If the 'posix' shell option (*note The Set
+ Builtin::) is also enabled, 'echo' does not interpret any
+ options.
\1f
File: bash.info, Node: Special Builtins, Prev: Modifying Shell Behavior, Up: Shell Builtin Commands
Node: Brace Expansion\7f72491
Node: Tilde Expansion\7f75222
Node: Shell Parameter Expansion\7f77840
-Node: Command Substitution\7f96239
-Node: Arithmetic Expansion\7f99700
-Node: Process Substitution\7f100665
-Node: Word Splitting\7f101782
-Node: Filename Expansion\7f103827
-Node: Pattern Matching\7f106757
-Node: Quote Removal\7f111756
-Node: Redirections\7f112048
-Node: Executing Commands\7f121738
-Node: Simple Command Expansion\7f122405
-Node: Command Search and Execution\7f124512
-Node: Command Execution Environment\7f126896
-Node: Environment\7f129928
-Node: Exit Status\7f131588
-Node: Signals\7f133369
-Node: Shell Scripts\7f136815
-Node: Shell Builtin Commands\7f139839
-Node: Bourne Shell Builtins\7f141874
-Node: Bash Builtins\7f165007
-Node: Modifying Shell Behavior\7f197003
-Node: The Set Builtin\7f197345
-Node: The Shopt Builtin\7f208286
-Node: Special Builtins\7f224290
-Node: Shell Variables\7f225266
-Node: Bourne Shell Variables\7f225700
-Node: Bash Variables\7f227801
-Node: Bash Features\7f262755
-Node: Invoking Bash\7f263765
-Node: Bash Startup Files\7f269775
-Node: Interactive Shells\7f274903
-Node: What is an Interactive Shell?\7f275311
-Node: Is this Shell Interactive?\7f275957
-Node: Interactive Shell Behavior\7f276769
-Node: Bash Conditional Expressions\7f280395
-Node: Shell Arithmetic\7f285034
-Node: Aliases\7f287992
-Node: Arrays\7f290883
-Node: The Directory Stack\7f297443
-Node: Directory Stack Builtins\7f298224
-Node: Controlling the Prompt\7f302481
-Node: The Restricted Shell\7f305443
-Node: Bash POSIX Mode\7f308050
-Node: Shell Compatibility Mode\7f324190
-Node: Job Control\7f332431
-Node: Job Control Basics\7f332888
-Node: Job Control Builtins\7f337887
-Node: Job Control Variables\7f343679
-Node: Command Line Editing\7f344832
-Node: Introduction and Notation\7f346500
-Node: Readline Interaction\7f348120
-Node: Readline Bare Essentials\7f349308
-Node: Readline Movement Commands\7f351094
-Node: Readline Killing Commands\7f352051
-Node: Readline Arguments\7f353969
-Node: Searching\7f355010
-Node: Readline Init File\7f357193
-Node: Readline Init File Syntax\7f358451
-Node: Conditional Init Constructs\7f382473
-Node: Sample Init File\7f386666
-Node: Bindable Readline Commands\7f389787
-Node: Commands For Moving\7f390988
-Node: Commands For History\7f393036
-Node: Commands For Text\7f398027
-Node: Commands For Killing\7f402002
-Node: Numeric Arguments\7f404703
-Node: Commands For Completion\7f405839
-Node: Keyboard Macros\7f410027
-Node: Miscellaneous Commands\7f410712
-Node: Readline vi Mode\7f416747
-Node: Programmable Completion\7f417651
-Node: Programmable Completion Builtins\7f425428
-Node: A Programmable Completion Example\7f436545
-Node: Using History Interactively\7f441790
-Node: Bash History Facilities\7f442471
-Node: Bash History Builtins\7f445473
-Node: History Interaction\7f450494
-Node: Event Designators\7f454111
-Node: Word Designators\7f455462
-Node: Modifiers\7f457219
-Node: Installing Bash\7f459024
-Node: Basic Installation\7f460158
-Node: Compilers and Options\7f463877
-Node: Compiling For Multiple Architectures\7f464615
-Node: Installation Names\7f466304
-Node: Specifying the System Type\7f468410
-Node: Sharing Defaults\7f469124
-Node: Operation Controls\7f469794
-Node: Optional Features\7f470749
-Node: Reporting Bugs\7f481965
-Node: Major Differences From The Bourne Shell\7f483296
-Node: GNU Free Documentation License\7f500142
-Node: Indexes\7f525316
-Node: Builtin Index\7f525767
-Node: Reserved Word Index\7f532865
-Node: Variable Index\7f535310
-Node: Function Index\7f552441
-Node: Concept Index\7f566159
+Node: Command Substitution\7f96430
+Node: Arithmetic Expansion\7f99891
+Node: Process Substitution\7f100856
+Node: Word Splitting\7f101973
+Node: Filename Expansion\7f104018
+Node: Pattern Matching\7f106948
+Node: Quote Removal\7f111947
+Node: Redirections\7f112239
+Node: Executing Commands\7f121929
+Node: Simple Command Expansion\7f122596
+Node: Command Search and Execution\7f124703
+Node: Command Execution Environment\7f127087
+Node: Environment\7f130119
+Node: Exit Status\7f131779
+Node: Signals\7f133560
+Node: Shell Scripts\7f137006
+Node: Shell Builtin Commands\7f140030
+Node: Bourne Shell Builtins\7f142065
+Node: Bash Builtins\7f165198
+Node: Modifying Shell Behavior\7f197221
+Node: The Set Builtin\7f197563
+Node: The Shopt Builtin\7f208504
+Node: Special Builtins\7f224639
+Node: Shell Variables\7f225615
+Node: Bourne Shell Variables\7f226049
+Node: Bash Variables\7f228150
+Node: Bash Features\7f263104
+Node: Invoking Bash\7f264114
+Node: Bash Startup Files\7f270124
+Node: Interactive Shells\7f275252
+Node: What is an Interactive Shell?\7f275660
+Node: Is this Shell Interactive?\7f276306
+Node: Interactive Shell Behavior\7f277118
+Node: Bash Conditional Expressions\7f280744
+Node: Shell Arithmetic\7f285383
+Node: Aliases\7f288341
+Node: Arrays\7f291232
+Node: The Directory Stack\7f297792
+Node: Directory Stack Builtins\7f298573
+Node: Controlling the Prompt\7f302830
+Node: The Restricted Shell\7f305792
+Node: Bash POSIX Mode\7f308399
+Node: Shell Compatibility Mode\7f324539
+Node: Job Control\7f332780
+Node: Job Control Basics\7f333237
+Node: Job Control Builtins\7f338236
+Node: Job Control Variables\7f344028
+Node: Command Line Editing\7f345181
+Node: Introduction and Notation\7f346849
+Node: Readline Interaction\7f348469
+Node: Readline Bare Essentials\7f349657
+Node: Readline Movement Commands\7f351443
+Node: Readline Killing Commands\7f352400
+Node: Readline Arguments\7f354318
+Node: Searching\7f355359
+Node: Readline Init File\7f357542
+Node: Readline Init File Syntax\7f358800
+Node: Conditional Init Constructs\7f382822
+Node: Sample Init File\7f387015
+Node: Bindable Readline Commands\7f390136
+Node: Commands For Moving\7f391337
+Node: Commands For History\7f393385
+Node: Commands For Text\7f398376
+Node: Commands For Killing\7f402351
+Node: Numeric Arguments\7f405052
+Node: Commands For Completion\7f406188
+Node: Keyboard Macros\7f410376
+Node: Miscellaneous Commands\7f411061
+Node: Readline vi Mode\7f417096
+Node: Programmable Completion\7f418000
+Node: Programmable Completion Builtins\7f425777
+Node: A Programmable Completion Example\7f436894
+Node: Using History Interactively\7f442139
+Node: Bash History Facilities\7f442820
+Node: Bash History Builtins\7f445822
+Node: History Interaction\7f450843
+Node: Event Designators\7f454460
+Node: Word Designators\7f455811
+Node: Modifiers\7f457568
+Node: Installing Bash\7f459373
+Node: Basic Installation\7f460507
+Node: Compilers and Options\7f464226
+Node: Compiling For Multiple Architectures\7f464964
+Node: Installation Names\7f466653
+Node: Specifying the System Type\7f468759
+Node: Sharing Defaults\7f469473
+Node: Operation Controls\7f470143
+Node: Optional Features\7f471098
+Node: Reporting Bugs\7f482314
+Node: Major Differences From The Bourne Shell\7f483645
+Node: GNU Free Documentation License\7f500491
+Node: Indexes\7f525665
+Node: Builtin Index\7f526116
+Node: Reserved Word Index\7f533214
+Node: Variable Index\7f535659
+Node: Function Index\7f552790
+Node: Concept Index\7f566508
\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, 19 July 2023).
+Bash shell (version 5.3, 26 July 2023).
- This is Edition 5.3, last updated 19 July 2023, of 'The GNU Bash
+ This is Edition 5.3, last updated 26 July 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Copyright (C) 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, 19 July 2023). The Bash home page is
+Bash shell (version 5.3, 26 July 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
- This is Edition 5.3, last updated 19 July 2023, of 'The GNU Bash
+ This is Edition 5.3, last updated 26 July 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Bash contains features that appear in other popular shells, and some
$ v=123
$ echo ${v-unset}
123
+ $ echo ${v:-unset-or-null}
+ 123
+ $ unset v
+ $ echo ${v-unset}
+ unset
+ $ v=
+ $ echo ${v:-unset-or-null}
+ unset-or-null
'${PARAMETER:=WORD}'
If PARAMETER is unset or null, the expansion of WORD is assigned to
characters is enabled. The '-E' option disables the interpretation
of these escape characters, even on systems where they are
interpreted by default. The 'xpg_echo' shell option may be used to
- dynamically determine whether or not 'echo' expands these escape
- characters by default. 'echo' does not interpret '--' to mean the
- end of options.
+ dynamically determine whether or not 'echo' interprets any options
+ and expands these escape characters by default. 'echo' does not
+ interpret '--' to mean the end of options.
'echo' interprets the following escape sequences:
'\a'
'xpg_echo'
If set, the 'echo' builtin expands backslash-escape sequences
- by default.
+ by default. If the 'posix' shell option (*note The Set
+ Builtin::) is also enabled, 'echo' does not interpret any
+ options.
\1f
File: bashref.info, Node: Special Builtins, Prev: Modifying Shell Behavior, Up: Shell Builtin Commands
Node: Brace Expansion\7f72590
Node: Tilde Expansion\7f75324
Node: Shell Parameter Expansion\7f77945
-Node: Command Substitution\7f96347
-Node: Arithmetic Expansion\7f99811
-Node: Process Substitution\7f100779
-Node: Word Splitting\7f101899
-Node: Filename Expansion\7f103947
-Node: Pattern Matching\7f106880
-Node: Quote Removal\7f111882
-Node: Redirections\7f112177
-Node: Executing Commands\7f121870
-Node: Simple Command Expansion\7f122540
-Node: Command Search and Execution\7f124650
-Node: Command Execution Environment\7f127037
-Node: Environment\7f130072
-Node: Exit Status\7f131735
-Node: Signals\7f133519
-Node: Shell Scripts\7f136968
-Node: Shell Builtin Commands\7f139995
-Node: Bourne Shell Builtins\7f142033
-Node: Bash Builtins\7f165169
-Node: Modifying Shell Behavior\7f197168
-Node: The Set Builtin\7f197513
-Node: The Shopt Builtin\7f208457
-Node: Special Builtins\7f224464
-Node: Shell Variables\7f225443
-Node: Bourne Shell Variables\7f225880
-Node: Bash Variables\7f227984
-Node: Bash Features\7f262941
-Node: Invoking Bash\7f263954
-Node: Bash Startup Files\7f269967
-Node: Interactive Shells\7f275098
-Node: What is an Interactive Shell?\7f275509
-Node: Is this Shell Interactive?\7f276158
-Node: Interactive Shell Behavior\7f276973
-Node: Bash Conditional Expressions\7f280602
-Node: Shell Arithmetic\7f285244
-Node: Aliases\7f288205
-Node: Arrays\7f291099
-Node: The Directory Stack\7f297662
-Node: Directory Stack Builtins\7f298446
-Node: Controlling the Prompt\7f302706
-Node: The Restricted Shell\7f305671
-Node: Bash POSIX Mode\7f308281
-Node: Shell Compatibility Mode\7f324424
-Node: Job Control\7f332668
-Node: Job Control Basics\7f333128
-Node: Job Control Builtins\7f338130
-Node: Job Control Variables\7f343925
-Node: Command Line Editing\7f345081
-Node: Introduction and Notation\7f346752
-Node: Readline Interaction\7f348375
-Node: Readline Bare Essentials\7f349566
-Node: Readline Movement Commands\7f351355
-Node: Readline Killing Commands\7f352315
-Node: Readline Arguments\7f354236
-Node: Searching\7f355280
-Node: Readline Init File\7f357466
-Node: Readline Init File Syntax\7f358727
-Node: Conditional Init Constructs\7f382752
-Node: Sample Init File\7f386948
-Node: Bindable Readline Commands\7f390072
-Node: Commands For Moving\7f391276
-Node: Commands For History\7f393327
-Node: Commands For Text\7f398321
-Node: Commands For Killing\7f402299
-Node: Numeric Arguments\7f405003
-Node: Commands For Completion\7f406142
-Node: Keyboard Macros\7f410333
-Node: Miscellaneous Commands\7f411021
-Node: Readline vi Mode\7f417059
-Node: Programmable Completion\7f417966
-Node: Programmable Completion Builtins\7f425746
-Node: A Programmable Completion Example\7f436866
-Node: Using History Interactively\7f442114
-Node: Bash History Facilities\7f442798
-Node: Bash History Builtins\7f445803
-Node: History Interaction\7f450827
-Node: Event Designators\7f454447
-Node: Word Designators\7f455801
-Node: Modifiers\7f457561
-Node: Installing Bash\7f459369
-Node: Basic Installation\7f460506
-Node: Compilers and Options\7f464228
-Node: Compiling For Multiple Architectures\7f464969
-Node: Installation Names\7f466661
-Node: Specifying the System Type\7f468770
-Node: Sharing Defaults\7f469487
-Node: Operation Controls\7f470160
-Node: Optional Features\7f471118
-Node: Reporting Bugs\7f482337
-Node: Major Differences From The Bourne Shell\7f483671
-Node: GNU Free Documentation License\7f500520
-Node: Indexes\7f525697
-Node: Builtin Index\7f526151
-Node: Reserved Word Index\7f533252
-Node: Variable Index\7f535700
-Node: Function Index\7f552834
-Node: Concept Index\7f566555
+Node: Command Substitution\7f96538
+Node: Arithmetic Expansion\7f100002
+Node: Process Substitution\7f100970
+Node: Word Splitting\7f102090
+Node: Filename Expansion\7f104138
+Node: Pattern Matching\7f107071
+Node: Quote Removal\7f112073
+Node: Redirections\7f112368
+Node: Executing Commands\7f122061
+Node: Simple Command Expansion\7f122731
+Node: Command Search and Execution\7f124841
+Node: Command Execution Environment\7f127228
+Node: Environment\7f130263
+Node: Exit Status\7f131926
+Node: Signals\7f133710
+Node: Shell Scripts\7f137159
+Node: Shell Builtin Commands\7f140186
+Node: Bourne Shell Builtins\7f142224
+Node: Bash Builtins\7f165360
+Node: Modifying Shell Behavior\7f197386
+Node: The Set Builtin\7f197731
+Node: The Shopt Builtin\7f208675
+Node: Special Builtins\7f224813
+Node: Shell Variables\7f225792
+Node: Bourne Shell Variables\7f226229
+Node: Bash Variables\7f228333
+Node: Bash Features\7f263290
+Node: Invoking Bash\7f264303
+Node: Bash Startup Files\7f270316
+Node: Interactive Shells\7f275447
+Node: What is an Interactive Shell?\7f275858
+Node: Is this Shell Interactive?\7f276507
+Node: Interactive Shell Behavior\7f277322
+Node: Bash Conditional Expressions\7f280951
+Node: Shell Arithmetic\7f285593
+Node: Aliases\7f288554
+Node: Arrays\7f291448
+Node: The Directory Stack\7f298011
+Node: Directory Stack Builtins\7f298795
+Node: Controlling the Prompt\7f303055
+Node: The Restricted Shell\7f306020
+Node: Bash POSIX Mode\7f308630
+Node: Shell Compatibility Mode\7f324773
+Node: Job Control\7f333017
+Node: Job Control Basics\7f333477
+Node: Job Control Builtins\7f338479
+Node: Job Control Variables\7f344274
+Node: Command Line Editing\7f345430
+Node: Introduction and Notation\7f347101
+Node: Readline Interaction\7f348724
+Node: Readline Bare Essentials\7f349915
+Node: Readline Movement Commands\7f351704
+Node: Readline Killing Commands\7f352664
+Node: Readline Arguments\7f354585
+Node: Searching\7f355629
+Node: Readline Init File\7f357815
+Node: Readline Init File Syntax\7f359076
+Node: Conditional Init Constructs\7f383101
+Node: Sample Init File\7f387297
+Node: Bindable Readline Commands\7f390421
+Node: Commands For Moving\7f391625
+Node: Commands For History\7f393676
+Node: Commands For Text\7f398670
+Node: Commands For Killing\7f402648
+Node: Numeric Arguments\7f405352
+Node: Commands For Completion\7f406491
+Node: Keyboard Macros\7f410682
+Node: Miscellaneous Commands\7f411370
+Node: Readline vi Mode\7f417408
+Node: Programmable Completion\7f418315
+Node: Programmable Completion Builtins\7f426095
+Node: A Programmable Completion Example\7f437215
+Node: Using History Interactively\7f442463
+Node: Bash History Facilities\7f443147
+Node: Bash History Builtins\7f446152
+Node: History Interaction\7f451176
+Node: Event Designators\7f454796
+Node: Word Designators\7f456150
+Node: Modifiers\7f457910
+Node: Installing Bash\7f459718
+Node: Basic Installation\7f460855
+Node: Compilers and Options\7f464577
+Node: Compiling For Multiple Architectures\7f465318
+Node: Installation Names\7f467010
+Node: Specifying the System Type\7f469119
+Node: Sharing Defaults\7f469836
+Node: Operation Controls\7f470509
+Node: Optional Features\7f471467
+Node: Reporting Bugs\7f482686
+Node: Major Differences From The Bourne Shell\7f484020
+Node: GNU Free Documentation License\7f500869
+Node: Indexes\7f526046
+Node: Builtin Index\7f526500
+Node: Reserved Word Index\7f533601
+Node: Variable Index\7f536049
+Node: Function Index\7f553183
+Node: Concept Index\7f566904
\1f
End Tag Table
-This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_0) (preloaded format=pdfetex 2021.8.30) 23 JUL 2023 18:18
+This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_0) (preloaded format=pdfetex 2021.8.30) 26 JUL 2023 11:16
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
-**\input /usr/local/src/bash/bash-20230719/doc/bashref.texi \input /usr/local/s
-rc/bash/bash-20230719/doc/bashref.texi
-(/usr/local/src/bash/bash-20230719/doc/bashref.texi
-(/usr/local/src/bash/bash-20230719/doc/texinfo.tex
+**\input /usr/local/src/bash/bash-20230724/doc/bashref.texi \input /usr/local/s
+rc/bash/bash-20230724/doc/bashref.texi
+(/usr/local/src/bash/bash-20230724/doc/bashref.texi
+(/usr/local/src/bash/bash-20230724/doc/texinfo.tex
Loading texinfo [version 2015-11-22.14]:
\outerhsize=\dimen16
\outervsize=\dimen17
texinfo.tex: doing @include of version.texi
-(/usr/local/src/bash/bash-20230719/doc/version.texi) [1{/opt/local/var/db/texmf
+(/usr/local/src/bash/bash-20230724/doc/version.texi) [1{/opt/local/var/db/texmf
/fonts/map/pdftex/updmap/pdftex.map}] [2]
-(/usr/local/build/bash/bash-20230719/doc/bashref.toc [-1] [-2] [-3]) [-4]
-(/usr/local/build/bash/bash-20230719/doc/bashref.toc)
-(/usr/local/build/bash/bash-20230719/doc/bashref.toc) Chapter 1
+(/usr/local/build/bash/bash-20230724/doc/bashref.toc [-1] [-2] [-3]) [-4]
+(/usr/local/build/bash/bash-20230724/doc/bashref.toc)
+(/usr/local/build/bash/bash-20230724/doc/bashref.toc) Chapter 1
\openout0 = `bashref.toc'.
-(/usr/local/build/bash/bash-20230719/doc/bashref.aux)
+(/usr/local/build/bash/bash-20230724/doc/bashref.aux)
\openout1 = `bashref.aux'.
Chapter 2 [1] [2]
[49] [50] [51]
[52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66]
[67]
-Overfull \hbox (38.26585pt too wide) in paragraph at lines 5377--5377
+Overfull \hbox (38.26585pt too wide) in paragraph at lines 5386--5386
[]@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
.etc.
-Overfull \hbox (38.26585pt too wide) in paragraph at lines 5378--5378
+Overfull \hbox (38.26585pt too wide) in paragraph at lines 5387--5387
[]@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
[118] [119]
texinfo.tex: doing @include of rluser.texi
- (/usr/local/src/bash/bash-20230719/lib/readline/doc/rluser.texi
+ (/usr/local/src/bash/bash-20230724/lib/readline/doc/rluser.texi
Chapter 8 [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130]
[131]
Underfull \hbox (badness 7540) in paragraph at lines 878--884
texinfo.tex: doing @include of hsuser.texi
-(/usr/local/src/bash/bash-20230719/lib/readline/doc/hsuser.texi Chapter 9
+(/usr/local/src/bash/bash-20230724/lib/readline/doc/hsuser.texi Chapter 9
[157] [158] [159] [160] [161] [162]) Chapter 10 [163] [164] [165] [166]
[167]
-Underfull \hbox (badness 10000) in paragraph at lines 9699--9708
+Underfull \hbox (badness 10000) in paragraph at lines 9711--9720
[]@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
entation[]@textrm '[],
.etc.
-Underfull \hbox (badness 10000) in paragraph at lines 9699--9708
+Underfull \hbox (badness 10000) in paragraph at lines 9711--9720
@textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
extrm '[], `@texttt strict-posix-default[]@textrm '[], and
[177] [178] Appendix C [179]
texinfo.tex: doing @include of fdl.texi
- (/usr/local/src/bash/bash-20230719/doc/fdl.texi
+ (/usr/local/src/bash/bash-20230724/doc/fdl.texi
[180] [181] [182] [183] [184] [185] [186]) Appendix D [187] [188] [189]
[190] [191] [192] [193] [194] [195] [196] )
Here is how much of TeX's memory you used:
4103 strings out of 497086
47611 string characters out of 6206517
- 142074 words of memory out of 5000000
+ 142120 words of memory out of 5000000
4869 multiletter control sequences out of 15000+600000
34315 words of font info for 116 fonts, out of 8000000 for 9000
51 hyphenation exceptions out of 8191
ve/fonts/type1/public/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texlive/fon
ts/type1/public/cm-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fonts/typ
e1/public/cm-super/sfrm1440.pfb>
-Output written on bashref.pdf (202 pages, 810875 bytes).
+Output written on bashref.pdf (202 pages, 811039 bytes).
PDF statistics:
- 2812 PDF objects out of 2984 (max. 8388607)
- 2563 compressed objects within 26 object streams
+ 2814 PDF objects out of 2984 (max. 8388607)
+ 2565 compressed objects within 26 object streams
330 named destinations out of 1000 (max. 500000)
1157 words of extra memory for PDF output out of 10000 (max. 10000000)
The @option{-E} option disables the interpretation of these escape characters,
even on systems where they are interpreted by default.
The @code{xpg_echo} shell option may be used to
-dynamically determine whether or not @code{echo} expands these
-escape characters by default.
+dynamically determine whether or not @code{echo}
+interprets any options and
+expands these escape characters by default.
@code{echo} does not interpret @option{--} to mean the end of options.
@code{echo} interprets the following escape sequences:
@item xpg_echo
If set, the @code{echo} builtin expands backslash-escape sequences
by default.
+If the @code{posix} shell option (@pxref{The Set Builtin}) is also enabled,
+@code{echo} does not
+interpret any options.
@end table
@end table
characters is enabled. The -\b-E\bE option disables the interpreta-
tion of these escape characters, even on systems where they are
interpreted by default. The x\bxp\bpg\bg_\b_e\bec\bch\bho\bo shell option may be used
- to dynamically determine whether or not e\bec\bch\bho\bo expands these es-
- cape characters by default. e\bec\bch\bho\bo does not interpret -\b--\b- to mean
- the end of options. e\bec\bch\bho\bo interprets the following escape se-
- quences:
+ to dynamically determine whether or not e\bec\bch\bho\bo interprets any op-
+ tions and expands these escape characters by default. e\bec\bch\bho\bo does
+ not interpret -\b--\b- to mean the end of options. e\bec\bch\bho\bo interprets
+ the following escape sequences:
\\b\a\ba alert (bell)
\\b\b\bb backspace
\\b\c\bc suppress further output
x\bxp\bpg\bg_\b_e\bec\bch\bho\bo
If set, the e\bec\bch\bho\bo builtin expands backslash-escape se-
- quences by default.
+ quences by default. If the p\bpo\bos\bsi\bix\bx shell option is also
+ enabled, e\bec\bch\bho\bo does not interpret any options.
s\bsu\bus\bsp\bpe\ben\bnd\bd [-\b-f\bf]
- Suspend the execution of this shell until it receives a S\bSI\bIG\bGC\bCO\bON\bNT\bT
- signal. A login shell, or a shell without job control enabled,
- cannot be suspended; the -\b-f\bf option can be used to override this
- and force the suspension. The return status is 0 unless the
- shell is a login shell or job control is not enabled and -\b-f\bf is
+ Suspend the execution of this shell until it receives a S\bSI\bIG\bGC\bCO\bON\bNT\bT
+ signal. A login shell, or a shell without job control enabled,
+ cannot be suspended; the -\b-f\bf option can be used to override this
+ and force the suspension. The return status is 0 unless the
+ shell is a login shell or job control is not enabled and -\b-f\bf is
not supplied.
t\bte\bes\bst\bt _\be_\bx_\bp_\br
[\b[ _\be_\bx_\bp_\br ]\b]
Return a status of 0 (true) or 1 (false) depending on the evalu-
ation of the conditional expression _\be_\bx_\bp_\br. Each operator and op-
- erand must be a separate argument. Expressions are composed of
- the primaries described in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bS-\b-
+ erand must be a separate argument. Expressions are composed of
+ the primaries described in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bS-\b-
S\bSI\bIO\bON\bNS\bS. t\bte\bes\bst\bt does not accept any options, nor does it accept and
ignore an argument of -\b--\b- as signifying the end of options.
- Expressions may be combined using the following operators,
- listed in decreasing order of precedence. The evaluation de-
- pends on the number of arguments; see below. Operator prece-
+ Expressions may be combined using the following operators,
+ listed in decreasing order of precedence. The evaluation de-
+ pends on the number of arguments; see below. Operator prece-
dence is used when there are five or more arguments.
!\b! _\be_\bx_\bp_\br True if _\be_\bx_\bp_\br is false.
(\b( _\be_\bx_\bp_\br )\b)
- Returns the value of _\be_\bx_\bp_\br. This may be used to override
+ Returns the value of _\be_\bx_\bp_\br. This may be used to override
the normal precedence of operators.
_\be_\bx_\bp_\br_\b1 -a\ba _\be_\bx_\bp_\br_\b2
True if both _\be_\bx_\bp_\br_\b1 and _\be_\bx_\bp_\br_\b2 are true.
null.
2 arguments
If the first argument is !\b!, the expression is true if and
- only if the second argument is null. If the first argu-
- ment is one of the unary conditional operators listed in
- _\bb_\ba_\bs_\bh_\b(_\b1_\b) under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS, the expression is
+ only if the second argument is null. If the first argu-
+ ment is one of the unary conditional operators listed in
+ _\bb_\ba_\bs_\bh_\b(_\b1_\b) under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS, the expression is
true if the unary test is true. If the first argument is
not a valid unary conditional operator, the expression is
false.
3 arguments
The following conditions are applied in the order listed.
- If the second argument is one of the binary conditional
- operators listed in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bS-\b-
- S\bSI\bIO\bON\bNS\bS, the result of the expression is the result of the
- binary test using the first and third arguments as oper-
- ands. The -\b-a\ba and -\b-o\bo operators are considered binary op-
+ If the second argument is one of the binary conditional
+ operators listed in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bS-\b-
+ S\bSI\bIO\bON\bNS\bS, the result of the expression is the result of the
+ binary test using the first and third arguments as oper-
+ ands. The -\b-a\ba and -\b-o\bo operators are considered binary op-
erators when there are three arguments. If the first ar-
- gument is !\b!, the value is the negation of the two-argu-
- ment test using the second and third arguments. If the
+ gument is !\b!, the value is the negation of the two-argu-
+ ment test using the second and third arguments. If the
first argument is exactly (\b( and the third argument is ex-
- actly )\b), the result is the one-argument test of the sec-
+ actly )\b), the result is the one-argument test of the sec-
ond argument. Otherwise, the expression is false.
4 arguments
The following conditions are applied in the order listed.
If the first argument is !\b!, the result is the negation of
- the three-argument expression composed of the remaining
- arguments. the two-argument test using the second and
- third arguments. If the first argument is exactly (\b( and
- the fourth argument is exactly )\b), the result is the two-
- argument test of the second and third arguments. Other-
+ the three-argument expression composed of the remaining
+ arguments. the two-argument test using the second and
+ third arguments. If the first argument is exactly (\b( and
+ the fourth argument is exactly )\b), the result is the two-
+ argument test of the second and third arguments. Other-
wise, the expression is parsed and evaluated according to
precedence using the rules listed above.
5 or more arguments
- The expression is parsed and evaluated according to
+ The expression is parsed and evaluated according to
precedence using the rules listed above.
If the shell is not in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, when used with t\bte\bes\bst\bt or [\b[, the
- <\b< and >\b> operators sort lexicographically using ASCII ordering.
- When the shell is in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, these operators sort using the
+ <\b< and >\b> operators sort lexicographically using ASCII ordering.
+ When the shell is in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, these operators sort using the
current locale.
- t\bti\bim\bme\bes\bs Print the accumulated user and system times for the shell and
+ t\bti\bim\bme\bes\bs Print the accumulated user and system times for the shell and
for processes run from the shell. The return status is 0.
t\btr\bra\bap\bp [-\b-l\blp\bp] [[_\ba_\bc_\bt_\bi_\bo_\bn] _\bs_\bi_\bg_\bs_\bp_\be_\bc ...]
The _\ba_\bc_\bt_\bi_\bo_\bn is a command that is read and executed when the shell
receives signal(s) _\bs_\bi_\bg_\bs_\bp_\be_\bc. If _\ba_\bc_\bt_\bi_\bo_\bn is absent (and there is a
- single _\bs_\bi_\bg_\bs_\bp_\be_\bc) or -\b-, each specified signal is reset to its
- original disposition (the value it had upon entrance to the
- shell). If _\ba_\bc_\bt_\bi_\bo_\bn is the null string the signal specified by
- each _\bs_\bi_\bg_\bs_\bp_\be_\bc is ignored by the shell and by the commands it in-
+ single _\bs_\bi_\bg_\bs_\bp_\be_\bc) or -\b-, each specified signal is reset to its
+ original disposition (the value it had upon entrance to the
+ shell). If _\ba_\bc_\bt_\bi_\bo_\bn is the null string the signal specified by
+ each _\bs_\bi_\bg_\bs_\bp_\be_\bc is ignored by the shell and by the commands it in-
vokes.
- If no arguments are supplied, t\btr\bra\bap\bp displays the actions associ-
+ If no arguments are supplied, t\btr\bra\bap\bp displays the actions associ-
ated with each trapped signal as a set of t\btr\bra\bap\bp commands that can
- be reused as shell input to restore the current signal disposi-
- tions. If -\b-p\bp is given, and _\ba_\bc_\bt_\bi_\bo_\bn is not present, then t\btr\bra\bap\bp
- displays the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc or, if none
+ be reused as shell input to restore the current signal disposi-
+ tions. If -\b-p\bp is given, and _\ba_\bc_\bt_\bi_\bo_\bn is not present, then t\btr\bra\bap\bp
+ displays the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc or, if none
are supplied, for all trapped signals, as a set of t\btr\bra\bap\bp commands
- that can be reused as shell input to restore the current signal
- dispositions. The -\b-P\bP option behaves similarly, but displays
- only the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. -\b-P\bP re-
- quires at least one _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. The -\b-P\bP or -\b-p\bp options to
- t\btr\bra\bap\bp may be used in a subshell environment (e.g., command sub-
- stitution) and, as long as they are used before t\btr\bra\bap\bp is used to
- change a signal's handling, will display the state of its par-
+ that can be reused as shell input to restore the current signal
+ dispositions. The -\b-P\bP option behaves similarly, but displays
+ only the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. -\b-P\bP re-
+ quires at least one _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. The -\b-P\bP or -\b-p\bp options to
+ t\btr\bra\bap\bp may be used in a subshell environment (e.g., command sub-
+ stitution) and, as long as they are used before t\btr\bra\bap\bp is used to
+ change a signal's handling, will display the state of its par-
ent's traps.
- The -\b-l\bl option causes t\btr\bra\bap\bp to print a list of signal names and
- their corresponding numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal
- name defined in <_\bs_\bi_\bg_\bn_\ba_\bl_\b._\bh>, or a signal number. Signal names
+ The -\b-l\bl option causes t\btr\bra\bap\bp to print a list of signal names and
+ their corresponding numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal
+ name defined in <_\bs_\bi_\bg_\bn_\ba_\bl_\b._\bh>, or a signal number. Signal names
are case insensitive and the S\bSI\bIG\bG prefix is optional.
- If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bEX\bXI\bIT\bT (0) the command _\ba_\bc_\bt_\bi_\bo_\bn is executed on exit
- from the shell. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is D\bDE\bEB\bBU\bUG\bG, the command _\ba_\bc_\bt_\bi_\bo_\bn is
+ If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bEX\bXI\bIT\bT (0) the command _\ba_\bc_\bt_\bi_\bo_\bn is executed on exit
+ from the shell. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is D\bDE\bEB\bBU\bUG\bG, the command _\ba_\bc_\bt_\bi_\bo_\bn is
executed before every _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd, _\bf_\bo_\br command, _\bc_\ba_\bs_\be command,
- _\bs_\be_\bl_\be_\bc_\bt command, (( arithmetic command, [[ conditional command,
+ _\bs_\be_\bl_\be_\bc_\bt command, (( arithmetic command, [[ conditional command,
arithmetic _\bf_\bo_\br command, and before the first command executes in
- a shell function (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR in _\bb_\ba_\bs_\bh_\b(_\b1_\b)). Refer to the
- description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the s\bsh\bho\bop\bpt\bt builtin for de-
- tails of its effect on the D\bDE\bEB\bBU\bUG\bG trap. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is R\bRE\bET\bTU\bUR\bRN\bN,
- the command _\ba_\bc_\bt_\bi_\bo_\bn is executed each time a shell function or a
- script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins finishes execut-
+ a shell function (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR in _\bb_\ba_\bs_\bh_\b(_\b1_\b)). Refer to the
+ description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the s\bsh\bho\bop\bpt\bt builtin for de-
+ tails of its effect on the D\bDE\bEB\bBU\bUG\bG trap. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is R\bRE\bET\bTU\bUR\bRN\bN,
+ the command _\ba_\bc_\bt_\bi_\bo_\bn is executed each time a shell function or a
+ script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins finishes execut-
ing.
- If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bER\bRR\bR, the command _\ba_\bc_\bt_\bi_\bo_\bn is executed whenever a
+ If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bER\bRR\bR, the command _\ba_\bc_\bt_\bi_\bo_\bn is executed whenever a
pipeline (which may consist of a single simple command), a list,
or a compound command returns a non-zero exit status, subject to
- the following conditions. The E\bER\bRR\bR trap is not executed if the
+ the following conditions. The E\bER\bRR\bR trap is not executed if the
failed command is part of the command list immediately following
- a w\bwh\bhi\bil\ble\be or u\bun\bnt\bti\bil\bl keyword, part of the test in an _\bi_\bf statement,
+ a w\bwh\bhi\bil\ble\be or u\bun\bnt\bti\bil\bl keyword, part of the test in an _\bi_\bf statement,
part of a command executed in a &\b&&\b& or |\b||\b| list except the command
- following the final &\b&&\b& or |\b||\b|, any command in a pipeline but the
- last, or if the command's return value is being inverted using
+ following the final &\b&&\b& or |\b||\b|, any command in a pipeline but the
+ last, or if the command's return value is being inverted using
!\b!. These are the same conditions obeyed by the e\ber\brr\bre\bex\bxi\bit\bt (-\b-e\be) op-
tion.
When the shell is not interactive, signals ignored upon entry to
the shell cannot be trapped or reset. Interactive shells permit
trapping signals ignored on entry. Trapped signals that are not
- being ignored are reset to their original values in a subshell
- or subshell environment when one is created. The return status
+ being ignored are reset to their original values in a subshell
+ or subshell environment when one is created. The return status
is false if any _\bs_\bi_\bg_\bs_\bp_\be_\bc is invalid; otherwise t\btr\bra\bap\bp returns true.
t\btr\bru\bue\be Does nothing, returns a 0 status.
t\bty\byp\bpe\be [-\b-a\baf\bft\btp\bpP\bP] _\bn_\ba_\bm_\be [_\bn_\ba_\bm_\be ...]
- With no options, indicate how each _\bn_\ba_\bm_\be would be interpreted if
+ With no options, indicate how each _\bn_\ba_\bm_\be would be interpreted if
used as a command name. If the -\b-t\bt option is used, t\bty\byp\bpe\be prints a
- string which is one of _\ba_\bl_\bi_\ba_\bs, _\bk_\be_\by_\bw_\bo_\br_\bd, _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn, _\bb_\bu_\bi_\bl_\bt_\bi_\bn, or
- _\bf_\bi_\bl_\be if _\bn_\ba_\bm_\be is an alias, shell reserved word, function,
- builtin, or executable disk file, respectively. If the _\bn_\ba_\bm_\be is
- not found, then nothing is printed, and t\bty\byp\bpe\be returns a non-zero
- exit status. If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the
- name of the executable file that would be found by searching
- $\b$P\bPA\bAT\bTH\bH if _\bn_\ba_\bm_\be were specified as a command name, or nothing if
- ``type -t name'' would not return _\bf_\bi_\bl_\be. The -\b-P\bP option forces a
- P\bPA\bAT\bTH\bH search for each _\bn_\ba_\bm_\be, even if ``type -t name'' would not
+ string which is one of _\ba_\bl_\bi_\ba_\bs, _\bk_\be_\by_\bw_\bo_\br_\bd, _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn, _\bb_\bu_\bi_\bl_\bt_\bi_\bn, or
+ _\bf_\bi_\bl_\be if _\bn_\ba_\bm_\be is an alias, shell reserved word, function,
+ builtin, or executable disk file, respectively. If the _\bn_\ba_\bm_\be is
+ not found, then nothing is printed, and t\bty\byp\bpe\be returns a non-zero
+ exit status. If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the
+ name of the executable file that would be found by searching
+ $\b$P\bPA\bAT\bTH\bH if _\bn_\ba_\bm_\be were specified as a command name, or nothing if
+ ``type -t name'' would not return _\bf_\bi_\bl_\be. The -\b-P\bP option forces a
+ P\bPA\bAT\bTH\bH search for each _\bn_\ba_\bm_\be, even if ``type -t name'' would not
return _\bf_\bi_\bl_\be. If a command is hashed, -\b-p\bp and -\b-P\bP print the hashed
- value, which is not necessarily the file that appears first in
- P\bPA\bAT\bTH\bH. If the -\b-a\ba option is used, t\bty\byp\bpe\be prints all of the places
- that contain a command named _\bn_\ba_\bm_\be. This includes aliases, re-
- served words, functions, and builtins, but the path search op-
+ value, which is not necessarily the file that appears first in
+ P\bPA\bAT\bTH\bH. If the -\b-a\ba option is used, t\bty\byp\bpe\be prints all of the places
+ that contain a command named _\bn_\ba_\bm_\be. This includes aliases, re-
+ served words, functions, and builtins, but the path search op-
tions (-\b-p\bp and -\b-P\bP) can be supplied to restrict the output to exe-
- cutable files. t\bty\byp\bpe\be does not consult the table of hashed com-
+ cutable files. t\bty\byp\bpe\be does not consult the table of hashed com-
mands when using -\b-a\ba with -\b-p\bp, and only performs a P\bPA\bAT\bTH\bH search for
- _\bn_\ba_\bm_\be. The -\b-f\bf option suppresses shell function lookup, as with
- the c\bco\bom\bmm\bma\ban\bnd\bd builtin. t\bty\byp\bpe\be returns true if all of the arguments
+ _\bn_\ba_\bm_\be. The -\b-f\bf option suppresses shell function lookup, as with
+ the c\bco\bom\bmm\bma\ban\bnd\bd builtin. t\bty\byp\bpe\be returns true if all of the arguments
are found, false if any are not found.
u\bul\bli\bim\bmi\bit\bt [-\b-H\bHS\bS] -\b-a\ba
u\bul\bli\bim\bmi\bit\bt [-\b-H\bHS\bS] [-\b-b\bbc\bcd\bde\bef\bfi\bik\bkl\blm\bmn\bnp\bpq\bqr\brs\bst\btu\buv\bvx\bxP\bPR\bRT\bT [_\bl_\bi_\bm_\bi_\bt]]
- Provides control over the resources available to the shell and
- to processes started by it, on systems that allow such control.
+ Provides control over the resources available to the shell and
+ to processes started by it, on systems that allow such control.
The -\b-H\bH and -\b-S\bS options specify that the hard or soft limit is set
- for the given resource. A hard limit cannot be increased by a
- non-root user once it is set; a soft limit may be increased up
- to the value of the hard limit. If neither -\b-H\bH nor -\b-S\bS is speci-
+ for the given resource. A hard limit cannot be increased by a
+ non-root user once it is set; a soft limit may be increased up
+ to the value of the hard limit. If neither -\b-H\bH nor -\b-S\bS is speci-
fied, both the soft and hard limits are set. The value of _\bl_\bi_\bm_\bi_\bt
can be a number in the unit specified for the resource or one of
the special values h\bha\bar\brd\bd, s\bso\bof\bft\bt, or u\bun\bnl\bli\bim\bmi\bit\bte\bed\bd, which stand for the
- current hard limit, the current soft limit, and no limit, re-
- spectively. If _\bl_\bi_\bm_\bi_\bt is omitted, the current value of the soft
+ current hard limit, the current soft limit, and no limit, re-
+ spectively. If _\bl_\bi_\bm_\bi_\bt is omitted, the current value of the soft
limit of the resource is printed, unless the -\b-H\bH option is given.
- When more than one resource is specified, the limit name and
- unit, if appropriate, are printed before the value. Other op-
+ When more than one resource is specified, the limit name and
+ unit, if appropriate, are printed before the value. Other op-
tions are interpreted as follows:
-\b-a\ba All current limits are reported; no limits are set
-\b-b\bb The maximum socket buffer size
-\b-c\bc The maximum size of core files created
-\b-d\bd The maximum size of a process's data segment
-\b-e\be The maximum scheduling priority ("nice")
- -\b-f\bf The maximum size of files written by the shell and its
+ -\b-f\bf The maximum size of files written by the shell and its
children
-\b-i\bi The maximum number of pending signals
-\b-k\bk The maximum number of kqueues that may be allocated
-\b-l\bl The maximum size that may be locked into memory
- -\b-m\bm The maximum resident set size (many systems do not honor
+ -\b-m\bm The maximum resident set size (many systems do not honor
this limit)
-\b-n\bn The maximum number of open file descriptors (most systems
do not allow this value to be set)
-\b-r\br The maximum real-time scheduling priority
-\b-s\bs The maximum stack size
-\b-t\bt The maximum amount of cpu time in seconds
- -\b-u\bu The maximum number of processes available to a single
+ -\b-u\bu The maximum number of processes available to a single
user
- -\b-v\bv The maximum amount of virtual memory available to the
+ -\b-v\bv The maximum amount of virtual memory available to the
shell and, on some systems, to its children
-\b-x\bx The maximum number of file locks
-\b-P\bP The maximum number of pseudoterminals
- -\b-R\bR The maximum time a real-time process can run before
+ -\b-R\bR The maximum time a real-time process can run before
blocking, in microseconds
-\b-T\bT The maximum number of threads
- If _\bl_\bi_\bm_\bi_\bt is given, and the -\b-a\ba option is not used, _\bl_\bi_\bm_\bi_\bt is the
- new value of the specified resource. If no option is given,
- then -\b-f\bf is assumed. Values are in 1024-byte increments, except
- for -\b-t\bt, which is in seconds; -\b-R\bR, which is in microseconds; -\b-p\bp,
- which is in units of 512-byte blocks; -\b-P\bP, -\b-T\bT, -\b-b\bb, -\b-k\bk, -\b-n\bn, and
- -\b-u\bu, which are unscaled values; and, when in posix mode, -\b-c\bc and
- -\b-f\bf, which are in 512-byte increments. The return status is 0
- unless an invalid option or argument is supplied, or an error
+ If _\bl_\bi_\bm_\bi_\bt is given, and the -\b-a\ba option is not used, _\bl_\bi_\bm_\bi_\bt is the
+ new value of the specified resource. If no option is given,
+ then -\b-f\bf is assumed. Values are in 1024-byte increments, except
+ for -\b-t\bt, which is in seconds; -\b-R\bR, which is in microseconds; -\b-p\bp,
+ which is in units of 512-byte blocks; -\b-P\bP, -\b-T\bT, -\b-b\bb, -\b-k\bk, -\b-n\bn, and
+ -\b-u\bu, which are unscaled values; and, when in posix mode, -\b-c\bc and
+ -\b-f\bf, which are in 512-byte increments. The return status is 0
+ unless an invalid option or argument is supplied, or an error
occurs while setting a new limit.
u\bum\bma\bas\bsk\bk [-\b-p\bp] [-\b-S\bS] [_\bm_\bo_\bd_\be]
The user file-creation mask is set to _\bm_\bo_\bd_\be. If _\bm_\bo_\bd_\be begins with
- a digit, it is interpreted as an octal number; otherwise it is
- interpreted as a symbolic mode mask similar to that accepted by
- _\bc_\bh_\bm_\bo_\bd(1). If _\bm_\bo_\bd_\be is omitted, the current value of the mask is
- printed. The -\b-S\bS option causes the mask to be printed in sym-
- bolic form; the default output is an octal number. If the -\b-p\bp
+ a digit, it is interpreted as an octal number; otherwise it is
+ interpreted as a symbolic mode mask similar to that accepted by
+ _\bc_\bh_\bm_\bo_\bd(1). If _\bm_\bo_\bd_\be is omitted, the current value of the mask is
+ printed. The -\b-S\bS option causes the mask to be printed in sym-
+ bolic form; the default output is an octal number. If the -\b-p\bp
option is supplied, and _\bm_\bo_\bd_\be is omitted, the output is in a form
that may be reused as input. The return status is 0 if the mode
- was successfully changed or if no _\bm_\bo_\bd_\be argument was supplied,
+ was successfully changed or if no _\bm_\bo_\bd_\be argument was supplied,
and false otherwise.
u\bun\bna\bal\bli\bia\bas\bs [-a\ba] [_\bn_\ba_\bm_\be ...]
- Remove each _\bn_\ba_\bm_\be from the list of defined aliases. If -\b-a\ba is
- supplied, all alias definitions are removed. The return value
+ Remove each _\bn_\ba_\bm_\be from the list of defined aliases. If -\b-a\ba is
+ supplied, all alias definitions are removed. The return value
is true unless a supplied _\bn_\ba_\bm_\be is not a defined alias.
u\bun\bns\bse\bet\bt [-f\bfv\bv] [-n\bn] [_\bn_\ba_\bm_\be ...]
- For each _\bn_\ba_\bm_\be, remove the corresponding variable or function.
+ For each _\bn_\ba_\bm_\be, remove the corresponding variable or function.
If the -\b-v\bv option is given, each _\bn_\ba_\bm_\be refers to a shell variable,
- and that variable is removed. Read-only variables may not be
- unset. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be refers to a shell func-
- tion, and the function definition is removed. If the -\b-n\bn option
- is supplied, and _\bn_\ba_\bm_\be is a variable with the _\bn_\ba_\bm_\be_\br_\be_\bf attribute,
- _\bn_\ba_\bm_\be will be unset rather than the variable it references. -\b-n\bn
- has no effect if the -\b-f\bf option is supplied. If no options are
- supplied, each _\bn_\ba_\bm_\be refers to a variable; if there is no vari-
- able by that name, a function with that name, if any, is unset.
- Each unset variable or function is removed from the environment
- passed to subsequent commands. If any of B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS,
+ and that variable is removed. Read-only variables may not be
+ unset. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be refers to a shell func-
+ tion, and the function definition is removed. If the -\b-n\bn option
+ is supplied, and _\bn_\ba_\bm_\be is a variable with the _\bn_\ba_\bm_\be_\br_\be_\bf attribute,
+ _\bn_\ba_\bm_\be will be unset rather than the variable it references. -\b-n\bn
+ has no effect if the -\b-f\bf option is supplied. If no options are
+ supplied, each _\bn_\ba_\bm_\be refers to a variable; if there is no vari-
+ able by that name, a function with that name, if any, is unset.
+ Each unset variable or function is removed from the environment
+ passed to subsequent commands. If any of B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS,
B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV0\b0, B\bBA\bAS\bSH\bH_\b_C\bCM\bMD\bDS\bS, B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD, B\bBA\bAS\bSH\bH_\b_S\bSU\bUB\bBS\bSH\bHE\bEL\bLL\bL, B\bBA\bAS\bSH\bHP\bPI\bID\bD,
- C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS, D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK, E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE, E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS, F\bFU\bUN\bNC\bC-\b-
- N\bNA\bAM\bME\bE, G\bGR\bRO\bOU\bUP\bPS\bS, H\bHI\bIS\bST\bTC\bCM\bMD\bD, L\bLI\bIN\bNE\bEN\bNO\bO, R\bRA\bAN\bND\bDO\bOM\bM, S\bSE\bEC\bCO\bON\bND\bDS\bS, or S\bSR\bRA\bAN\bND\bDO\bOM\bM are
+ C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS, D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK, E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE, E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS, F\bFU\bUN\bNC\bC-\b-
+ N\bNA\bAM\bME\bE, G\bGR\bRO\bOU\bUP\bPS\bS, H\bHI\bIS\bST\bTC\bCM\bMD\bD, L\bLI\bIN\bNE\bEN\bNO\bO, R\bRA\bAN\bND\bDO\bOM\bM, S\bSE\bEC\bCO\bON\bND\bDS\bS, or S\bSR\bRA\bAN\bND\bDO\bOM\bM are
unset, they lose their special properties, even if they are sub-
sequently reset. The exit status is true unless a _\bn_\ba_\bm_\be is read-
only or may not be unset.
w\bwa\bai\bit\bt [-\b-f\bfn\bn] [-\b-p\bp _\bv_\ba_\br_\bn_\ba_\bm_\be] [_\bi_\bd _\b._\b._\b.]
Wait for each specified child process and return its termination
- status. Each _\bi_\bd may be a process ID or a job specification; if
- a job spec is given, all processes in that job's pipeline are
- waited for. If _\bi_\bd is not given, w\bwa\bai\bit\bt waits for all running
- background jobs and the last-executed process substitution, if
+ status. Each _\bi_\bd may be a process ID or a job specification; if
+ a job spec is given, all processes in that job's pipeline are
+ waited for. If _\bi_\bd is not given, w\bwa\bai\bit\bt waits for all running
+ background jobs and the last-executed process substitution, if
its process id is the same as $\b$!\b!, and the return status is zero.
- If the -\b-n\bn option is supplied, w\bwa\bai\bit\bt waits for a single job from
+ If the -\b-n\bn option is supplied, w\bwa\bai\bit\bt waits for a single job from
the list of _\bi_\bds or, if no _\bi_\bds are supplied, any job, to complete
- and returns its exit status. If none of the supplied arguments
+ and returns its exit status. If none of the supplied arguments
is a child of the shell, or if no arguments are supplied and the
- shell has no unwaited-for children, the exit status is 127. If
- the -\b-p\bp option is supplied, the process or job identifier of the
- job for which the exit status is returned is assigned to the
- variable _\bv_\ba_\br_\bn_\ba_\bm_\be named by the option argument. The variable
- will be unset initially, before any assignment. This is useful
- only when the -\b-n\bn option is supplied. Supplying the -\b-f\bf option,
- when job control is enabled, forces w\bwa\bai\bit\bt to wait for _\bi_\bd to ter-
+ shell has no unwaited-for children, the exit status is 127. If
+ the -\b-p\bp option is supplied, the process or job identifier of the
+ job for which the exit status is returned is assigned to the
+ variable _\bv_\ba_\br_\bn_\ba_\bm_\be named by the option argument. The variable
+ will be unset initially, before any assignment. This is useful
+ only when the -\b-n\bn option is supplied. Supplying the -\b-f\bf option,
+ when job control is enabled, forces w\bwa\bai\bit\bt to wait for _\bi_\bd to ter-
minate before returning its status, instead of returning when it
- changes status. If _\bi_\bd specifies a non-existent process or job,
- the return status is 127. If w\bwa\bai\bit\bt is interrupted by a signal,
- the return status will be greater than 128, as described under
- S\bSI\bIG\bGN\bNA\bAL\bLS\bS in _\bb_\ba_\bs_\bh_\b(_\b1_\b). Otherwise, the return status is the exit
+ changes status. If _\bi_\bd specifies a non-existent process or job,
+ the return status is 127. If w\bwa\bai\bit\bt is interrupted by a signal,
+ the return status will be greater than 128, as described under
+ S\bSI\bIG\bGN\bNA\bAL\bLS\bS in _\bb_\ba_\bs_\bh_\b(_\b1_\b). Otherwise, the return status is the exit
status of the last process or job waited for.
S\bSH\bHE\bEL\bLL\bL C\bCO\bOM\bMP\bPA\bAT\bTI\bIB\bBI\bIL\bLI\bIT\bTY\bY M\bMO\bOD\bDE\bE
- Bash-4.0 introduced the concept of a _\bs_\bh_\be_\bl_\bl _\bc_\bo_\bm_\bp_\ba_\bt_\bi_\bb_\bi_\bl_\bi_\bt_\by _\bl_\be_\bv_\be_\bl, speci-
- fied as a set of options to the shopt builtin ( c\bco\bom\bmp\bpa\bat\bt3\b31\b1, c\bco\bom\bmp\bpa\bat\bt3\b32\b2,
- c\bco\bom\bmp\bpa\bat\bt4\b40\b0, c\bco\bom\bmp\bpa\bat\bt4\b41\b1, and so on). There is only one current compatibil-
- ity level -- each option is mutually exclusive. The compatibility
- level is intended to allow users to select behavior from previous ver-
- sions that is incompatible with newer versions while they migrate
- scripts to use current features and behavior. It's intended to be a
+ Bash-4.0 introduced the concept of a _\bs_\bh_\be_\bl_\bl _\bc_\bo_\bm_\bp_\ba_\bt_\bi_\bb_\bi_\bl_\bi_\bt_\by _\bl_\be_\bv_\be_\bl, speci-
+ fied as a set of options to the shopt builtin ( c\bco\bom\bmp\bpa\bat\bt3\b31\b1, c\bco\bom\bmp\bpa\bat\bt3\b32\b2,
+ c\bco\bom\bmp\bpa\bat\bt4\b40\b0, c\bco\bom\bmp\bpa\bat\bt4\b41\b1, and so on). There is only one current compatibil-
+ ity level -- each option is mutually exclusive. The compatibility
+ level is intended to allow users to select behavior from previous ver-
+ sions that is incompatible with newer versions while they migrate
+ scripts to use current features and behavior. It's intended to be a
temporary solution.
- This section does not mention behavior that is standard for a particu-
- lar version (e.g., setting c\bco\bom\bmp\bpa\bat\bt3\b32\b2 means that quoting the rhs of the
- regexp matching operator quotes special regexp characters in the word,
+ This section does not mention behavior that is standard for a particu-
+ lar version (e.g., setting c\bco\bom\bmp\bpa\bat\bt3\b32\b2 means that quoting the rhs of the
+ regexp matching operator quotes special regexp characters in the word,
which is default behavior in bash-3.2 and subsequent versions).
- If a user enables, say, c\bco\bom\bmp\bpa\bat\bt3\b32\b2, it may affect the behavior of other
- compatibility levels up to and including the current compatibility
- level. The idea is that each compatibility level controls behavior
- that changed in that version of b\bba\bas\bsh\bh, but that behavior may have been
- present in earlier versions. For instance, the change to use locale-
- based comparisons with the [\b[[\b[ command came in bash-4.1, and earlier
+ If a user enables, say, c\bco\bom\bmp\bpa\bat\bt3\b32\b2, it may affect the behavior of other
+ compatibility levels up to and including the current compatibility
+ level. The idea is that each compatibility level controls behavior
+ that changed in that version of b\bba\bas\bsh\bh, but that behavior may have been
+ present in earlier versions. For instance, the change to use locale-
+ based comparisons with the [\b[[\b[ command came in bash-4.1, and earlier
versions used ASCII-based comparisons, so enabling c\bco\bom\bmp\bpa\bat\bt3\b32\b2 will enable
- ASCII-based comparisons as well. That granularity may not be suffi-
- cient for all uses, and as a result users should employ compatibility
- levels carefully. Read the documentation for a particular feature to
+ ASCII-based comparisons as well. That granularity may not be suffi-
+ cient for all uses, and as a result users should employ compatibility
+ levels carefully. Read the documentation for a particular feature to
find out the current behavior.
- Bash-4.3 introduced a new shell variable: B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT. The value as-
+ Bash-4.3 introduced a new shell variable: B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT. The value as-
signed to this variable (a decimal version number like 4.2, or an inte-
- ger corresponding to the c\bco\bom\bmp\bpa\bat\bt_\bN_\bN option, like 42) determines the com-
+ ger corresponding to the c\bco\bom\bmp\bpa\bat\bt_\bN_\bN option, like 42) determines the com-
patibility level.
- Starting with bash-4.4, Bash has begun deprecating older compatibility
- levels. Eventually, the options will be removed in favor of B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bM-\b-
+ Starting with bash-4.4, Bash has begun deprecating older compatibility
+ levels. Eventually, the options will be removed in favor of B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bM-\b-
P\bPA\bAT\bT.
- Bash-5.0 is the final version for which there will be an individual
- shopt option for the previous version. Users should use B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT on
+ Bash-5.0 is the final version for which there will be an individual
+ shopt option for the previous version. Users should use B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT on
bash-5.0 and later versions.
- The following table describes the behavior changes controlled by each
+ The following table describes the behavior changes controlled by each
compatibility level setting. The c\bco\bom\bmp\bpa\bat\bt_\bN_\bN tag is used as shorthand for
setting the compatibility level to _\bN_\bN using one of the following mecha-
- nisms. For versions prior to bash-5.0, the compatibility level may be
- set using the corresponding c\bco\bom\bmp\bpa\bat\bt_\bN_\bN shopt option. For bash-4.3 and
- later versions, the B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT variable is preferred, and it is re-
+ nisms. For versions prior to bash-5.0, the compatibility level may be
+ set using the corresponding c\bco\bom\bmp\bpa\bat\bt_\bN_\bN shopt option. For bash-4.3 and
+ later versions, the B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT variable is preferred, and it is re-
quired for bash-5.1 and later versions.
c\bco\bom\bmp\bpa\bat\bt3\b31\b1
ator (=~) has no special effect
c\bco\bom\bmp\bpa\bat\bt3\b32\b2
- +\bo interrupting a command list such as "a ; b ; c" causes
- the execution of the next command in the list (in
- bash-4.0 and later versions, the shell acts as if it re-
- ceived the interrupt, so interrupting one command in a
+ +\bo interrupting a command list such as "a ; b ; c" causes
+ the execution of the next command in the list (in
+ bash-4.0 and later versions, the shell acts as if it re-
+ ceived the interrupt, so interrupting one command in a
list aborts the execution of the entire list)
c\bco\bom\bmp\bpa\bat\bt4\b40\b0
- +\bo the <\b< and >\b> operators to the [\b[[\b[ command do not consider
+ +\bo the <\b< and >\b> operators to the [\b[[\b[ command do not consider
the current locale when comparing strings; they use ASCII
ordering. Bash versions prior to bash-4.1 use ASCII col-
- lation and _\bs_\bt_\br_\bc_\bm_\bp(3); bash-4.1 and later use the current
+ lation and _\bs_\bt_\br_\bc_\bm_\bp(3); bash-4.1 and later use the current
locale's collation sequence and _\bs_\bt_\br_\bc_\bo_\bl_\bl(3).
c\bco\bom\bmp\bpa\bat\bt4\b41\b1
- +\bo in _\bp_\bo_\bs_\bi_\bx mode, t\bti\bim\bme\be may be followed by options and still
+ +\bo in _\bp_\bo_\bs_\bi_\bx mode, t\bti\bim\bme\be may be followed by options and still
be recognized as a reserved word (this is POSIX interpre-
tation 267)
+\bo in _\bp_\bo_\bs_\bi_\bx mode, the parser requires that an even number of
- single quotes occur in the _\bw_\bo_\br_\bd portion of a double-
- quoted parameter expansion and treats them specially, so
- that characters within the single quotes are considered
+ single quotes occur in the _\bw_\bo_\br_\bd portion of a double-
+ quoted parameter expansion and treats them specially, so
+ that characters within the single quotes are considered
quoted (this is POSIX interpretation 221)
c\bco\bom\bmp\bpa\bat\bt4\b42\b2
+\bo the replacement string in double-quoted pattern substitu-
- tion does not undergo quote removal, as it does in ver-
+ tion does not undergo quote removal, as it does in ver-
sions after bash-4.2
- +\bo in posix mode, single quotes are considered special when
- expanding the _\bw_\bo_\br_\bd portion of a double-quoted parameter
- expansion and can be used to quote a closing brace or
- other special character (this is part of POSIX interpre-
- tation 221); in later versions, single quotes are not
+ +\bo in posix mode, single quotes are considered special when
+ expanding the _\bw_\bo_\br_\bd portion of a double-quoted parameter
+ expansion and can be used to quote a closing brace or
+ other special character (this is part of POSIX interpre-
+ tation 221); in later versions, single quotes are not
special within double-quoted word expansions
c\bco\bom\bmp\bpa\bat\bt4\b43\b3
- +\bo the shell does not print a warning message if an attempt
- is made to use a quoted compound assignment as an argu-
- ment to declare (e.g., declare -a foo='(1 2)'). Later
+ +\bo the shell does not print a warning message if an attempt
+ is made to use a quoted compound assignment as an argu-
+ ment to declare (e.g., declare -a foo='(1 2)'). Later
versions warn that this usage is deprecated
- +\bo word expansion errors are considered non-fatal errors
- that cause the current command to fail, even in posix
- mode (the default behavior is to make them fatal errors
+ +\bo word expansion errors are considered non-fatal errors
+ that cause the current command to fail, even in posix
+ mode (the default behavior is to make them fatal errors
that cause the shell to exit)
- +\bo when executing a shell function, the loop state
+ +\bo when executing a shell function, the loop state
(while/until/etc.) is not reset, so b\bbr\bre\bea\bak\bk or c\bco\bon\bnt\bti\bin\bnu\bue\be in
that function will break or continue loops in the calling
- context. Bash-4.4 and later reset the loop state to pre-
+ context. Bash-4.4 and later reset the loop state to pre-
vent this
c\bco\bom\bmp\bpa\bat\bt4\b44\b4
- +\bo the shell sets up the values used by B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV and
- B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC so they can expand to the shell's positional
+ +\bo the shell sets up the values used by B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV and
+ B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC so they can expand to the shell's positional
parameters even if extended debugging mode is not enabled
- +\bo a subshell inherits loops from its parent context, so
- b\bbr\bre\bea\bak\bk or c\bco\bon\bnt\bti\bin\bnu\bue\be will cause the subshell to exit.
- Bash-5.0 and later reset the loop state to prevent the
+ +\bo a subshell inherits loops from its parent context, so
+ b\bbr\bre\bea\bak\bk or c\bco\bon\bnt\bti\bin\bnu\bue\be will cause the subshell to exit.
+ Bash-5.0 and later reset the loop state to prevent the
exit
- +\bo variable assignments preceding builtins like e\bex\bxp\bpo\bor\brt\bt and
+ +\bo variable assignments preceding builtins like e\bex\bxp\bpo\bor\brt\bt and
r\bre\bea\bad\bdo\bon\bnl\bly\by that set attributes continue to affect variables
with the same name in the calling environment even if the
shell is not in posix mode
c\bco\bom\bmp\bpa\bat\bt5\b50\b0
- +\bo Bash-5.1 changed the way $\b$R\bRA\bAN\bND\bDO\bOM\bM is generated to intro-
+ +\bo Bash-5.1 changed the way $\b$R\bRA\bAN\bND\bDO\bOM\bM is generated to intro-
duce slightly more randomness. If the shell compatibility
- level is set to 50 or lower, it reverts to the method
- from bash-5.0 and previous versions, so seeding the ran-
- dom number generator by assigning a value to R\bRA\bAN\bND\bDO\bOM\bM will
+ level is set to 50 or lower, it reverts to the method
+ from bash-5.0 and previous versions, so seeding the ran-
+ dom number generator by assigning a value to R\bRA\bAN\bND\bDO\bOM\bM will
produce the same sequence as in bash-5.0
- +\bo If the command hash table is empty, bash versions prior
- to bash-5.1 printed an informational message to that ef-
- fect, even when producing output that can be reused as
- input. Bash-5.1 suppresses that message when the -\b-l\bl op-
+ +\bo If the command hash table is empty, bash versions prior
+ to bash-5.1 printed an informational message to that ef-
+ fect, even when producing output that can be reused as
+ input. Bash-5.1 suppresses that message when the -\b-l\bl op-
tion is supplied.
c\bco\bom\bmp\bpa\bat\bt5\b51\b1
- +\bo The u\bun\bns\bse\bet\bt builtin treats attempts to unset array sub-
- scripts @\b@ and *\b* differently depending on whether the ar-
- ray is indexed or associative, and differently than in
+ +\bo The u\bun\bns\bse\bet\bt builtin treats attempts to unset array sub-
+ scripts @\b@ and *\b* differently depending on whether the ar-
+ ray is indexed or associative, and differently than in
previous versions.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
Copyright (C) 1988-2023 Free Software Foundation, Inc.
@end ignore
-@set LASTCHANGE Wed Jul 19 14:23:20 EDT 2023
+@set LASTCHANGE Wed Jul 26 09:57:28 EDT 2023
@set EDITION 5.3
@set VERSION 5.3
-@set UPDATED 19 July 2023
+@set UPDATED 26 July 2023
@set UPDATED-MONTH July 2023
If \fIstring\fP is missing, the string from the most recent search is used;
it is an error if there is no previous search string.
.TP
-.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u
+.B \d\s+2\(ha\s-2\u\fIstring1\fP\d\s+2\(ha\s-2\u\fIstring2\fP\d\s+2\(ha\s-2\u
Quick substitution. Repeat the last command, replacing
.I string1
with
.IR string2 .
Equivalent to
-``!!:s\d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u''
+``!!:s\d\s+2\(ha\s-2\u\fIstring1\fP\d\s+2\(ha\s-2\u\fIstring2\fP\d\s+2\(ha\s-2\u''
(see \fBModifiers\fP below).
.TP
.B !#
.B :
separates the event specification from the word designator.
It may be omitted if the word designator begins with a
-.BR ^ ,
+.BR \(ha ,
.BR $ ,
.BR * ,
.BR \- ,
.I n
The \fIn\fRth word.
.TP
-.B ^
+.B \(ha
The first argument. That is, word 1.
.TP
.B $
.Fn1 int read_history "const char *filename"
Add the contents of \fIfilename\fP to the history list, a line at a time.
-If \fIfilename\fP is \fBNULL\fP, then read from \fI~/.history\fP.
+If \fIfilename\fP is \fBNULL\fP, then read from \fI\(ti/.history\fP.
Returns 0 if successful, or \fBerrno\fP if not.
.Fn3 int read_history_range "const char *filename" "int from" "int to"
Start reading at line \fIfrom\fP and end at \fIto\fP.
If \fIfrom\fP is zero, start at the beginning. If \fIto\fP is less than
\fIfrom\fP, then read until the end of the file. If \fIfilename\fP is
-\fBNULL\fP, then read from \fI~/.history\fP. Returns 0 if successful,
+\fBNULL\fP, then read from \fI\(ti/.history\fP. Returns 0 if successful,
or \fBerrno\fP if not.
.Fn1 int write_history "const char *filename"
Write the current history to \fIfilename\fP, overwriting \fIfilename\fP
if necessary.
-If \fIfilename\fP is \fBNULL\fP, then write the history list to \fI~/.history\fP.
+If \fIfilename\fP is \fBNULL\fP, then write the history list to \fI\(ti/.history\fP.
Returns 0 on success, or \fBerrno\fP on a read or write error.
.Fn2 int append_history "int nelements" "const char *filename"
Append the last \fInelements\fP of the history list to \fIfilename\fP.
-If \fIfilename\fP is \fBNULL\fP, then append to \fI~/.history\fP.
+If \fIfilename\fP is \fBNULL\fP, then append to \fI\(ti/.history\fP.
Returns 0 on success, or \fBerrno\fP on a read or write error.
.Fn2 int history_truncate_file "const char *filename" "int nlines"
Truncate the history file \fIfilename\fP, leaving only the last
\fInlines\fP lines.
-If \fIfilename\fP is \fBNULL\fP, then \fI~/.history\fP is truncated.
+If \fIfilename\fP is \fBNULL\fP, then \fI\(ti/.history\fP is truncated.
Returns 0 on success, or \fBerrno\fP on failure.
.SS History Expansion
.Vb char history_subst_char
The character that invokes word substitution if found at the start of
-a line. The default is \fB^\fP.
+a line. The default is \fB\(ha\fP.
.Vb char history_comment_char
During tokenization, if this character is seen as the first character
.SH FILES
.PD 0
.TP
-.FN ~/.history
+.FN \(ti/.history
Default filename for reading and writing saved history
.PD
.SH "SEE ALSO"
The name of this file is taken from the value of the
.B INPUTRC
environment variable. If that variable is unset, the default is
-.IR ~/.inputrc .
+.IR \(ti/.inputrc .
If that file does not exist or cannot be read, the ultimate default is
.IR /etc/inputrc .
When a program which uses the readline library starts up, the
.br
"\eC\-x\eC\-r": re\-read\-init\-file
.br
-"\ee[11~": "Function Key 1"
+"\ee[11\(ti": "Function Key 1"
.RE
.PP
In this example,
is bound to the function
.BR re\-read\-init\-file ,
and
-.I "ESC [ 1 1 ~"
+.I "ESC [ 1 1 \(ti"
is bound to insert the text
.if t \f(CWFunction Key 1\fP.
.if n ``Function Key 1''.
.BR Bash ,
for instance, attempts completion treating the text as a variable
(if the text begins with \fB$\fP), username (if the text begins with
-\fB~\fP), hostname (if the text begins with \fB@\fP), or
+\fB\(ti\fP), hostname (if the text begins with \fB@\fP), or
command (including aliases and functions) in turn. If none
of these produces a match, filename completion is attempted.
.BR Gdb ,
"C-_" undo
"\^ " to "/" self-insert
"0" to "9" self-insert
-":" to "~" self-insert
+":" to "\(ti" self-insert
"C-?" backward-delete-char
.PP
Emacs Meta bindings
"M-U" upcase-word
"M-Y" yank-pop
"M-\e" delete-horizontal-space
-"M-~" tilde-expand
+"M-\(ti" tilde-expand
"M-C-?" backward-kill-word
"M-_" yank-last-arg
.PP
"C-Y" yank
"C-[" vi-movement-mode
"C-_" undo
-"\^ " to "~" self-insert
+"\^ " to "\(ti" self-insert
"C-?" backward-delete-char
.PP
VI Command Mode functions
"X" backward-delete-char
"Y" vi-yank-to
"\e" vi-complete
-"^" vi-first-print
+"\(ha" vi-first-print
"_" vi-yank-arg
"`" vi-goto-mark
"a" vi-append-mode
"x" vi-delete
"y" vi-yank-to
"|" vi-column
-"~" vi-change-case
+"\(ti" vi-change-case
.RE
.SH "SEE ALSO"
.PD 0
.SH FILES
.PD 0
.TP
-.FN ~/.inputrc
+.FN \(ti/.inputrc
Individual \fBreadline\fP initialization file
.PD
.SH AUTHORS
}
COMMAND *
-make_bare_simple_command (void)
+make_bare_simple_command (int line)
{
COMMAND *command;
SIMPLE_COM *temp;
command->value.Simple = temp = (SIMPLE_COM *)xmalloc (sizeof (SIMPLE_COM));
temp->flags = 0;
- temp->line = line_number;
+ temp->line = line;
temp->words = (WORD_LIST *)NULL;
temp->redirects = (REDIRECT *)NULL;
/* Return a command which is the connection of the word or redirection
in ELEMENT, and the command * or NULL in COMMAND. */
COMMAND *
-make_simple_command (ELEMENT element, COMMAND *command)
+make_simple_command (ELEMENT element, COMMAND *command, int line)
{
/* If we are starting from scratch, then make the initial command
structure. Also note that we have to fill in all the slots, since
malloc doesn't return zeroed space. */
if (command == 0)
{
- command = make_bare_simple_command ();
+ command = make_bare_simple_command (line);
parser_state |= PST_REDIRLIST;
}
extern COMMAND *make_if_command (COMMAND *, COMMAND *, COMMAND *);
extern COMMAND *make_while_command (COMMAND *, COMMAND *);
extern COMMAND *make_until_command (COMMAND *, COMMAND *);
-extern COMMAND *make_bare_simple_command (void);
-extern COMMAND *make_simple_command (ELEMENT, COMMAND *);
+extern COMMAND *make_bare_simple_command (int);
+extern COMMAND *make_simple_command (ELEMENT, COMMAND *, int);
extern void make_here_document (REDIRECT *, int);
extern REDIRECT *make_redirection (REDIRECTEE, enum r_instruction, REDIRECTEE, int);
extern COMMAND *make_function_def (WORD_DESC *, COMMAND *, int, int);
shell_ungetc when we're at the start of a line. */
static int eol_ungetc_lookahead = 0;
+static int simplecmd_lineno = -1;
+static int save_simple_lineno = -1;
+
/* The line number in a script on which a function definition starts. */
static int function_dstart;
static int save_dstart = -1;
| ASSIGNMENT_WORD
{ $$.word = $1; $$.redirect = 0; }
| redirection
- { $$.redirect = $1; $$.word = 0; }
+ {
+ if (simplecmd_lineno == -1)
+ simplecmd_lineno = line_number; /* XXX */
+ $$.redirect = $1; $$.word = 0;
+ }
;
redirection_list: redirection
;
simple_command: simple_command_element
- { $$ = make_simple_command ($1, (COMMAND *)NULL); }
+ { $$ = make_simple_command ($1, (COMMAND *)NULL, simplecmd_lineno); }
| simple_command simple_command_element
- { $$ = make_simple_command ($2, $1); }
+ { $$ = make_simple_command ($2, $1, line_number); }
;
command: simple_command
- { $$ = clean_simple_command ($1); }
+ { $$ = clean_simple_command ($1); simplecmd_lineno = -1; }
| shell_command
{ $$ = $1; }
| shell_command redirection_list
;
function_def: WORD '(' ')' newline_list function_body
- { $$ = make_function_def ($1, $5, function_dstart, function_bstart); function_dstart = save_dstart; }
+ { $$ = make_function_def ($1, $5, function_dstart, function_bstart); function_dstart = save_dstart; simplecmd_lineno = -1; }
| FUNCTION WORD '(' ')' newline_list function_body
{ $$ = make_function_def ($2, $6, function_dstart, function_bstart); function_dstart = save_dstart; }
| FUNCTION WORD function_body
terminate this, one to terminate the command) */
x.word = 0;
x.redirect = 0;
- $$ = make_simple_command (x, (COMMAND *)NULL);
+ $$ = make_simple_command (x, (COMMAND *)NULL, line_number);
$$->flags |= $1;
/* XXX - let's cheat and push a newline back */
if ($2 == '\n')
terminate this, one to terminate the command) */
x.word = 0;
x.redirect = 0;
- $$ = make_simple_command (x, (COMMAND *)NULL);
+ $$ = make_simple_command (x, (COMMAND *)NULL, line_number);
$$->flags |= CMD_INVERT_RETURN;
/* XXX - let's cheat and push a newline back */
if ($2 == '\n')
redir_stack[0] = 0;
esacs_needed_count = expecting_in_token = 0;
+ simplecmd_lineno = line_number;
+
current_token = '\n'; /* XXX */
last_read_token = '\n';
token_to_read = '\n';
parse_comsub (int qc, int open, int close, size_t *lenp, int flags)
{
int peekc, r;
- int start_lineno, dolbrace_spec, local_extglob, was_extpat;
+ int dolbrace_spec, local_extglob, was_extpat;
+ int start_lineno, save_lineno;
int was_word, was_newline, was_semi, was_amp;
char *ret, *tcmd;
size_t retlen;
/*debug_parser(1);*/
start_lineno = line_number;
+ save_lineno = simplecmd_lineno;
save_parser_state (&ps);
restore_parser_state (&ps);
pushed_string_list = saved_strings;
+ simplecmd_lineno = save_lineno;
+
tcmd = print_comsub (parsed_command); /* returns static memory */
retlen = strlen (tcmd);
if (open == '(') /* ) */
sh_parser_state_t ps;
sh_input_line_state_t ls;
int orig_ind, nc, sflags, start_lineno, local_extglob, funsub, closer;
+ int save_lineno;
char *ret, *ep, *ostring;
/*debug_parser(1);*/
orig_ind = *indp;
ostring = string;
start_lineno = line_number;
+ save_lineno = simplecmd_lineno;
if (*string == 0)
{
#endif
token_to_read = 0;
+ simplecmd_lineno = save_lineno;
+
/* If parse_string returns < 0, we need to jump to top level with the
negative of the return value. We abandon the rest of this input line
first */
result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT))
? ASSIGNMENT_WORD : WORD;
+ /* Are we potentially starting a simple command? */
+ if (command_token_position (last_read_token))
+ simplecmd_lineno = line_number;
+
switch (last_read_token)
{
case FUNCTION:
-./comsub.tests: line 20: hijkl: command not found
+./comsub.tests: line 19: hijkl: command not found
argv[1] = <ab>
argv[2] = <cd>
argv[1] = <abmn>
JOBaa bb cc ddCONTROL
./comsub2.tests: line 68: p: command not found
NOTFOUND
-./comsub2.tests: line 79: p: command not found
-./comsub2.tests: line 79: p: command not found
+./comsub2.tests: line 75: p: command not found
+./comsub2.tests: line 75: p: command not found
expand_aliases off
expand_aliases off
outside:
foo bar
./heredoc7.sub: line 21: after: command not found
./heredoc7.sub: line 29: warning: here-document at line 29 delimited by end-of-file (wanted `EOF')
-./heredoc7.sub: line 29: foobar: command not found
-./heredoc7.sub: line 30: EOF: command not found
+./heredoc7.sub: line 26: foobar: command not found
+./heredoc7.sub: line 27: EOF: command not found
grep: *.c: No such file or directory
foo ()
{