diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index e351bef3..becb7f65 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -7255,3 +7255,45 @@ jobs.c the SIGCONT succeeds or if the process has terminated so we can clean it up later. Report from Earl Chew + +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 + + 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 diff --git a/builtins/command.def b/builtins/command.def index a681c9f1..b5f0e188 100644 --- a/builtins/command.def +++ b/builtins/command.def @@ -53,6 +53,7 @@ $END #include "../shell.h" #include "../execute_cmd.h" #include "../flags.h" +#include "../parser.h" #include "bashgetopt.h" #include "common.h" @@ -125,7 +126,7 @@ command_builtin (WORD_LIST *list) /* 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; diff --git a/builtins/complete.def b/builtins/complete.def index 74d966d5..aeae2438 100644 --- a/builtins/complete.def +++ b/builtins/complete.def @@ -724,6 +724,8 @@ compgen_builtin (WORD_LIST *list) 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; diff --git a/builtins/jobs.def b/builtins/jobs.def index 56529705..7b212a3f 100644 --- a/builtins/jobs.def +++ b/builtins/jobs.def @@ -61,6 +61,7 @@ $END #include "../shell.h" #include "../jobs.h" #include "../execute_cmd.h" +#include "../parser.h" #include "bashgetopt.h" #include "common.h" @@ -200,7 +201,7 @@ execute_list_with_replacements (WORD_LIST *list) /* 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; diff --git a/builtins/printf.def b/builtins/printf.def index 62820514..88a02a3a 100644 --- a/builtins/printf.def +++ b/builtins/printf.def @@ -780,7 +780,8 @@ printf_builtin (WORD_LIST *list) 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. */ diff --git a/doc/bash.0 b/doc/bash.0 index 94ab45da..fa5ad0ce 100644 --- a/doc/bash.0 +++ b/doc/bash.0 @@ -5065,10 +5065,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS characters is enabled. The --EE option disables the interpreta- tion of these escape characters, even on systems where they are interpreted by default. The xxppgg__eecchhoo shell option may be used - to dynamically determine whether or not eecchhoo expands these es- - cape characters by default. eecchhoo does not interpret ---- to mean - the end of options. eecchhoo interprets the following escape se- - quences: + to dynamically determine whether or not eecchhoo interprets any op- + tions and expands these escape characters by default. eecchhoo does + not interpret ---- to mean the end of options. eecchhoo interprets + the following escape sequences: \\aa alert (bell) \\bb backspace \\cc suppress further output @@ -6248,32 +6248,33 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS xxppgg__eecchhoo If set, the eecchhoo builtin expands backslash-escape se- - quences by default. + quences by default. If the ppoossiixx shell option is also + enabled, eecchhoo does not interpret any options. ssuussppeenndd [--ff] - Suspend the execution of this shell until it receives a SSIIGGCCOONNTT - signal. A login shell, or a shell without job control enabled, - cannot be suspended; the --ff 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 --ff is + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. A login shell, or a shell without job control enabled, + cannot be suspended; the --ff 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 --ff is not supplied. tteesstt _e_x_p_r [[ _e_x_p_r ]] Return a status of 0 (true) or 1 (false) depending on the evalu- ation of the conditional expression _e_x_p_r. Each operator and op- - erand must be a separate argument. Expressions are composed of - the primaries described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. - tteesstt 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 CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. + tteesstt does not accept any options, nor does it accept and ignore an argument of ---- 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. !! _e_x_p_r True if _e_x_p_r is false. (( _e_x_p_r )) - Returns the value of _e_x_p_r. This may be used to override + Returns the value of _e_x_p_r. This may be used to override the normal precedence of operators. _e_x_p_r_1 -aa _e_x_p_r_2 True if both _e_x_p_r_1 and _e_x_p_r_2 are true. @@ -6290,161 +6291,161 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS null. 2 arguments If the first argument is !!, 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 CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, 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 CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, 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 CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the result of the expression is the result of the binary test - using the first and third arguments as operands. The --aa - and --oo operators are considered binary operators when - there are three arguments. If the first argument is !!, - the value is the negation of the two-argument test using + using the first and third arguments as operands. The --aa + and --oo operators are considered binary operators when + there are three arguments. If the first argument is !!, + the value is the negation of the two-argument test using the second and third arguments. If the first argument is exactly (( and the third argument is exactly )), 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 !!, 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 (( and - the fourth argument is exactly )), 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 (( and + the fourth argument is exactly )), 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 _p_o_s_i_x _m_o_d_e, when used with tteesstt or [[, the - << and >> operators sort lexicographically using ASCII ordering. - When the shell is in _p_o_s_i_x _m_o_d_e, these operators sort using the + << and >> operators sort lexicographically using ASCII ordering. + When the shell is in _p_o_s_i_x _m_o_d_e, these operators sort using the current locale. - ttiimmeess Print the accumulated user and system times for the shell and + ttiimmeess Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0. ttrraapp [--llpp] [[_a_c_t_i_o_n] _s_i_g_s_p_e_c ...] The _a_c_t_i_o_n is a command that is read and executed when the shell receives signal(s) _s_i_g_s_p_e_c. If _a_c_t_i_o_n is absent (and there is a - single _s_i_g_s_p_e_c) or --, each specified signal is reset to its - original disposition (the value it had upon entrance to the - shell). If _a_c_t_i_o_n is the null string the signal specified by - each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in- + single _s_i_g_s_p_e_c) or --, each specified signal is reset to its + original disposition (the value it had upon entrance to the + shell). If _a_c_t_i_o_n is the null string the signal specified by + each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in- vokes. - If no arguments are supplied, ttrraapp displays the actions associ- + If no arguments are supplied, ttrraapp displays the actions associ- ated with each trapped signal as a set of ttrraapp commands that can - be reused as shell input to restore the current signal disposi- - tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp - displays the actions associated with each _s_i_g_s_p_e_c or, if none + be reused as shell input to restore the current signal disposi- + tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp + displays the actions associated with each _s_i_g_s_p_e_c or, if none are supplied, for all trapped signals, as a set of ttrraapp commands - that can be reused as shell input to restore the current signal - dispositions. The --PP option behaves similarly, but displays - only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- - quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options to - ttrraapp may be used in a subshell environment (e.g., command sub- - stitution) and, as long as they are used before ttrraapp 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 --PP option behaves similarly, but displays + only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- + quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options to + ttrraapp may be used in a subshell environment (e.g., command sub- + stitution) and, as long as they are used before ttrraapp is used to + change a signal's handling, will display the state of its par- ent's traps. - The --ll option causes ttrraapp to print a list of signal names and - their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal - name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names + The --ll option causes ttrraapp to print a list of signal names and + their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal + name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are case insensitive and the SSIIGG prefix is optional. - If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit - from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is + If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit + from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is executed before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, - _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, + _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, arithmetic _f_o_r command, and before the first command executes in - a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the de- - scription of the eexxttddeebbuugg option to the sshhoopptt builtin for de- - tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, - the command _a_c_t_i_o_n is executed each time a shell function or a - script executed with the .. or ssoouurrccee builtins finishes execut- + a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the de- + scription of the eexxttddeebbuugg option to the sshhoopptt builtin for de- + tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, + the command _a_c_t_i_o_n is executed each time a shell function or a + script executed with the .. or ssoouurrccee builtins finishes execut- ing. - If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n is executed whenever a + If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n 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 EERRRR trap is not executed if the + the following conditions. The EERRRR trap is not executed if the failed command is part of the command list immediately following - a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, + a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, part of a command executed in a &&&& or |||| list except the command - following the final &&&& or ||||, any command in a pipeline but the - last, or if the command's return value is being inverted using + following the final &&&& or ||||, any command in a pipeline but the + last, or if the command's return value is being inverted using !!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) 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 _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true. ttrruuee Does nothing, returns a 0 status. ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] - With no options, indicate how each _n_a_m_e would be interpreted if + With no options, indicate how each _n_a_m_e would be interpreted if used as a command name. If the --tt option is used, ttyyppee prints a - string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or - _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, - builtin, or executable disk file, respectively. If the _n_a_m_e is - not found, then nothing is printed, and ttyyppee returns a non-zero - exit status. If the --pp option is used, ttyyppee either returns the - name of the executable file that would be found by searching - $$PPAATTHH if _n_a_m_e were specified as a command name, or nothing if - ``type -t name'' would not return _f_i_l_e. The --PP option forces a - PPAATTHH search for each _n_a_m_e, even if ``type -t name'' would not + string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or + _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, + builtin, or executable disk file, respectively. If the _n_a_m_e is + not found, then nothing is printed, and ttyyppee returns a non-zero + exit status. If the --pp option is used, ttyyppee either returns the + name of the executable file that would be found by searching + $$PPAATTHH if _n_a_m_e were specified as a command name, or nothing if + ``type -t name'' would not return _f_i_l_e. The --PP option forces a + PPAATTHH search for each _n_a_m_e, even if ``type -t name'' would not return _f_i_l_e. If a command is hashed, --pp and --PP print the hashed - value, which is not necessarily the file that appears first in - PPAATTHH. If the --aa option is used, ttyyppee prints all of the places - that contain a command named _n_a_m_e. 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 + PPAATTHH. If the --aa option is used, ttyyppee prints all of the places + that contain a command named _n_a_m_e. This includes aliases, re- + served words, functions, and builtins, but the path search op- tions (--pp and --PP) can be supplied to restrict the output to exe- - cutable files. ttyyppee does not consult the table of hashed com- + cutable files. ttyyppee does not consult the table of hashed com- mands when using --aa with --pp, and only performs a PPAATTHH search for - _n_a_m_e. The --ff option suppresses shell function lookup, as with - the ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments + _n_a_m_e. The --ff option suppresses shell function lookup, as with + the ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments are found, false if any are not found. uulliimmiitt [--HHSS] --aa uulliimmiitt [--HHSS] [--bbccddeeffiikkllmmnnppqqrrssttuuvvxxPPRRTT [_l_i_m_i_t]] - 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 --HH and --SS 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 --HH nor --SS 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 --HH nor --SS is speci- fied, both the soft and hard limits are set. The value of _l_i_m_i_t can be a number in the unit specified for the resource or one of the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the - current hard limit, the current soft limit, and no limit, re- - spectively. If _l_i_m_i_t is omitted, the current value of the soft + current hard limit, the current soft limit, and no limit, re- + spectively. If _l_i_m_i_t is omitted, the current value of the soft limit of the resource is printed, unless the --HH 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: --aa All current limits are reported; no limits are set --bb The maximum socket buffer size --cc The maximum size of core files created --dd The maximum size of a process's data segment --ee The maximum scheduling priority ("nice") - --ff The maximum size of files written by the shell and its + --ff The maximum size of files written by the shell and its children --ii The maximum number of pending signals --kk The maximum number of kqueues that may be allocated --ll The maximum size that may be locked into memory - --mm The maximum resident set size (many systems do not honor + --mm The maximum resident set size (many systems do not honor this limit) --nn The maximum number of open file descriptors (most systems do not allow this value to be set) @@ -6453,134 +6454,134 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS --rr The maximum real-time scheduling priority --ss The maximum stack size --tt The maximum amount of cpu time in seconds - --uu The maximum number of processes available to a single + --uu The maximum number of processes available to a single user - --vv The maximum amount of virtual memory available to the + --vv The maximum amount of virtual memory available to the shell and, on some systems, to its children --xx The maximum number of file locks --PP The maximum number of pseudoterminals - --RR The maximum time a real-time process can run before + --RR The maximum time a real-time process can run before blocking, in microseconds --TT The maximum number of threads - If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the - new value of the specified resource. If no option is given, - then --ff is assumed. Values are in 1024-byte increments, except - for --tt, which is in seconds; --RR, which is in microseconds; --pp, - which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and - --uu, which are unscaled values; and, when in posix mode, --cc and - --ff, which are in 512-byte increments. The return status is 0 - unless an invalid option or argument is supplied, or an error + If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the + new value of the specified resource. If no option is given, + then --ff is assumed. Values are in 1024-byte increments, except + for --tt, which is in seconds; --RR, which is in microseconds; --pp, + which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and + --uu, which are unscaled values; and, when in posix mode, --cc and + --ff, 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. uummaasskk [--pp] [--SS] [_m_o_d_e] The user file-creation mask is set to _m_o_d_e. If _m_o_d_e 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 - _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is - printed. The --SS option causes the mask to be printed in sym- - bolic form; the default output is an octal number. If the --pp + a digit, it is interpreted as an octal number; otherwise it is + interpreted as a symbolic mode mask similar to that accepted by + _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is + printed. The --SS option causes the mask to be printed in sym- + bolic form; the default output is an octal number. If the --pp option is supplied, and _m_o_d_e 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 _m_o_d_e argument was supplied, + was successfully changed or if no _m_o_d_e argument was supplied, and false otherwise. uunnaalliiaass [-aa] [_n_a_m_e ...] - Remove each _n_a_m_e from the list of defined aliases. If --aa is - supplied, all alias definitions are removed. The return value + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, all alias definitions are removed. The return value is true unless a supplied _n_a_m_e is not a defined alias. uunnsseett [-ffvv] [-nn] [_n_a_m_e ...] - For each _n_a_m_e, remove the corresponding variable or function. + For each _n_a_m_e, remove the corresponding variable or function. If the --vv option is given, each _n_a_m_e refers to a shell variable, - and that variable is removed. Read-only variables may not be - unset. If --ff is specified, each _n_a_m_e refers to a shell func- - tion, and the function definition is removed. If the --nn option - is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, - _n_a_m_e will be unset rather than the variable it references. --nn - has no effect if the --ff option is supplied. If no options are - supplied, each _n_a_m_e 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 BBAASSHH__AALLIIAASSEESS, + and that variable is removed. Read-only variables may not be + unset. If --ff is specified, each _n_a_m_e refers to a shell func- + tion, and the function definition is removed. If the --nn option + is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, + _n_a_m_e will be unset rather than the variable it references. --nn + has no effect if the --ff option is supplied. If no options are + supplied, each _n_a_m_e 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 BBAASSHH__AALLIIAASSEESS, BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBBSSHHEELLLL, BBAASSHHPPIIDD, - CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- - NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are + CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- + NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are unset, they lose their special properties, even if they are sub- sequently reset. The exit status is true unless a _n_a_m_e is read- only or may not be unset. wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d _._._.] Wait for each specified child process and return its termination - status. Each _i_d 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 _i_d is not given, wwaaiitt waits for all running - background jobs and the last-executed process substitution, if + status. Each _i_d 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 _i_d is not given, wwaaiitt waits for all running + background jobs and the last-executed process substitution, if its process id is the same as $$!!, and the return status is zero. - If the --nn option is supplied, wwaaiitt waits for a single job from + If the --nn option is supplied, wwaaiitt waits for a single job from the list of _i_ds or, if no _i_ds 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 --pp option is supplied, the process or job identifier of the - job for which the exit status is returned is assigned to the - variable _v_a_r_n_a_m_e named by the option argument. The variable - will be unset initially, before any assignment. This is useful - only when the --nn option is supplied. Supplying the --ff option, - when job control is enabled, forces wwaaiitt to wait for _i_d to ter- + shell has no unwaited-for children, the exit status is 127. If + the --pp option is supplied, the process or job identifier of the + job for which the exit status is returned is assigned to the + variable _v_a_r_n_a_m_e named by the option argument. The variable + will be unset initially, before any assignment. This is useful + only when the --nn option is supplied. Supplying the --ff option, + when job control is enabled, forces wwaaiitt to wait for _i_d to ter- minate before returning its status, instead of returning when it - changes status. If _i_d specifies a non-existent process or job, - the return status is 127. If wwaaiitt is interrupted by a signal, - the return status will be greater than 128, as described under - SSIIGGNNAALLSS above. Otherwise, the return status is the exit status + changes status. If _i_d specifies a non-existent process or job, + the return status is 127. If wwaaiitt is interrupted by a signal, + the return status will be greater than 128, as described under + SSIIGGNNAALLSS above. Otherwise, the return status is the exit status of the last process or job waited for. SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE - Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- - fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322, - ccoommppaatt4400, ccoommppaatt4411, 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 _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- + fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322, + ccoommppaatt4400, ccoommppaatt4411, 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 ccoommppaatt3322 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 ccoommppaatt3322 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, ccoommppaatt3322, 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 bbaasshh, but that behavior may have been - present in earlier versions. For instance, the change to use locale- - based comparisons with the [[[[ command came in bash-4.1, and earlier + If a user enables, say, ccoommppaatt3322, 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 bbaasshh, but that behavior may have been + present in earlier versions. For instance, the change to use locale- + based comparisons with the [[[[ command came in bash-4.1, and earlier versions used ASCII-based comparisons, so enabling ccoommppaatt3322 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: BBAASSHH__CCOOMMPPAATT. The value as- + Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as- signed to this variable (a decimal version number like 4.2, or an inte- - ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com- + ger corresponding to the ccoommppaatt_N_N 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 BBAASSHH__CCOOMM-- + Starting with bash-4.4, Bash has begun deprecating older compatibility + levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM-- PPAATT. - Bash-5.0 is the final version for which there will be an individual - shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on + Bash-5.0 is the final version for which there will be an individual + shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT 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 ccoommppaatt_N_N tag is used as shorthand for setting the compatibility level to _N_N using one of the following mecha- - nisms. For versions prior to bash-5.0, the compatibility level may be - set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and - later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- + nisms. For versions prior to bash-5.0, the compatibility level may be + set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and + later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- quired for bash-5.1 and later versions. ccoommppaatt3311 @@ -6588,114 +6589,114 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE ator (=~) has no special effect ccoommppaatt3322 - +o 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 + +o 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) ccoommppaatt4400 - +o the << and >> operators to the [[[[ command do not consider + +o the << and >> operators to the [[[[ 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 _s_t_r_c_m_p(3); bash-4.1 and later use the current + lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current locale's collation sequence and _s_t_r_c_o_l_l(3). ccoommppaatt4411 - +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still + +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still be recognized as a reserved word (this is POSIX interpre- tation 267) +o in _p_o_s_i_x mode, the parser requires that an even number of - single quotes occur in the _w_o_r_d 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 _w_o_r_d 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) ccoommppaatt4422 +o 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 - +o in posix mode, single quotes are considered special when - expanding the _w_o_r_d 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 + +o in posix mode, single quotes are considered special when + expanding the _w_o_r_d 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 ccoommppaatt4433 - +o 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 + +o 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 - +o 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 + +o 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) - +o when executing a shell function, the loop state + +o when executing a shell function, the loop state (while/until/etc.) is not reset, so bbrreeaakk or ccoonnttiinnuuee 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 ccoommppaatt4444 - +o the shell sets up the values used by BBAASSHH__AARRGGVV and - BBAASSHH__AARRGGCC so they can expand to the shell's positional + +o the shell sets up the values used by BBAASSHH__AARRGGVV and + BBAASSHH__AARRGGCC so they can expand to the shell's positional parameters even if extended debugging mode is not enabled - +o a subshell inherits loops from its parent context, so - bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. - Bash-5.0 and later reset the loop state to prevent the + +o a subshell inherits loops from its parent context, so + bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. + Bash-5.0 and later reset the loop state to prevent the exit - +o variable assignments preceding builtins like eexxppoorrtt and + +o variable assignments preceding builtins like eexxppoorrtt and rreeaaddoonnllyy that set attributes continue to affect variables with the same name in the calling environment even if the shell is not in posix mode ccoommppaatt5500 - +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- + +o Bash-5.1 changed the way $$RRAANNDDOOMM 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 RRAANNDDOOMM 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 RRAANNDDOOMM will produce the same sequence as in bash-5.0 - +o 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 --ll op- + +o 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 --ll op- tion is supplied. ccoommppaatt5511 - +o The uunnsseett builtin treats attempts to unset array sub- - scripts @@ and ** differently depending on whether the ar- - ray is indexed or associative, and differently than in + +o The uunnsseett builtin treats attempts to unset array sub- + scripts @@ and ** differently depending on whether the ar- + ray is indexed or associative, and differently than in previous versions. RREESSTTRRIICCTTEEDD SSHHEELLLL If bbaasshh is started with the name rrbbaasshh, or the --rr 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 bbaasshh 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 bbaasshh with the exception that the following are disallowed or not performed: +o changing directories with ccdd - +o setting or unsetting the values of SSHHEELLLL, PPAATTHH, HHIISSTTFFIILLEE, EENNVV, + +o setting or unsetting the values of SSHHEELLLL, PPAATTHH, HHIISSTTFFIILLEE, EENNVV, or BBAASSHH__EENNVV +o specifying command names containing // - +o specifying a filename containing a // as an argument to the .. + +o specifying a filename containing a // as an argument to the .. builtin command - +o specifying a filename containing a slash as an argument to the + +o specifying a filename containing a slash as an argument to the hhiissttoorryy builtin command - +o specifying a filename containing a slash as an argument to the + +o specifying a filename containing a slash as an argument to the --pp option to the hhaasshh builtin command - +o importing function definitions from the shell environment at + +o importing function definitions from the shell environment at startup - +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at + +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at startup +o redirecting output using the >, >|, <>, >&, &>, and >> redirect- @@ -6704,28 +6705,28 @@ RREESSTTRRIICCTTEEDD SSHHEELLLL +o using the eexxeecc builtin command to replace the shell with another command - +o adding or deleting builtin commands with the --ff and --dd options + +o adding or deleting builtin commands with the --ff and --dd options to the eennaabbllee builtin command - +o using the eennaabbllee builtin command to enable disabled shell + +o using the eennaabbllee builtin command to enable disabled shell builtins +o specifying the --pp option to the ccoommmmaanndd builtin command - +o turning off restricted mode with sseett ++rr or sshhoopptt --uu rree-- + +o turning off restricted mode with sseett ++rr or sshhoopptt --uu rree-- ssttrriicctteedd__sshheellll. These restrictions are enforced after any startup files are read. When a command that is found to be a shell script is executed (see CCOOMM-- - MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell + MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell spawned to execute the script. SSEEEE AALLSSOO _B_a_s_h _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, Brian Fox and Chet Ramey _T_h_e _G_n_u _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y, Brian Fox and Chet Ramey _T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey - _P_o_r_t_a_b_l_e _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m _I_n_t_e_r_f_a_c_e _(_P_O_S_I_X_) _P_a_r_t _2_: _S_h_e_l_l _a_n_d _U_t_i_l_i_- + _P_o_r_t_a_b_l_e _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m _I_n_t_e_r_f_a_c_e _(_P_O_S_I_X_) _P_a_r_t _2_: _S_h_e_l_l _a_n_d _U_t_i_l_i_- _t_i_e_s, IEEE -- http://pubs.opengroup.org/onlinepubs/9699919799/ http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode @@ -6743,10 +6744,10 @@ FFIILLEESS _~_/_._b_a_s_h_r_c The individual per-interactive-shell startup file _~_/_._b_a_s_h___l_o_g_o_u_t - The individual login shell cleanup file, executed when a login + The individual login shell cleanup file, executed when a login shell exits _~_/_._b_a_s_h___h_i_s_t_o_r_y - The default value of HHIISSTTFFIILLEE, the file in which bash saves the + The default value of HHIISSTTFFIILLEE, the file in which bash saves the command history _~_/_._i_n_p_u_t_r_c Individual _r_e_a_d_l_i_n_e initialization file @@ -6760,15 +6761,15 @@ AAUUTTHHOORRSS BBUUGG RREEPPOORRTTSS If you find a bug in bbaasshh,, 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 bbaasshh. The latest version is always available from + make sure that it really is a bug, and that it appears in the latest + version of bbaasshh. The latest version is always available from _f_t_p_:_/_/_f_t_p_._g_n_u_._o_r_g_/_p_u_b_/_g_n_u_/_b_a_s_h_/ and _h_t_t_p_:_/_/_g_i_t_._s_a_v_a_n_- _n_a_h_._g_n_u_._o_r_g_/_c_g_i_t_/_b_a_s_h_._g_i_t_/_s_n_a_p_s_h_o_t_/_b_a_s_h_-_m_a_s_t_e_r_._t_a_r_._g_z. - Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g - 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 _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or posted to the Usenet newsgroup + Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g + 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 _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or posted to the Usenet newsgroup ggnnuu..bbaasshh..bbuugg. ALL bug reports should include: @@ -6779,7 +6780,7 @@ BBUUGG RREEPPOORRTTSS A description of the bug behaviour A short script or `recipe' which exercises the bug - _b_a_s_h_b_u_g inserts the first three items automatically into the template + _b_a_s_h_b_u_g 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 @@ -6796,10 +6797,10 @@ BBUUGGSS 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. @@ -6808,4 +6809,4 @@ BBUUGGSS -GNU Bash 5.3 2023 July 19 BASH(1) +GNU Bash 5.3 2023 July 26 BASH(1) diff --git a/doc/bash.1 b/doc/bash.1 index c442d8c0..549867ad 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -5,12 +5,14 @@ .\" 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. @@ -188,7 +190,7 @@ Display a usage message on standard output and exit successfully. 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 @@ -206,10 +208,10 @@ library to read command lines when the shell is interactive. 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 @@ -219,7 +221,7 @@ below). .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 . @@ -318,8 +320,8 @@ is invoked as an interactive login shell, or as a non-interactive shell 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 @@ -328,18 +330,18 @@ option may be used when the shell is started to inhibit this behavior. 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 @@ -375,7 +377,7 @@ shell with the \fB\-\-login\fP option, it first attempts to read and execute commands from .I /etc/profile and -.IR ~/.profile , +.IR \(ti/.profile , in that order. The .B \-\-noprofile @@ -426,7 +428,7 @@ or the secure shell daemon \fIsshd\fP. 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 @@ -745,7 +747,7 @@ Any part of the pattern may be quoted to force the quoted portion 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 @@ -770,7 +772,7 @@ between brackets. .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 @@ -1662,7 +1664,7 @@ dynamically loadable builtins specified by the 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. @@ -2151,7 +2153,7 @@ The current version is also a valid value. 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 @@ -2192,8 +2194,8 @@ for destination directories specified by the .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. @@ -2263,8 +2265,8 @@ A filename whose suffix matches one of the entries in .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 @@ -2344,7 +2346,7 @@ not tested, and are added to the history regardless of the value of 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 @@ -2457,7 +2459,7 @@ signifies the end of input to the shell. The filename for the .B readline startup file, overriding the default of -.FN ~/.inputrc +.FN \(ti/.inputrc (see .SM .B READLINE @@ -2537,7 +2539,7 @@ the current mailfile. 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 @@ -2765,7 +2767,7 @@ expansion, normally `\fB!\fP'. 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 @@ -3086,7 +3088,7 @@ command (see .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 @@ -3104,11 +3106,11 @@ substituted instead. 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. @@ -3497,10 +3499,10 @@ or 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 @@ -3513,11 +3515,11 @@ pathname expansion. 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. @@ -4003,7 +4005,7 @@ is matched. If the first character following the 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, @@ -4772,7 +4774,7 @@ unary minus and plus .B ++\fIid\fP \-\-\fIid\fP variable pre-increment and pre-decrement .TP -.B ! ~ +.B ! \(ti logical and bitwise negation .TP .B ** @@ -4796,7 +4798,7 @@ equality and inequality .B & bitwise AND .TP -.B ^ +.B \(ha bitwise exclusive OR .TP .B | @@ -4811,7 +4813,7 @@ logical OR .B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP conditional operator .TP -.B = *= /= %= += \-= <<= >>= &= ^= |= +.B = *= /= %= += \-= <<= >>= &= \(ha= |= assignment .TP .B \fIexpr1\fP , \fIexpr2\fP @@ -5412,10 +5414,10 @@ command to complete, the shell receives keyboard-generated signals 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. @@ -5527,14 +5529,14 @@ contains facilities to use it. 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 @@ -5546,7 +5548,7 @@ command to continue it in the background, the 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 @@ -5860,7 +5862,7 @@ The name of this file is taken from the value of the .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 @@ -5959,7 +5961,7 @@ are not recognized. .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, @@ -5970,7 +5972,7 @@ is again bound to the function 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''. @@ -6963,7 +6965,7 @@ Attempt to perform completion on the text before point. .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 @@ -7008,11 +7010,11 @@ Attempt filename completion on the text before point. 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 @@ -7422,7 +7424,7 @@ On startup, the history is initialized from the file named by 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 @@ -7650,13 +7652,13 @@ is followed immediately by a newline. 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 !# @@ -7668,7 +7670,7 @@ A .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 \- , @@ -7687,7 +7689,7 @@ word. .I n The \fIn\fRth word. .TP -.B ^ +.B \(ha The first argument. That is, word 1. .TP .B $ @@ -8724,8 +8726,9 @@ the following backslash-escaped characters is enabled. The 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 @@ -10912,6 +10915,8 @@ instead of leaving them open when the command completes. .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 @@ -11627,7 +11632,7 @@ and it is required for bash-5.1 and later versions. .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 @@ -11877,7 +11882,7 @@ script. \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 @@ -11894,20 +11899,20 @@ The \fBbash\fP executable .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 diff --git a/doc/bash.html b/doc/bash.html index 5f46e520..3d888a6f 100644 --- a/doc/bash.html +++ b/doc/bash.html @@ -3,7 +3,7 @@ -
BASH(1)2023 July 19BASH(1) +BASH(1)2023 July 26BASH(1)

Index @@ -237,7 +237,7 @@ Execute commands from file instead of the standard personal initialization file -~/.bashrc +ti/.bashrc if the shell is interactive (see INVOCATION @@ -263,12 +263,12 @@ Do not read either the system-wide startup file /etc/profile or any of the personal initialization files -~/.bash_profile, +ti/.bash_profile, -~/.bash_login, +ti/.bash_login, or -~/.profile. +ti/.profile. By default, bash @@ -282,7 +282,7 @@ below).
Do not read and execute the personal initialization file -~/.bashrc +ti/.bashrc if the shell is interactive. This option is on by default if the shell is invoked as @@ -418,8 +418,8 @@ is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. -After reading that file, it looks for ~/.bash_profile, -~/.bash_login, and ~/.profile, in that order, and reads +After reading that file, it looks for ti/.bash_profile, +ti/.bash_login, and ti/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile @@ -431,14 +431,14 @@ When an interactive login shell exits, or a non-interactive login shell executes the exit builtin command, bash -reads and executes commands from the file ~/.bash_logout, if it +reads and executes commands from the file ti/.bash_logout, if it exists.

When an interactive shell that is not a login shell is started, bash -reads and executes commands from ~/.bashrc, if that file exists. +reads and executes commands from ti/.bashrc, if that file exists. This may be inhibited by using the --norc @@ -446,7 +446,7 @@ option. The --rcfile file option will force bash -to read and execute commands from file instead of ~/.bashrc. +to read and execute commands from file instead of ti/.bashrc.

When @@ -493,7 +493,7 @@ read and execute commands from /etc/profile and -~/.profile, +ti/.profile, in that order. The @@ -563,7 +563,7 @@ If bash determines it is being run non-interactively in this fashion, -it reads and executes commands from ~/.bashrc, +it reads and executes commands from ti/.bashrc, if that file exists and is readable. It will not do this if invoked as sh. The @@ -976,7 +976,7 @@ to be matched as a string.

-An additional binary operator, =~, is available, with the same +An additional binary operator, =ti, is available, with the same precedence as == and !=. When it is used, the string to the right of the operator is considered a POSIX extended regular expression and matched accordingly @@ -1003,7 +1003,7 @@ between brackets. The pattern will match if it matches any part of the string. -Anchor the pattern using the ^ and $ regular expression +Anchor the pattern using the ha and $ regular expression operators to force it to match the entire string. The array variable BASH_REMATCH @@ -2120,7 +2120,7 @@ command.

BASH_REMATCH
-An array variable whose members are assigned by the =~ binary +An array variable whose members are assigned by the =ti binary operator to the [[ conditional command. The element with index 0 is the portion of the string matching the entire regular expression. @@ -2727,7 +2727,7 @@ The current version is also a valid value. If this parameter is set when bash is executing a shell script, its value is interpreted as a filename containing commands to initialize the shell, as in -~/.bashrc. +ti/.bashrc. The value of BASH_ENV @@ -2778,7 +2778,7 @@ for destination directories specified by the command. A sample value is -".:~:/usr". +".:ti:/usr".
CHILD_MAX @@ -2863,7 +2863,7 @@ A filename whose suffix matches one of the entries in is excluded from the list of matched filenames. A sample value is -".o:~". +".o:ti".
FUNCNEST @@ -2965,7 +2965,7 @@ The name of the file in which command history is saved (see HISTORY -below). The default value is ~/.bash_history. If unset, the +below). The default value is ti/.bash_history. If unset, the command history is not saved when a shell exits.
HISTFILESIZE @@ -3105,7 +3105,7 @@ The filename for the startup file, overriding the default of -~/.inputrc +ti/.inputrc (see READLINE @@ -3206,7 +3206,7 @@ Example:

-MAILPATH=aq/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"aq +MAILPATH=aq/var/mail/bfox?"You have mail":ti/shell-mail?"$_ has mail!"aq

Bash @@ -3489,7 +3489,7 @@ expansion, normally `!'. The second character is the quick substitution character, which is used as shorthand for re-running the previous command entered, substituting one string for another in the command. -The default is `^'. +The default is `ha'. 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 `#'. The history @@ -3898,7 +3898,7 @@ below).  

Tilde Expansion

-If a word begins with an unquoted tilde character (`~'), all of +If a word begins with an unquoted tilde character (`ti'), all of the characters preceding the first unquoted slash (or all characters, if there is no unquoted slash) are considered a tilde-prefix. If none of the characters in the tilde-prefix are quoted, the @@ -3919,12 +3919,12 @@ Otherwise, the tilde-prefix is replaced with the home directory associated with the specified login name.

-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 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 OLDPWD, @@ -4364,9 +4364,9 @@ or the substitution operation is applied to each member of the array in turn, and the expansion is the resultant list. -

${parameter^pattern}
+
${parameterhapattern}
-
${parameter^^pattern}
+
${parameterhahapattern}
${parameter,pattern}
${parameter,,pattern}
@@ -4377,11 +4377,11 @@ pathname expansion. Each character in the expanded value of parameter is tested against pattern, and, if it matches the pattern, its case is converted. The pattern should not attempt to match more than one character. -The ^ operator converts lowercase letters matching pattern +The ha operator converts lowercase letters matching pattern to uppercase; the , operator converts matching uppercase letters to lowercase. -The ^^ and ,, expansions convert each matched character in the -expanded value; the ^ and , expansions match and convert only +The haha and ,, expansions convert each matched character in the +expanded value; the ha and , expansions match and convert only the first character in the expanded value. If pattern is omitted, it is treated like a ?, which matches every character. @@ -5015,7 +5015,7 @@ is a ! or a -^ +ha then any character not enclosed is matched. The sorting order of characters in range expressions, @@ -6033,7 +6033,7 @@ unary minus and plus
variable pre-increment and pre-decrement -
! ~ +
! ti
logical and bitwise negation @@ -6065,7 +6065,7 @@ equality and inequality
bitwise AND -
^ +
ha
bitwise exclusive OR @@ -6085,7 +6085,7 @@ logical OR
conditional operator -
= *= /= %= += -= <<= >>= &= ^= |= +
= *= /= %= += -= <<= >>= &= ha= |=
assignment @@ -6834,10 +6834,10 @@ such as SIGINT -(usually generated by ^C) that users commonly intend to send +(usually generated by haC) 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 ^C sends +same process group as the terminal, and haC sends SIGINT @@ -6986,7 +6986,7 @@ Typing the suspend character (typically -^Z, +haZ, Control-Z) while a process is running causes that process to be stopped and returns control to @@ -6996,7 +6996,7 @@ Typing the delayed suspend character (typically -^Y, +haY, Control-Y) causes the process to be stopped when it attempts to read input from the terminal, and control to @@ -7013,7 +7013,7 @@ command to continue it in the foreground, or the kill -command to kill it. A ^Z takes effect immediately, +command to kill it. A haZ takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded.

@@ -7430,7 +7430,7 @@ The name of this file is taken from the value of the variable. If that variable is unset, the default is -~/.inputrc. +ti/.inputrc. If that file does not exist or cannot be read, the ultimate default is /etc/inputrc. @@ -7570,7 +7570,7 @@ are not recognized. "\C-x\C-r": re-read-init-file
-"\e[11~": "Function Key 1" +"\e[11ti": "Function Key 1"

@@ -7587,7 +7587,7 @@ is bound to the function re-read-init-file, and -ESC [ 1 1 ~ +ESC [ 1 1 ti is bound to insert the text Function Key 1. @@ -8818,7 +8818,7 @@ Attempt to perform completion on the text before point. attempts completion treating the text as a variable (if the text begins with $), username (if the text begins with -~), hostname (if the text begins with @), or +ti), hostname (if the text begins with @), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted.

possible-completions (M-?) @@ -8869,12 +8869,12 @@ Attempt filename completion on the text before point.
List the possible completions of the text before point, treating it as a filename. -
complete-username (M-~) +
complete-username (M-ti)
Attempt completion on the text before point, treating it as a username. -
possible-username-completions (C-x ~) +
possible-username-completions (C-x ti)
List the possible completions of the text before point, @@ -9389,7 +9389,7 @@ the variable HISTFILE -(default ~/.bash_history). +(default ti/.bash_history). The file named by the value of HISTFILE @@ -9680,7 +9680,7 @@ The trailing ? may be omitted if is followed immediately by a newline. If string is missing, the string from the most recent search is used; it is an error if there is no previous search string. -
^string1^string2^ +
hastring1hastring2ha
Quick substitution. Repeat the previous command, replacing @@ -9690,7 +9690,7 @@ with string2. Equivalent to -``!!:s^string1^string2^'' +``!!:shastring1hastring2ha'' (see Modifiers below).
!# @@ -9707,7 +9707,7 @@ A separates the event specification from the word designator. It may be omitted if the word designator begins with a -^, +ha, $, @@ -9734,7 +9734,7 @@ word.
The nth word. -
^ +
ha
The first argument. That is, word 1. @@ -10994,8 +10994,9 @@ the following backslash-escaped characters is enabled. The 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. +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. @@ -13718,6 +13719,8 @@ instead of leaving them open when the command completes.
If set, the echo builtin expands backslash-escape sequences by default. +If the posix shell option is also enabled, echo does not +interpret any options. @@ -14610,7 +14613,7 @@ and it is required for bash-5.1 and later versions.
*
-quoting the rhs of the [[ command's regexp matching operator (=~) +quoting the rhs of the [[ command's regexp matching operator (=ti) has no special effect
@@ -14906,7 +14909,7 @@ script.
The Gnu History Library, Brian Fox and Chet Ramey
Portable Operating System Interface (POSIX) Part 2: Shell and Utilities, IEEE --
http://pubs.opengroup.org/onlinepubs/9699919799/ -
http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode
+
http://tiswww.case.edu/tichet/bash/POSIX -- a description of posix mode
sh(1), ksh(1), csh(1)
emacs(1), vi(1)
readline(3)
@@ -14928,28 +14931,28 @@ The bash executable
The systemwide initialization file, executed for login shells
-~/.bash_profile +ti/.bash_profile
The personal initialization file, executed for login shells
-~/.bashrc +ti/.bashrc
The individual per-interactive-shell startup file
-~/.bash_logout +ti/.bash_logout
The individual login shell cleanup file, executed when a login shell exits
-~/.bash_history +ti/.bash_history
The default value of HISTFILE, the file in which bash saves the command history
-~/.inputrc +ti/.inputrc
Individual readline initialization file @@ -15064,7 +15067,7 @@ There may be only one active coprocess at a time.
-
GNU Bash 5.32023 July 19BASH(1) +GNU Bash 5.32023 July 26BASH(1)

@@ -15170,7 +15173,7 @@ There may be only one active coprocess at a time.
BUGS

-This document was created by man2html from /usr/local/src/bash/bash-20230719/doc/bash.1.
-Time: 23 July 2023 18:17:35 EDT +This document was created by man2html from /usr/local/src/bash/bash-20230724/doc/bash.1.
+Time: 27 July 2023 13:45:03 EDT diff --git a/doc/bash.info b/doc/bash.info index f761e977..9b2bc2d2 100644 --- a/doc/bash.info +++ b/doc/bash.info @@ -1,9 +1,9 @@ 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. @@ -26,10 +26,10 @@ Bash Features ************* 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 . - 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 @@ -1842,6 +1842,14 @@ omitted, the operator tests only for existence. $ 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 @@ -4008,9 +4016,9 @@ standard. 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' @@ -5189,7 +5197,9 @@ This builtin allows you to change additional shell optional behavior. '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.  File: bash.info, Node: Special Builtins, Prev: Modifying Shell Behavior, Up: Shell Builtin Commands @@ -12860,103 +12870,103 @@ Node: Shell Expansions70406 Node: Brace Expansion72491 Node: Tilde Expansion75222 Node: Shell Parameter Expansion77840 -Node: Command Substitution96239 -Node: Arithmetic Expansion99700 -Node: Process Substitution100665 -Node: Word Splitting101782 -Node: Filename Expansion103827 -Node: Pattern Matching106757 -Node: Quote Removal111756 -Node: Redirections112048 -Node: Executing Commands121738 -Node: Simple Command Expansion122405 -Node: Command Search and Execution124512 -Node: Command Execution Environment126896 -Node: Environment129928 -Node: Exit Status131588 -Node: Signals133369 -Node: Shell Scripts136815 -Node: Shell Builtin Commands139839 -Node: Bourne Shell Builtins141874 -Node: Bash Builtins165007 -Node: Modifying Shell Behavior197003 -Node: The Set Builtin197345 -Node: The Shopt Builtin208286 -Node: Special Builtins224290 -Node: Shell Variables225266 -Node: Bourne Shell Variables225700 -Node: Bash Variables227801 -Node: Bash Features262755 -Node: Invoking Bash263765 -Node: Bash Startup Files269775 -Node: Interactive Shells274903 -Node: What is an Interactive Shell?275311 -Node: Is this Shell Interactive?275957 -Node: Interactive Shell Behavior276769 -Node: Bash Conditional Expressions280395 -Node: Shell Arithmetic285034 -Node: Aliases287992 -Node: Arrays290883 -Node: The Directory Stack297443 -Node: Directory Stack Builtins298224 -Node: Controlling the Prompt302481 -Node: The Restricted Shell305443 -Node: Bash POSIX Mode308050 -Node: Shell Compatibility Mode324190 -Node: Job Control332431 -Node: Job Control Basics332888 -Node: Job Control Builtins337887 -Node: Job Control Variables343679 -Node: Command Line Editing344832 -Node: Introduction and Notation346500 -Node: Readline Interaction348120 -Node: Readline Bare Essentials349308 -Node: Readline Movement Commands351094 -Node: Readline Killing Commands352051 -Node: Readline Arguments353969 -Node: Searching355010 -Node: Readline Init File357193 -Node: Readline Init File Syntax358451 -Node: Conditional Init Constructs382473 -Node: Sample Init File386666 -Node: Bindable Readline Commands389787 -Node: Commands For Moving390988 -Node: Commands For History393036 -Node: Commands For Text398027 -Node: Commands For Killing402002 -Node: Numeric Arguments404703 -Node: Commands For Completion405839 -Node: Keyboard Macros410027 -Node: Miscellaneous Commands410712 -Node: Readline vi Mode416747 -Node: Programmable Completion417651 -Node: Programmable Completion Builtins425428 -Node: A Programmable Completion Example436545 -Node: Using History Interactively441790 -Node: Bash History Facilities442471 -Node: Bash History Builtins445473 -Node: History Interaction450494 -Node: Event Designators454111 -Node: Word Designators455462 -Node: Modifiers457219 -Node: Installing Bash459024 -Node: Basic Installation460158 -Node: Compilers and Options463877 -Node: Compiling For Multiple Architectures464615 -Node: Installation Names466304 -Node: Specifying the System Type468410 -Node: Sharing Defaults469124 -Node: Operation Controls469794 -Node: Optional Features470749 -Node: Reporting Bugs481965 -Node: Major Differences From The Bourne Shell483296 -Node: GNU Free Documentation License500142 -Node: Indexes525316 -Node: Builtin Index525767 -Node: Reserved Word Index532865 -Node: Variable Index535310 -Node: Function Index552441 -Node: Concept Index566159 +Node: Command Substitution96430 +Node: Arithmetic Expansion99891 +Node: Process Substitution100856 +Node: Word Splitting101973 +Node: Filename Expansion104018 +Node: Pattern Matching106948 +Node: Quote Removal111947 +Node: Redirections112239 +Node: Executing Commands121929 +Node: Simple Command Expansion122596 +Node: Command Search and Execution124703 +Node: Command Execution Environment127087 +Node: Environment130119 +Node: Exit Status131779 +Node: Signals133560 +Node: Shell Scripts137006 +Node: Shell Builtin Commands140030 +Node: Bourne Shell Builtins142065 +Node: Bash Builtins165198 +Node: Modifying Shell Behavior197221 +Node: The Set Builtin197563 +Node: The Shopt Builtin208504 +Node: Special Builtins224639 +Node: Shell Variables225615 +Node: Bourne Shell Variables226049 +Node: Bash Variables228150 +Node: Bash Features263104 +Node: Invoking Bash264114 +Node: Bash Startup Files270124 +Node: Interactive Shells275252 +Node: What is an Interactive Shell?275660 +Node: Is this Shell Interactive?276306 +Node: Interactive Shell Behavior277118 +Node: Bash Conditional Expressions280744 +Node: Shell Arithmetic285383 +Node: Aliases288341 +Node: Arrays291232 +Node: The Directory Stack297792 +Node: Directory Stack Builtins298573 +Node: Controlling the Prompt302830 +Node: The Restricted Shell305792 +Node: Bash POSIX Mode308399 +Node: Shell Compatibility Mode324539 +Node: Job Control332780 +Node: Job Control Basics333237 +Node: Job Control Builtins338236 +Node: Job Control Variables344028 +Node: Command Line Editing345181 +Node: Introduction and Notation346849 +Node: Readline Interaction348469 +Node: Readline Bare Essentials349657 +Node: Readline Movement Commands351443 +Node: Readline Killing Commands352400 +Node: Readline Arguments354318 +Node: Searching355359 +Node: Readline Init File357542 +Node: Readline Init File Syntax358800 +Node: Conditional Init Constructs382822 +Node: Sample Init File387015 +Node: Bindable Readline Commands390136 +Node: Commands For Moving391337 +Node: Commands For History393385 +Node: Commands For Text398376 +Node: Commands For Killing402351 +Node: Numeric Arguments405052 +Node: Commands For Completion406188 +Node: Keyboard Macros410376 +Node: Miscellaneous Commands411061 +Node: Readline vi Mode417096 +Node: Programmable Completion418000 +Node: Programmable Completion Builtins425777 +Node: A Programmable Completion Example436894 +Node: Using History Interactively442139 +Node: Bash History Facilities442820 +Node: Bash History Builtins445822 +Node: History Interaction450843 +Node: Event Designators454460 +Node: Word Designators455811 +Node: Modifiers457568 +Node: Installing Bash459373 +Node: Basic Installation460507 +Node: Compilers and Options464226 +Node: Compiling For Multiple Architectures464964 +Node: Installation Names466653 +Node: Specifying the System Type468759 +Node: Sharing Defaults469473 +Node: Operation Controls470143 +Node: Optional Features471098 +Node: Reporting Bugs482314 +Node: Major Differences From The Bourne Shell483645 +Node: GNU Free Documentation License500491 +Node: Indexes525665 +Node: Builtin Index526116 +Node: Reserved Word Index533214 +Node: Variable Index535659 +Node: Function Index552790 +Node: Concept Index566508  End Tag Table diff --git a/doc/bash.pdf b/doc/bash.pdf index e06e14d9..59b2ab8f 100644 Binary files a/doc/bash.pdf and b/doc/bash.pdf differ diff --git a/doc/bashref.info b/doc/bashref.info index c8af47fa..883dd7ba 100644 --- a/doc/bashref.info +++ b/doc/bashref.info @@ -2,9 +2,9 @@ This is bashref.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. @@ -27,10 +27,10 @@ Bash Features ************* 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 . - 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 @@ -1843,6 +1843,14 @@ omitted, the operator tests only for existence. $ 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 @@ -4009,9 +4017,9 @@ standard. 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' @@ -5190,7 +5198,9 @@ This builtin allows you to change additional shell optional behavior. '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.  File: bashref.info, Node: Special Builtins, Prev: Modifying Shell Behavior, Up: Shell Builtin Commands @@ -12861,103 +12871,103 @@ Node: Shell Expansions70502 Node: Brace Expansion72590 Node: Tilde Expansion75324 Node: Shell Parameter Expansion77945 -Node: Command Substitution96347 -Node: Arithmetic Expansion99811 -Node: Process Substitution100779 -Node: Word Splitting101899 -Node: Filename Expansion103947 -Node: Pattern Matching106880 -Node: Quote Removal111882 -Node: Redirections112177 -Node: Executing Commands121870 -Node: Simple Command Expansion122540 -Node: Command Search and Execution124650 -Node: Command Execution Environment127037 -Node: Environment130072 -Node: Exit Status131735 -Node: Signals133519 -Node: Shell Scripts136968 -Node: Shell Builtin Commands139995 -Node: Bourne Shell Builtins142033 -Node: Bash Builtins165169 -Node: Modifying Shell Behavior197168 -Node: The Set Builtin197513 -Node: The Shopt Builtin208457 -Node: Special Builtins224464 -Node: Shell Variables225443 -Node: Bourne Shell Variables225880 -Node: Bash Variables227984 -Node: Bash Features262941 -Node: Invoking Bash263954 -Node: Bash Startup Files269967 -Node: Interactive Shells275098 -Node: What is an Interactive Shell?275509 -Node: Is this Shell Interactive?276158 -Node: Interactive Shell Behavior276973 -Node: Bash Conditional Expressions280602 -Node: Shell Arithmetic285244 -Node: Aliases288205 -Node: Arrays291099 -Node: The Directory Stack297662 -Node: Directory Stack Builtins298446 -Node: Controlling the Prompt302706 -Node: The Restricted Shell305671 -Node: Bash POSIX Mode308281 -Node: Shell Compatibility Mode324424 -Node: Job Control332668 -Node: Job Control Basics333128 -Node: Job Control Builtins338130 -Node: Job Control Variables343925 -Node: Command Line Editing345081 -Node: Introduction and Notation346752 -Node: Readline Interaction348375 -Node: Readline Bare Essentials349566 -Node: Readline Movement Commands351355 -Node: Readline Killing Commands352315 -Node: Readline Arguments354236 -Node: Searching355280 -Node: Readline Init File357466 -Node: Readline Init File Syntax358727 -Node: Conditional Init Constructs382752 -Node: Sample Init File386948 -Node: Bindable Readline Commands390072 -Node: Commands For Moving391276 -Node: Commands For History393327 -Node: Commands For Text398321 -Node: Commands For Killing402299 -Node: Numeric Arguments405003 -Node: Commands For Completion406142 -Node: Keyboard Macros410333 -Node: Miscellaneous Commands411021 -Node: Readline vi Mode417059 -Node: Programmable Completion417966 -Node: Programmable Completion Builtins425746 -Node: A Programmable Completion Example436866 -Node: Using History Interactively442114 -Node: Bash History Facilities442798 -Node: Bash History Builtins445803 -Node: History Interaction450827 -Node: Event Designators454447 -Node: Word Designators455801 -Node: Modifiers457561 -Node: Installing Bash459369 -Node: Basic Installation460506 -Node: Compilers and Options464228 -Node: Compiling For Multiple Architectures464969 -Node: Installation Names466661 -Node: Specifying the System Type468770 -Node: Sharing Defaults469487 -Node: Operation Controls470160 -Node: Optional Features471118 -Node: Reporting Bugs482337 -Node: Major Differences From The Bourne Shell483671 -Node: GNU Free Documentation License500520 -Node: Indexes525697 -Node: Builtin Index526151 -Node: Reserved Word Index533252 -Node: Variable Index535700 -Node: Function Index552834 -Node: Concept Index566555 +Node: Command Substitution96538 +Node: Arithmetic Expansion100002 +Node: Process Substitution100970 +Node: Word Splitting102090 +Node: Filename Expansion104138 +Node: Pattern Matching107071 +Node: Quote Removal112073 +Node: Redirections112368 +Node: Executing Commands122061 +Node: Simple Command Expansion122731 +Node: Command Search and Execution124841 +Node: Command Execution Environment127228 +Node: Environment130263 +Node: Exit Status131926 +Node: Signals133710 +Node: Shell Scripts137159 +Node: Shell Builtin Commands140186 +Node: Bourne Shell Builtins142224 +Node: Bash Builtins165360 +Node: Modifying Shell Behavior197386 +Node: The Set Builtin197731 +Node: The Shopt Builtin208675 +Node: Special Builtins224813 +Node: Shell Variables225792 +Node: Bourne Shell Variables226229 +Node: Bash Variables228333 +Node: Bash Features263290 +Node: Invoking Bash264303 +Node: Bash Startup Files270316 +Node: Interactive Shells275447 +Node: What is an Interactive Shell?275858 +Node: Is this Shell Interactive?276507 +Node: Interactive Shell Behavior277322 +Node: Bash Conditional Expressions280951 +Node: Shell Arithmetic285593 +Node: Aliases288554 +Node: Arrays291448 +Node: The Directory Stack298011 +Node: Directory Stack Builtins298795 +Node: Controlling the Prompt303055 +Node: The Restricted Shell306020 +Node: Bash POSIX Mode308630 +Node: Shell Compatibility Mode324773 +Node: Job Control333017 +Node: Job Control Basics333477 +Node: Job Control Builtins338479 +Node: Job Control Variables344274 +Node: Command Line Editing345430 +Node: Introduction and Notation347101 +Node: Readline Interaction348724 +Node: Readline Bare Essentials349915 +Node: Readline Movement Commands351704 +Node: Readline Killing Commands352664 +Node: Readline Arguments354585 +Node: Searching355629 +Node: Readline Init File357815 +Node: Readline Init File Syntax359076 +Node: Conditional Init Constructs383101 +Node: Sample Init File387297 +Node: Bindable Readline Commands390421 +Node: Commands For Moving391625 +Node: Commands For History393676 +Node: Commands For Text398670 +Node: Commands For Killing402648 +Node: Numeric Arguments405352 +Node: Commands For Completion406491 +Node: Keyboard Macros410682 +Node: Miscellaneous Commands411370 +Node: Readline vi Mode417408 +Node: Programmable Completion418315 +Node: Programmable Completion Builtins426095 +Node: A Programmable Completion Example437215 +Node: Using History Interactively442463 +Node: Bash History Facilities443147 +Node: Bash History Builtins446152 +Node: History Interaction451176 +Node: Event Designators454796 +Node: Word Designators456150 +Node: Modifiers457910 +Node: Installing Bash459718 +Node: Basic Installation460855 +Node: Compilers and Options464577 +Node: Compiling For Multiple Architectures465318 +Node: Installation Names467010 +Node: Specifying the System Type469119 +Node: Sharing Defaults469836 +Node: Operation Controls470509 +Node: Optional Features471467 +Node: Reporting Bugs482686 +Node: Major Differences From The Bourne Shell484020 +Node: GNU Free Documentation License500869 +Node: Indexes526046 +Node: Builtin Index526500 +Node: Reserved Word Index533601 +Node: Variable Index536049 +Node: Function Index553183 +Node: Concept Index566904  End Tag Table diff --git a/doc/bashref.log b/doc/bashref.log index edd684ed..ef94911f 100644 --- a/doc/bashref.log +++ b/doc/bashref.log @@ -1,12 +1,12 @@ -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 @@ -162,15 +162,15 @@ This is `epsf.tex' v2.7.4 <14 February 2011> 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] @@ -230,7 +230,7 @@ Overfull \hbox (5.95723pt too wide) in paragraph at lines 724--725 [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 ][] @@ -243,7 +243,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5377--5377 .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 ][] @@ -262,7 +262,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5378--5378 [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 @@ -312,10 +312,10 @@ gnored[] 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 '[], @@ -328,7 +328,7 @@ 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 @@ -344,13 +344,13 @@ 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 @@ -372,10 +372,10 @@ texlive/fonts/type1/public/amsfonts/cm/cmtt12.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) diff --git a/doc/bashref.pdf b/doc/bashref.pdf index cb0f398c..22a18193 100644 Binary files a/doc/bashref.pdf and b/doc/bashref.pdf differ diff --git a/doc/bashref.texi b/doc/bashref.texi index 4aa9ed88..8fb42e47 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -4772,8 +4772,9 @@ backslash-escaped characters is enabled. 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: @@ -6074,6 +6075,9 @@ leaving them open when the command completes. @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 diff --git a/doc/builtins.0 b/doc/builtins.0 index a14c85e8..18485a77 100644 --- a/doc/builtins.0 +++ b/doc/builtins.0 @@ -521,10 +521,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS characters is enabled. The --EE option disables the interpreta- tion of these escape characters, even on systems where they are interpreted by default. The xxppgg__eecchhoo shell option may be used - to dynamically determine whether or not eecchhoo expands these es- - cape characters by default. eecchhoo does not interpret ---- to mean - the end of options. eecchhoo interprets the following escape se- - quences: + to dynamically determine whether or not eecchhoo interprets any op- + tions and expands these escape characters by default. eecchhoo does + not interpret ---- to mean the end of options. eecchhoo interprets + the following escape sequences: \\aa alert (bell) \\bb backspace \\cc suppress further output @@ -1705,32 +1705,33 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS xxppgg__eecchhoo If set, the eecchhoo builtin expands backslash-escape se- - quences by default. + quences by default. If the ppoossiixx shell option is also + enabled, eecchhoo does not interpret any options. ssuussppeenndd [--ff] - Suspend the execution of this shell until it receives a SSIIGGCCOONNTT - signal. A login shell, or a shell without job control enabled, - cannot be suspended; the --ff 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 --ff is + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. A login shell, or a shell without job control enabled, + cannot be suspended; the --ff 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 --ff is not supplied. tteesstt _e_x_p_r [[ _e_x_p_r ]] Return a status of 0 (true) or 1 (false) depending on the evalu- ation of the conditional expression _e_x_p_r. Each operator and op- - erand must be a separate argument. Expressions are composed of - the primaries described in _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- + erand must be a separate argument. Expressions are composed of + the primaries described in _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- SSIIOONNSS. tteesstt does not accept any options, nor does it accept and ignore an argument of ---- 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. !! _e_x_p_r True if _e_x_p_r is false. (( _e_x_p_r )) - Returns the value of _e_x_p_r. This may be used to override + Returns the value of _e_x_p_r. This may be used to override the normal precedence of operators. _e_x_p_r_1 -aa _e_x_p_r_2 True if both _e_x_p_r_1 and _e_x_p_r_2 are true. @@ -1747,161 +1748,161 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS null. 2 arguments If the first argument is !!, 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 - _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + only if the second argument is null. If the first argu- + ment is one of the unary conditional operators listed in + _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, 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 _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- - SSIIOONNSS, the result of the expression is the result of the - binary test using the first and third arguments as oper- - ands. The --aa and --oo operators are considered binary op- + If the second argument is one of the binary conditional + operators listed in _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- + SSIIOONNSS, the result of the expression is the result of the + binary test using the first and third arguments as oper- + ands. The --aa and --oo operators are considered binary op- erators when there are three arguments. If the first ar- - gument is !!, the value is the negation of the two-argu- - ment test using the second and third arguments. If the + gument is !!, the value is the negation of the two-argu- + ment test using the second and third arguments. If the first argument is exactly (( and the third argument is ex- - actly )), the result is the one-argument test of the sec- + actly )), 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 !!, 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 (( and - the fourth argument is exactly )), 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 (( and + the fourth argument is exactly )), 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 _p_o_s_i_x _m_o_d_e, when used with tteesstt or [[, the - << and >> operators sort lexicographically using ASCII ordering. - When the shell is in _p_o_s_i_x _m_o_d_e, these operators sort using the + << and >> operators sort lexicographically using ASCII ordering. + When the shell is in _p_o_s_i_x _m_o_d_e, these operators sort using the current locale. - ttiimmeess Print the accumulated user and system times for the shell and + ttiimmeess Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0. ttrraapp [--llpp] [[_a_c_t_i_o_n] _s_i_g_s_p_e_c ...] The _a_c_t_i_o_n is a command that is read and executed when the shell receives signal(s) _s_i_g_s_p_e_c. If _a_c_t_i_o_n is absent (and there is a - single _s_i_g_s_p_e_c) or --, each specified signal is reset to its - original disposition (the value it had upon entrance to the - shell). If _a_c_t_i_o_n is the null string the signal specified by - each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in- + single _s_i_g_s_p_e_c) or --, each specified signal is reset to its + original disposition (the value it had upon entrance to the + shell). If _a_c_t_i_o_n is the null string the signal specified by + each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in- vokes. - If no arguments are supplied, ttrraapp displays the actions associ- + If no arguments are supplied, ttrraapp displays the actions associ- ated with each trapped signal as a set of ttrraapp commands that can - be reused as shell input to restore the current signal disposi- - tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp - displays the actions associated with each _s_i_g_s_p_e_c or, if none + be reused as shell input to restore the current signal disposi- + tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp + displays the actions associated with each _s_i_g_s_p_e_c or, if none are supplied, for all trapped signals, as a set of ttrraapp commands - that can be reused as shell input to restore the current signal - dispositions. The --PP option behaves similarly, but displays - only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- - quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options to - ttrraapp may be used in a subshell environment (e.g., command sub- - stitution) and, as long as they are used before ttrraapp 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 --PP option behaves similarly, but displays + only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- + quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options to + ttrraapp may be used in a subshell environment (e.g., command sub- + stitution) and, as long as they are used before ttrraapp is used to + change a signal's handling, will display the state of its par- ent's traps. - The --ll option causes ttrraapp to print a list of signal names and - their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal - name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names + The --ll option causes ttrraapp to print a list of signal names and + their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal + name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are case insensitive and the SSIIGG prefix is optional. - If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit - from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is + If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit + from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is executed before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, - _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, + _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, arithmetic _f_o_r command, and before the first command executes in - a shell function (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h_(_1_)). Refer to the - description of the eexxttddeebbuugg option to the sshhoopptt builtin for de- - tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, - the command _a_c_t_i_o_n is executed each time a shell function or a - script executed with the .. or ssoouurrccee builtins finishes execut- + a shell function (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h_(_1_)). Refer to the + description of the eexxttddeebbuugg option to the sshhoopptt builtin for de- + tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, + the command _a_c_t_i_o_n is executed each time a shell function or a + script executed with the .. or ssoouurrccee builtins finishes execut- ing. - If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n is executed whenever a + If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n 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 EERRRR trap is not executed if the + the following conditions. The EERRRR trap is not executed if the failed command is part of the command list immediately following - a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, + a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, part of a command executed in a &&&& or |||| list except the command - following the final &&&& or ||||, any command in a pipeline but the - last, or if the command's return value is being inverted using + following the final &&&& or ||||, any command in a pipeline but the + last, or if the command's return value is being inverted using !!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) 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 _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true. ttrruuee Does nothing, returns a 0 status. ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] - With no options, indicate how each _n_a_m_e would be interpreted if + With no options, indicate how each _n_a_m_e would be interpreted if used as a command name. If the --tt option is used, ttyyppee prints a - string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or - _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, - builtin, or executable disk file, respectively. If the _n_a_m_e is - not found, then nothing is printed, and ttyyppee returns a non-zero - exit status. If the --pp option is used, ttyyppee either returns the - name of the executable file that would be found by searching - $$PPAATTHH if _n_a_m_e were specified as a command name, or nothing if - ``type -t name'' would not return _f_i_l_e. The --PP option forces a - PPAATTHH search for each _n_a_m_e, even if ``type -t name'' would not + string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or + _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, + builtin, or executable disk file, respectively. If the _n_a_m_e is + not found, then nothing is printed, and ttyyppee returns a non-zero + exit status. If the --pp option is used, ttyyppee either returns the + name of the executable file that would be found by searching + $$PPAATTHH if _n_a_m_e were specified as a command name, or nothing if + ``type -t name'' would not return _f_i_l_e. The --PP option forces a + PPAATTHH search for each _n_a_m_e, even if ``type -t name'' would not return _f_i_l_e. If a command is hashed, --pp and --PP print the hashed - value, which is not necessarily the file that appears first in - PPAATTHH. If the --aa option is used, ttyyppee prints all of the places - that contain a command named _n_a_m_e. 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 + PPAATTHH. If the --aa option is used, ttyyppee prints all of the places + that contain a command named _n_a_m_e. This includes aliases, re- + served words, functions, and builtins, but the path search op- tions (--pp and --PP) can be supplied to restrict the output to exe- - cutable files. ttyyppee does not consult the table of hashed com- + cutable files. ttyyppee does not consult the table of hashed com- mands when using --aa with --pp, and only performs a PPAATTHH search for - _n_a_m_e. The --ff option suppresses shell function lookup, as with - the ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments + _n_a_m_e. The --ff option suppresses shell function lookup, as with + the ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments are found, false if any are not found. uulliimmiitt [--HHSS] --aa uulliimmiitt [--HHSS] [--bbccddeeffiikkllmmnnppqqrrssttuuvvxxPPRRTT [_l_i_m_i_t]] - 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 --HH and --SS 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 --HH nor --SS 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 --HH nor --SS is speci- fied, both the soft and hard limits are set. The value of _l_i_m_i_t can be a number in the unit specified for the resource or one of the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the - current hard limit, the current soft limit, and no limit, re- - spectively. If _l_i_m_i_t is omitted, the current value of the soft + current hard limit, the current soft limit, and no limit, re- + spectively. If _l_i_m_i_t is omitted, the current value of the soft limit of the resource is printed, unless the --HH 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: --aa All current limits are reported; no limits are set --bb The maximum socket buffer size --cc The maximum size of core files created --dd The maximum size of a process's data segment --ee The maximum scheduling priority ("nice") - --ff The maximum size of files written by the shell and its + --ff The maximum size of files written by the shell and its children --ii The maximum number of pending signals --kk The maximum number of kqueues that may be allocated --ll The maximum size that may be locked into memory - --mm The maximum resident set size (many systems do not honor + --mm The maximum resident set size (many systems do not honor this limit) --nn The maximum number of open file descriptors (most systems do not allow this value to be set) @@ -1910,134 +1911,134 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS --rr The maximum real-time scheduling priority --ss The maximum stack size --tt The maximum amount of cpu time in seconds - --uu The maximum number of processes available to a single + --uu The maximum number of processes available to a single user - --vv The maximum amount of virtual memory available to the + --vv The maximum amount of virtual memory available to the shell and, on some systems, to its children --xx The maximum number of file locks --PP The maximum number of pseudoterminals - --RR The maximum time a real-time process can run before + --RR The maximum time a real-time process can run before blocking, in microseconds --TT The maximum number of threads - If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the - new value of the specified resource. If no option is given, - then --ff is assumed. Values are in 1024-byte increments, except - for --tt, which is in seconds; --RR, which is in microseconds; --pp, - which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and - --uu, which are unscaled values; and, when in posix mode, --cc and - --ff, which are in 512-byte increments. The return status is 0 - unless an invalid option or argument is supplied, or an error + If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the + new value of the specified resource. If no option is given, + then --ff is assumed. Values are in 1024-byte increments, except + for --tt, which is in seconds; --RR, which is in microseconds; --pp, + which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and + --uu, which are unscaled values; and, when in posix mode, --cc and + --ff, 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. uummaasskk [--pp] [--SS] [_m_o_d_e] The user file-creation mask is set to _m_o_d_e. If _m_o_d_e 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 - _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is - printed. The --SS option causes the mask to be printed in sym- - bolic form; the default output is an octal number. If the --pp + a digit, it is interpreted as an octal number; otherwise it is + interpreted as a symbolic mode mask similar to that accepted by + _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is + printed. The --SS option causes the mask to be printed in sym- + bolic form; the default output is an octal number. If the --pp option is supplied, and _m_o_d_e 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 _m_o_d_e argument was supplied, + was successfully changed or if no _m_o_d_e argument was supplied, and false otherwise. uunnaalliiaass [-aa] [_n_a_m_e ...] - Remove each _n_a_m_e from the list of defined aliases. If --aa is - supplied, all alias definitions are removed. The return value + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, all alias definitions are removed. The return value is true unless a supplied _n_a_m_e is not a defined alias. uunnsseett [-ffvv] [-nn] [_n_a_m_e ...] - For each _n_a_m_e, remove the corresponding variable or function. + For each _n_a_m_e, remove the corresponding variable or function. If the --vv option is given, each _n_a_m_e refers to a shell variable, - and that variable is removed. Read-only variables may not be - unset. If --ff is specified, each _n_a_m_e refers to a shell func- - tion, and the function definition is removed. If the --nn option - is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, - _n_a_m_e will be unset rather than the variable it references. --nn - has no effect if the --ff option is supplied. If no options are - supplied, each _n_a_m_e 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 BBAASSHH__AALLIIAASSEESS, + and that variable is removed. Read-only variables may not be + unset. If --ff is specified, each _n_a_m_e refers to a shell func- + tion, and the function definition is removed. If the --nn option + is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, + _n_a_m_e will be unset rather than the variable it references. --nn + has no effect if the --ff option is supplied. If no options are + supplied, each _n_a_m_e 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 BBAASSHH__AALLIIAASSEESS, BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBBSSHHEELLLL, BBAASSHHPPIIDD, - CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- - NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are + CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- + NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are unset, they lose their special properties, even if they are sub- sequently reset. The exit status is true unless a _n_a_m_e is read- only or may not be unset. wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d _._._.] Wait for each specified child process and return its termination - status. Each _i_d 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 _i_d is not given, wwaaiitt waits for all running - background jobs and the last-executed process substitution, if + status. Each _i_d 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 _i_d is not given, wwaaiitt waits for all running + background jobs and the last-executed process substitution, if its process id is the same as $$!!, and the return status is zero. - If the --nn option is supplied, wwaaiitt waits for a single job from + If the --nn option is supplied, wwaaiitt waits for a single job from the list of _i_ds or, if no _i_ds 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 --pp option is supplied, the process or job identifier of the - job for which the exit status is returned is assigned to the - variable _v_a_r_n_a_m_e named by the option argument. The variable - will be unset initially, before any assignment. This is useful - only when the --nn option is supplied. Supplying the --ff option, - when job control is enabled, forces wwaaiitt to wait for _i_d to ter- + shell has no unwaited-for children, the exit status is 127. If + the --pp option is supplied, the process or job identifier of the + job for which the exit status is returned is assigned to the + variable _v_a_r_n_a_m_e named by the option argument. The variable + will be unset initially, before any assignment. This is useful + only when the --nn option is supplied. Supplying the --ff option, + when job control is enabled, forces wwaaiitt to wait for _i_d to ter- minate before returning its status, instead of returning when it - changes status. If _i_d specifies a non-existent process or job, - the return status is 127. If wwaaiitt is interrupted by a signal, - the return status will be greater than 128, as described under - SSIIGGNNAALLSS in _b_a_s_h_(_1_). Otherwise, the return status is the exit + changes status. If _i_d specifies a non-existent process or job, + the return status is 127. If wwaaiitt is interrupted by a signal, + the return status will be greater than 128, as described under + SSIIGGNNAALLSS in _b_a_s_h_(_1_). Otherwise, the return status is the exit status of the last process or job waited for. SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE - Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- - fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322, - ccoommppaatt4400, ccoommppaatt4411, 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 _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- + fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322, + ccoommppaatt4400, ccoommppaatt4411, 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 ccoommppaatt3322 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 ccoommppaatt3322 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, ccoommppaatt3322, 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 bbaasshh, but that behavior may have been - present in earlier versions. For instance, the change to use locale- - based comparisons with the [[[[ command came in bash-4.1, and earlier + If a user enables, say, ccoommppaatt3322, 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 bbaasshh, but that behavior may have been + present in earlier versions. For instance, the change to use locale- + based comparisons with the [[[[ command came in bash-4.1, and earlier versions used ASCII-based comparisons, so enabling ccoommppaatt3322 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: BBAASSHH__CCOOMMPPAATT. The value as- + Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as- signed to this variable (a decimal version number like 4.2, or an inte- - ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com- + ger corresponding to the ccoommppaatt_N_N 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 BBAASSHH__CCOOMM-- + Starting with bash-4.4, Bash has begun deprecating older compatibility + levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM-- PPAATT. - Bash-5.0 is the final version for which there will be an individual - shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on + Bash-5.0 is the final version for which there will be an individual + shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT 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 ccoommppaatt_N_N tag is used as shorthand for setting the compatibility level to _N_N using one of the following mecha- - nisms. For versions prior to bash-5.0, the compatibility level may be - set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and - later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- + nisms. For versions prior to bash-5.0, the compatibility level may be + set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and + later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- quired for bash-5.1 and later versions. ccoommppaatt3311 @@ -2045,85 +2046,85 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE ator (=~) has no special effect ccoommppaatt3322 - +o 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 + +o 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) ccoommppaatt4400 - +o the << and >> operators to the [[[[ command do not consider + +o the << and >> operators to the [[[[ 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 _s_t_r_c_m_p(3); bash-4.1 and later use the current + lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current locale's collation sequence and _s_t_r_c_o_l_l(3). ccoommppaatt4411 - +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still + +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still be recognized as a reserved word (this is POSIX interpre- tation 267) +o in _p_o_s_i_x mode, the parser requires that an even number of - single quotes occur in the _w_o_r_d 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 _w_o_r_d 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) ccoommppaatt4422 +o 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 - +o in posix mode, single quotes are considered special when - expanding the _w_o_r_d 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 + +o in posix mode, single quotes are considered special when + expanding the _w_o_r_d 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 ccoommppaatt4433 - +o 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 + +o 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 - +o 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 + +o 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) - +o when executing a shell function, the loop state + +o when executing a shell function, the loop state (while/until/etc.) is not reset, so bbrreeaakk or ccoonnttiinnuuee 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 ccoommppaatt4444 - +o the shell sets up the values used by BBAASSHH__AARRGGVV and - BBAASSHH__AARRGGCC so they can expand to the shell's positional + +o the shell sets up the values used by BBAASSHH__AARRGGVV and + BBAASSHH__AARRGGCC so they can expand to the shell's positional parameters even if extended debugging mode is not enabled - +o a subshell inherits loops from its parent context, so - bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. - Bash-5.0 and later reset the loop state to prevent the + +o a subshell inherits loops from its parent context, so + bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. + Bash-5.0 and later reset the loop state to prevent the exit - +o variable assignments preceding builtins like eexxppoorrtt and + +o variable assignments preceding builtins like eexxppoorrtt and rreeaaddoonnllyy that set attributes continue to affect variables with the same name in the calling environment even if the shell is not in posix mode ccoommppaatt5500 - +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- + +o Bash-5.1 changed the way $$RRAANNDDOOMM 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 RRAANNDDOOMM 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 RRAANNDDOOMM will produce the same sequence as in bash-5.0 - +o 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 --ll op- + +o 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 --ll op- tion is supplied. ccoommppaatt5511 - +o The uunnsseett builtin treats attempts to unset array sub- - scripts @@ and ** differently depending on whether the ar- - ray is indexed or associative, and differently than in + +o The uunnsseett builtin treats attempts to unset array sub- + scripts @@ and ** differently depending on whether the ar- + ray is indexed or associative, and differently than in previous versions. SSEEEE AALLSSOO diff --git a/doc/version.texi b/doc/version.texi index dd8f4ade..06fa315d 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -2,10 +2,10 @@ 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 diff --git a/lib/readline/doc/history.3 b/lib/readline/doc/history.3 index 082bf42d..63a40049 100644 --- a/lib/readline/doc/history.3 +++ b/lib/readline/doc/history.3 @@ -119,13 +119,13 @@ is followed immediately by a newline. 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 !# @@ -137,7 +137,7 @@ A .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 \- , @@ -156,7 +156,7 @@ word. .I n The \fIn\fRth word. .TP -.B ^ +.B \(ha The first argument. That is, word 1. .TP .B $ @@ -497,7 +497,7 @@ This section documents the functions for managing a history file. .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" @@ -505,25 +505,25 @@ Read a range of lines from \fIfilename\fP, adding them to the history list. 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 @@ -604,7 +604,7 @@ Setting this to 0 inhibits 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 @@ -643,7 +643,7 @@ By default, this variable is set to \fBNULL\fP. .SH FILES .PD 0 .TP -.FN ~/.history +.FN \(ti/.history Default filename for reading and writing saved history .PD .SH "SEE ALSO" diff --git a/lib/readline/doc/readline.3 b/lib/readline/doc/readline.3 index 5f2bd995..8b0ba108 100644 --- a/lib/readline/doc/readline.3 +++ b/lib/readline/doc/readline.3 @@ -116,7 +116,7 @@ file (the \fIinputrc\fP file). 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 @@ -215,7 +215,7 @@ are not recognized. .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, @@ -226,7 +226,7 @@ is again bound to the function 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''. @@ -1156,7 +1156,7 @@ The actual completion performed is application-specific. .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 , @@ -1388,7 +1388,7 @@ Emacs Standard bindings "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 @@ -1435,7 +1435,7 @@ 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 @@ -1473,7 +1473,7 @@ VI Insert Mode functions "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 @@ -1531,7 +1531,7 @@ 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 @@ -1556,7 +1556,7 @@ VI Command Mode functions "x" vi-delete "y" vi-yank-to "|" vi-column -"~" vi-change-case +"\(ti" vi-change-case .RE .SH "SEE ALSO" .PD 0 @@ -1570,7 +1570,7 @@ VI Command Mode functions .SH FILES .PD 0 .TP -.FN ~/.inputrc +.FN \(ti/.inputrc Individual \fBreadline\fP initialization file .PD .SH AUTHORS diff --git a/make_cmd.c b/make_cmd.c index ea2e18ba..b7882285 100644 --- a/make_cmd.c +++ b/make_cmd.c @@ -449,7 +449,7 @@ make_cond_command (COND_COM *cond_node) } COMMAND * -make_bare_simple_command (void) +make_bare_simple_command (int line) { COMMAND *command; SIMPLE_COM *temp; @@ -458,7 +458,7 @@ make_bare_simple_command (void) 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; @@ -472,14 +472,14 @@ make_bare_simple_command (void) /* 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; } diff --git a/make_cmd.h b/make_cmd.h index a138133e..8b1354f6 100644 --- a/make_cmd.h +++ b/make_cmd.h @@ -46,8 +46,8 @@ extern PATTERN_LIST *make_pattern_list (WORD_LIST *, COMMAND *); 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); diff --git a/parse.y b/parse.y index 6701d596..2e3c2ec2 100644 --- a/parse.y +++ b/parse.y @@ -310,6 +310,9 @@ static int shell_input_line_terminator; 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; @@ -791,7 +794,11 @@ simple_command_element: WORD | 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 @@ -810,13 +817,13 @@ 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 @@ -999,7 +1006,7 @@ case_command: CASE WORD newline_list IN newline_list ESAC ; 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 @@ -1362,7 +1369,7 @@ pipeline_command: pipeline 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') @@ -1383,7 +1390,7 @@ pipeline_command: pipeline 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') @@ -3404,6 +3411,8 @@ reset_parser (void) 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'; @@ -4315,7 +4324,8 @@ static char * 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; @@ -4357,6 +4367,7 @@ parse_comsub (int qc, int open, int close, size_t *lenp, int flags) /*debug_parser(1);*/ start_lineno = line_number; + save_lineno = simplecmd_lineno; save_parser_state (&ps); @@ -4482,6 +4493,8 @@ INTERNAL_DEBUG(("current_token (%d) != shell_eof_token (%c)", current_token, she 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 == '(') /* ) */ @@ -4541,12 +4554,14 @@ xparse_dolparen (const char *base, char *string, int *indp, int flags) 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) { @@ -4613,6 +4628,8 @@ xparse_dolparen (const char *base, char *string, int *indp, int flags) #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 */ @@ -5682,6 +5699,10 @@ got_token: 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: diff --git a/tests/comsub.right b/tests/comsub.right index d8845a83..0c84094c 100644 --- a/tests/comsub.right +++ b/tests/comsub.right @@ -1,4 +1,4 @@ -./comsub.tests: line 20: hijkl: command not found +./comsub.tests: line 19: hijkl: command not found argv[1] = argv[2] = argv[1] = diff --git a/tests/comsub2.right b/tests/comsub2.right index aa930745..fc4b4144 100644 --- a/tests/comsub2.right +++ b/tests/comsub2.right @@ -21,8 +21,8 @@ aa,bb 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: diff --git a/tests/heredoc.right b/tests/heredoc.right index b7042ff9..63402138 100644 --- a/tests/heredoc.right +++ b/tests/heredoc.right @@ -124,8 +124,8 @@ argv[3] = 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 () {