From: Chet Ramey Date: Fri, 18 Oct 2024 16:19:48 +0000 (-0400) Subject: next set of documentation fixes: update formatting, make filename formatting consiste... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=261c6e8cc6c59b63be3a1597aadec72e9cf5ae72;p=thirdparty%2Fbash.git next set of documentation fixes: update formatting, make filename formatting consistent, typeset the name readline consistently --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 81ac532a..531b3c18 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -10360,3 +10360,23 @@ doc/bash.1,doc/bashref.texi doc/bash.1,doc/bashref.texi,lib/readline/doc/readline.3,lib/readline/doc/rluser.texi - minor wording updates and typo fixes from G. Branden Robinson + + 10/15 + ----- +doc/bash.1,doc/bashref.texi,lib/readline/doc/readline.3,lib/readline/doc/rluser.texi + - wording/formatting updates and typo fixes from + G. Branden Robinson + +doc/bash.1 + - update .FN macro, use it consistently for filenames, like @file{} + +doc/bashref.texi + - make sure to use @dots and @file consistently + +doc/bash.1,lib/readline/doc/readline.3 + - make sure `readline' is typeset consistently + + 10/18 + ----- +sig.c + - fix minix typo diff --git a/INSTALL b/INSTALL index 31aa6a2b..ecc5fd9c 100644 --- a/INSTALL +++ b/INSTALL @@ -107,7 +107,7 @@ you want the object files and executables to go and run the ‘configure’ script from the source directory (*note Basic Installation::). You may need to supply the ‘--srcdir=PATH’ argument to tell ‘configure’ where the source files are. ‘configure’ automatically checks for the source -code in the directory that ‘configure’ is in and in '..'. +code in the directory that ‘configure’ is in and in ‘..’. If you have to use a ‘make’ that does not support the ‘VPATH’ variable, you can compile Bash for one architecture at a time in the source code diff --git a/POSIX b/POSIX index 94f2e4c9..adb84c14 100644 --- a/POSIX +++ b/POSIX @@ -15,13 +15,13 @@ standard was published in 1992. It was merged with the original IEEE 1003.1 Working Group and is currently maintained by the Austin Group (a joint working group of the IEEE, The Open Group and ISO/IEC SC22/WG15). Today the Shell and Utilities are a volume within the set of documents -that make up IEEE Std 1003.1-2017, and thus the former POSIX.2 (from +that make up IEEE Std 1003.1-2024, and thus the former POSIX.2 (from 1992) is now part of the current unified POSIX standard. The Shell and Utilities volume concentrates on the command interpreter interface and utility programs commonly executed from the command line or by other programs. The standard is freely available on the web at -. +. Bash is concerned with the aspects of the shell's behavior defined by the POSIX Shell and Utilities volume. The shell command language has of @@ -45,7 +45,7 @@ editing commands were left out due to objections. Although Bash is an implementation of the POSIX shell specification, there are areas where the Bash default behavior differs from the specification. The Bash “posix mode” changes the Bash behavior in these -areas so that it conforms to the standard more closely. +areas so that it conforms more closely to the standard. Starting Bash with the ‘--posix’ command-line option or executing ‘set -o posix’ while Bash is running will cause Bash to conform more closely @@ -59,132 +59,148 @@ The following list is what's changed when 'POSIX mode' is in effect: 1. Bash ensures that the ‘POSIXLY_CORRECT’ variable is set. - 2. When a command in the hash table no longer exists, Bash will - re-search ‘$PATH’ to find the new location. This is also available - with ‘shopt -s checkhash’. - - 3. Bash will not insert a command without the execute bit set into the - command hash table, even if it returns it as a (last-ditch) result - from a ‘$PATH’ search. + 2. Bash reads and executes the POSIX startup files (‘$ENV’) rather + than the normal Bash files (*note Bash Startup Files::. - 4. The message printed by the job control code and builtins when a job - exits with a non-zero status is 'Done(status)'. + 3. Alias expansion is always enabled, even in non-interactive shells. - 5. The message printed by the job control code and builtins when a job - is stopped is 'Stopped(SIGNAME)', where SIGNAME is, for example, - ‘SIGTSTP’. + 4. Reserved words appearing in a context where reserved words are + recognized do not undergo alias expansion. - 6. If the shell is interactive, Bash does not perform job - notifications between executing commands in lists separated by ‘;’ - or newline. Non-interactive shells print status messages after a - foreground job in a list completes. + 5. Alias expansion is performed when initially parsing a command + substitution. The default (non-posix) mode generally defers it, + when enabled, until the command substitution is executed. This + means that command substitution will not expand aliases that are + defined after the command substitution is initially parsed (e.g., + as part of a function definition). - 7. If the shell is interactive, Bash waits until the next prompt - before printing the status of a background job that changes status - or a foreground job that terminates due to a signal. - Non-interactive shells print status messages after a foreground job - completes. + 6. The ‘time’ reserved word may be used by itself as a simple command. + When used in this way, it displays timing statistics for the shell + and its completed children. The ‘TIMEFORMAT’ variable controls the + format of the timing information. - 8. Bash permanently removes jobs from the jobs table after notifying - the user of their termination, whether that is via ‘wait’, ‘jobs’, - or interactive shell notification before prompting. + 7. The parser does not recognize ‘time’ as a reserved word if the next + token begins with a ‘-’. - 9. Alias expansion is always enabled, even in non-interactive shells. + 8. When parsing and expanding a ${...} expansion that appears within + double quotes, single quotes are no longer special and cannot be + used to quote a closing brace or other special character, unless + the operator is one of those defined to perform pattern removal. + In this case, they do not have to appear as matched pairs. - 10. Reserved words appearing in a context where reserved words are - recognized do not undergo alias expansion. + 9. Redirection operators do not perform filename expansion on the word + in a redirection unless the shell is interactive. - 11. Alias expansion is performed when initially parsing a command - substitution. The default mode generally defers it, when enabled, - until the command substitution is executed. This means that - command substitution will not expand aliases that are defined after - the command substitution is initially parsed (e.g., as part of a - function definition). + 10. Redirection operators do not perform word splitting on the word in + a redirection. - 12. The POSIX ‘PS1’ and ‘PS2’ expansions of ‘!’ to the history number - and ‘!!’ to ‘!’ are enabled, and parameter expansion is performed - on the values of ‘PS1’ and ‘PS2’ regardless of the setting of the - ‘promptvars’ option. + 11. Function names must be valid shell ‘name’s. That is, they may not + contain characters other than letters, digits, and underscores, and + may not start with a digit. Declaring a function with an invalid + name in a non-interactive shell is a fatal syntax error. - 13. The POSIX startup files are executed (‘$ENV’) rather than the - normal Bash files. + 12. Function names may not be the same as one of the POSIX special + builtins. - 14. Tilde expansion is only performed on assignments preceding a + 13. Tilde expansion is only performed on assignments preceding a command name, rather than on all assignment statements on the line. - 15. The default history file is ‘~/.sh_history’ (this is the default - value the shell assigns to ‘$HISTFILE’). + 14. While variable indirection is available, it may not be applied to + the ‘#’ and ‘?’ special parameters. - 16. Redirection operators do not perform filename expansion on the - word in the redirection unless the shell is interactive. + 15. Expanding the ‘*’ special parameter in a pattern context where the + expansion is double-quoted does not treat the ‘$*’ as if it were + double-quoted. - 17. Redirection operators do not perform word splitting on the word in - the redirection. + 16. A double quote character (‘"’) is treated specially when it + appears in a backquoted command substitution in the body of a + here-document that undergoes expansion. That means, for example, + that a backslash preceding a double quote character will escape it + and the backslash will be removed. - 18. Function names must be valid shell ‘name’s. That is, they may not - contain characters other than letters, digits, and underscores, and - may not start with a digit. Declaring a function with an invalid - name causes a fatal syntax error in non-interactive shells. + 17. Command substitutions don't set the ‘?’ special parameter. The + exit status of a simple command without a command word is still the + exit status of the last command substitution that occurred while + evaluating the variable assignments and redirections in that + command, but that does not happen until after all of the + assignments and redirections. + + 18. Literal tildes that appear as the first character in elements of + the ‘PATH’ variable are not expanded as described above under *note + Tilde Expansion::. - 19. Function names may not be the same as one of the POSIX special + 19. Command lookup finds POSIX special builtins before shell + functions, including output printed by the ‘type’ and ‘command’ builtins. 20. Even if a shell function whose name contains a slash was defined before entering POSIX mode, the shell will not execute a function whose name contains one or more slashes. - 21. POSIX special builtins are found before shell functions during - command lookup, including output printed by the ‘type’ and - ‘command’ builtins. + 21. When a command in the hash table no longer exists, Bash will + re-search ‘$PATH’ to find the new location. This is also available + with ‘shopt -s checkhash’. - 22. When printing shell function definitions (e.g., by ‘type’), Bash - does not print the ‘function’ keyword. + 22. Bash will not insert a command without the execute bit set into + the command hash table, even if it returns it as a (last-ditch) + result from a ‘$PATH’ search. - 23. Literal tildes that appear as the first character in elements of - the ‘PATH’ variable are not expanded as described above under *note - Tilde Expansion::. + 23. The message printed by the job control code and builtins when a + job exits with a non-zero status is 'Done(status)'. - 24. The ‘time’ reserved word may be used by itself as a command. When - used in this way, it displays timing statistics for the shell and - its completed children. The ‘TIMEFORMAT’ variable controls the - format of the timing information. + 24. The message printed by the job control code and builtins when a + job is stopped is 'Stopped(SIGNAME)', where SIGNAME is, for + example, ‘SIGTSTP’. - 25. When parsing and expanding a ${...} expansion that appears within - double quotes, single quotes are no longer special and cannot be - used to quote a closing brace or other special character, unless - the operator is one of those defined to perform pattern removal. - In this case, they do not have to appear as matched pairs. + 25. If the shell is interactive, Bash does not perform job + notifications between executing commands in lists separated by ‘;’ + or newline. Non-interactive shells print status messages after a + foreground job in a list completes. - 26. The parser does not recognize ‘time’ as a reserved word if the - next token begins with a ‘-’. + 26. If the shell is interactive, Bash waits until the next prompt + before printing the status of a background job that changes status + or a foreground job that terminates due to a signal. + Non-interactive shells print status messages after a foreground job + completes. + + 27. Bash permanently removes jobs from the jobs table after notifying + the user of their termination via the ‘wait’ or ‘jobs’ builtins. - 27. The ‘!’ character does not introduce history expansion within a + 28. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when + the ‘v’ command is run, instead of checking ‘$VISUAL’ and + ‘$EDITOR’. + + 29. Prompt expansion enables the POSIX ‘PS1’ and ‘PS2’ expansions of + ‘!’ to the history number and ‘!!’ to ‘!’, and Bash performs + parameter expansion on the values of ‘PS1’ and ‘PS2’ regardless of + the setting of the ‘promptvars’ option. + + 30. The default history file is ‘~/.sh_history’ (this is the default + value the shell assigns to ‘$HISTFILE’). + + 31. The ‘!’ character does not introduce history expansion within a double-quoted string, even if the ‘histexpand’ option is enabled. - 28. If a POSIX special builtin returns an error status, a + 32. When printing shell function definitions (e.g., by ‘type’), Bash + does not print the ‘function’ keyword. + + 33. Non-interactive shells exit if a syntax error in an arithmetic + expansion results in an invalid expression. + + 34. Non-interactive shells exit if a parameter expansion error occurs. + + 35. If a POSIX special builtin returns an error status, a non-interactive shell exits. The fatal errors are those listed in the POSIX standard, and include things like passing incorrect options, redirection errors, variable assignment errors for assignments preceding the command name, and so on. - 29. The ‘unset’ builtin with the ‘-v’ option specified returns a fatal - error if it attempts to unset a ‘readonly’ or ‘non-unsettable’ - variable, or encounters a variable name argument that is an invalid - identifier, which causes a non-interactive shell to exit. - - 30. When asked to unset a variable that appears in an assignment - statement preceding the command, the ‘unset’ builtin attempts to - unset a variable of the same name in the current or previous scope - as well. This implements the required "if an assigned variable is - further modified by the utility, the modifications made by the - utility shall persist" behavior. - - 31. A non-interactive shell exits with an error status if a variable + 36. A non-interactive shell exits with an error status if a variable assignment error occurs when no command name follows the assignment statements. A variable assignment error occurs, for example, when trying to assign a value to a readonly variable. - 32. A non-interactive shell exits with an error status if a variable + 37. A non-interactive shell exits with an error status if a variable assignment error occurs in an assignment statement preceding a special builtin, but not with any other simple command. For any other simple command, the shell aborts execution of that command, @@ -192,171 +208,156 @@ The following list is what's changed when 'POSIX mode' is in effect: perform any further processing of the command in which the error occurred"). - 33. A non-interactive shell exits with an error status if the + 38. A non-interactive shell exits with an error status if the iteration variable in a ‘for’ statement or the selection variable in a ‘select’ statement is a readonly variable or has an invalid name. - 34. Non-interactive shells exit if FILENAME in ‘.’ FILENAME is not + 39. Non-interactive shells exit if FILENAME in ‘.’ FILENAME is not found. - 35. Non-interactive shells exit if a syntax error in an arithmetic - expansion results in an invalid expression. - - 36. Non-interactive shells exit if a parameter expansion error occurs. - - 37. Non-interactive shells exit if there is a syntax error in a script + 40. Non-interactive shells exit if there is a syntax error in a script read with the ‘.’ or ‘source’ builtins, or in a string processed by the ‘eval’ builtin. - 38. While variable indirection is available, it may not be applied to - the ‘#’ and ‘?’ special parameters. - - 39. Expanding the ‘*’ special parameter in a pattern context where the - expansion is double-quoted does not treat the ‘$*’ as if it were - double-quoted. + 41. Non-interactive shells exit if the ‘export’, ‘readonly’ or ‘unset’ + builtin commands get an argument that is not a valid identifier, + and they are not operating on shell functions. These errors force + an exit because these are special builtins. - 40. Assignment statements preceding POSIX special builtins persist in + 42. Assignment statements preceding POSIX special builtins persist in the shell environment after the builtin completes. - 41. The ‘command’ builtin does not prevent builtins that take + 43. The ‘command’ builtin does not prevent builtins that take assignment statements as arguments from expanding them as - assignment statements; when not in POSIX mode, assignment builtins + assignment statements; when not in POSIX mode, declaration commands lose their assignment statement expansion properties when preceded by ‘command’. - 42. The ‘bg’ builtin uses the required format to describe each job - placed in the background, which does not include an indication of - whether the job is the current or previous job. - - 43. The output of ‘kill -l’ prints all the signal names on a single - line, separated by spaces, without the ‘SIG’ prefix. - - 44. The ‘kill’ builtin does not accept signal names with a ‘SIG’ - prefix. - - 45. The ‘export’ and ‘readonly’ builtin commands display their output - in the format required by POSIX. - - 46. If the ‘export’ and ‘readonly’ builtin commands get an argument - that is not a valid identifier, and they are not operating on shell - functions, they return an error. This will cause a non-interactive - shell to exit because these are special builtins. - - 47. The ‘trap’ builtin displays signal names without the leading - ‘SIG’. - - 48. The ‘trap’ builtin doesn't check the first argument for a possible - signal specification and revert the signal handling to the original - disposition if it is, unless that argument consists solely of - digits and is a valid signal number. If users want to reset the - handler for a given signal to the original disposition, they should - use ‘-’ as the first argument. - - 49. ‘trap -p’ without arguments displays signals whose dispositions - are set to SIG_DFL and those that were ignored when the shell - started, not just trapped signals. - - 50. The ‘.’ and ‘source’ builtins do not search the current directory - for the filename argument if it is not found by searching ‘PATH’. - - 51. Enabling POSIX mode has the effect of setting the + 44. Enabling POSIX mode has the effect of setting the ‘inherit_errexit’ option, so subshells spawned to execute command substitutions inherit the value of the ‘-e’ option from the parent shell. When the ‘inherit_errexit’ option is not enabled, Bash clears the ‘-e’ option in such subshells. - 52. Enabling POSIX mode has the effect of setting the ‘shift_verbose’ + 45. Enabling POSIX mode has the effect of setting the ‘shift_verbose’ option, so numeric arguments to ‘shift’ that exceed the number of positional parameters will result in an error message. - 53. When the ‘alias’ builtin displays alias definitions, it does not + 46. Enabling POSIX mode has the effect of setting the + ‘interactive_comments’ option (*note Comments::). + + 47. The ‘.’ and ‘source’ builtins do not search the current directory + for the filename argument if it is not found by searching ‘PATH’. + + 48. When the ‘alias’ builtin displays alias definitions, it does not display them with a leading ‘alias ’ unless the ‘-p’ option is supplied. - 54. When the ‘set’ builtin is invoked without options, it does not - display shell function names and definitions. - - 55. When the ‘set’ builtin is invoked without options, it displays - variable values without quotes, unless they contain shell - metacharacters, even if the result contains nonprinting characters. + 49. The ‘bg’ builtin uses the required format to describe each job + placed in the background, which does not include an indication of + whether the job is the current or previous job. - 56. When the ‘cd’ builtin is invoked in logical mode, and the pathname + 50. When the ‘cd’ builtin is invoked in logical mode, and the pathname constructed from ‘$PWD’ and the directory name supplied as an argument does not refer to an existing directory, ‘cd’ will fail instead of falling back to physical mode. - 57. When the ‘cd’ builtin cannot change a directory because the length + 51. When the ‘cd’ builtin cannot change a directory because the length of the pathname constructed from ‘$PWD’ and the directory name supplied as an argument exceeds ‘PATH_MAX’ when canonicalized, ‘cd’ will attempt to use the supplied directory name. - 58. The ‘pwd’ builtin verifies that the value it prints is the same as - the current directory, even if it is not asked to check the file - system with the ‘-P’ option. + 52. When the ‘xpg_echo’ option is enabled, Bash does not attempt to + interpret any arguments to ‘echo’ as options. ‘echo’ displays each + argument after converting escape sequences. - 59. When listing the history, the ‘fc’ builtin does not include an + 53. The ‘export’ and ‘readonly’ builtin commands display their output + in the format required by POSIX. + + 54. When listing the history, the ‘fc’ builtin does not include an indication of whether or not a history entry has been modified. - 60. The default editor used by ‘fc’ is ‘ed’. + 55. The default editor used by ‘fc’ is ‘ed’. - 61. ‘fc’ treats extra arguments as an error instead of ignoring them. + 56. ‘fc’ treats extra arguments as an error instead of ignoring them. - 62. If there are too many arguments supplied to ‘fc -s’, ‘fc’ prints + 57. If there are too many arguments supplied to ‘fc -s’, ‘fc’ prints an error message and returns failure. - 63. The ‘type’ and ‘command’ builtins will not report a non-executable - file as having been found, though the shell will attempt to execute - such a file if it is the only so-named file found in ‘$PATH’. - - 64. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when - the ‘v’ command is run, instead of checking ‘$VISUAL’ and - ‘$EDITOR’. + 58. The output of ‘kill -l’ prints all the signal names on a single + line, separated by spaces, without the ‘SIG’ prefix. - 65. When the ‘xpg_echo’ option is enabled, Bash does not attempt to - interpret any arguments to ‘echo’ as options. Each argument is - displayed, after escape characters are converted. + 59. The ‘kill’ builtin does not accept signal names with a ‘SIG’ + prefix. - 66. The ‘ulimit’ builtin uses a block size of 512 bytes for the ‘-c’ - and ‘-f’ options. + 60. The ‘printf’ builtin uses ‘double’ (via ‘strtod’) to convert + arguments corresponding to floating point conversion specifiers, + instead of ‘long double’ if it's available. The ‘L’ length + modifier forces ‘printf’ to use ‘long double’ if it's available. - 67. The arrival of ‘SIGCHLD’ when a trap is set on ‘SIGCHLD’ does not - interrupt the ‘wait’ builtin and cause it to return immediately. - The trap command is run once for each child that exits. + 61. The ‘pwd’ builtin verifies that the value it prints is the same as + the current directory, even if it is not asked to check the file + system with the ‘-P’ option. - 68. The ‘read’ builtin may be interrupted by a signal for which a trap + 62. The ‘read’ builtin may be interrupted by a signal for which a trap has been set. If Bash receives a trapped signal while executing ‘read’, the trap handler executes and ‘read’ returns an exit status greater than 128. - 69. The ‘printf’ builtin uses ‘double’ (via ‘strtod’) to convert - arguments corresponding to floating point conversion specifiers, - instead of ‘long double’ if it's available. The ‘L’ length - modifier forces ‘printf’ to use ‘long double’ if it's available. - - 70. Bash removes an exited background process's status from the list - of such statuses after the ‘wait’ builtin is used to obtain it. + 63. When the ‘set’ builtin is invoked without options, it does not + display shell function names and definitions. - 71. A double quote character (‘"’) is treated specially when it - appears in a backquoted command substitution in the body of a - here-document that undergoes expansion. That means, for example, - that a backslash preceding a double quote character will escape it - and the backslash will be removed. + 64. When the ‘set’ builtin is invoked without options, it displays + variable values without quotes, unless they contain shell + metacharacters, even if the result contains nonprinting characters. - 72. The ‘test’ builtin compares strings using the current locale when - processing the ‘<’ and ‘>’ binary operators. + 65. The ‘test’ builtin compares strings using the current locale when + evaluating the ‘<’ and ‘>’ binary operators. - 73. The ‘test’ builtin's ‘-t’ unary primary requires an argument. + 66. The ‘test’ builtin's ‘-t’ unary primary requires an argument. Historical versions of ‘test’ made the argument optional in certain cases, and Bash attempts to accommodate those for backwards compatibility. - 74. Command substitutions don't set the ‘?’ special parameter. The - exit status of a simple command without a command word is still the - exit status of the last command substitution that occurred while - evaluating the variable assignments and redirections in that - command, but that does not happen until after all of the - assignments and redirections. + 67. The ‘trap’ builtin displays signal names without the leading + ‘SIG’. + + 68. The ‘trap’ builtin doesn't check the first argument for a possible + signal specification and revert the signal handling to the original + disposition if it is, unless that argument consists solely of + digits and is a valid signal number. If users want to reset the + handler for a given signal to the original disposition, they should + use ‘-’ as the first argument. + + 69. ‘trap -p’ without arguments displays signals whose dispositions + are set to SIG_DFL and those that were ignored when the shell + started, not just trapped signals. + + 70. The ‘type’ and ‘command’ builtins will not report a non-executable + file as having been found, though the shell will attempt to execute + such a file if it is the only so-named file found in ‘$PATH’. + + 71. The ‘ulimit’ builtin uses a block size of 512 bytes for the ‘-c’ + and ‘-f’ options. + + 72. The ‘unset’ builtin with the ‘-v’ option specified returns a fatal + error if it attempts to unset a ‘readonly’ or ‘non-unsettable’ + variable, which causes a non-interactive shell to exit. + + 73. When asked to unset a variable that appears in an assignment + statement preceding the command, the ‘unset’ builtin attempts to + unset a variable of the same name in the current or previous scope + as well. This implements the required "if an assigned variable is + further modified by the utility, the modifications made by the + utility shall persist" behavior. + + 74. The arrival of ‘SIGCHLD’ when a trap is set on ‘SIGCHLD’ does not + interrupt the ‘wait’ builtin and cause it to return immediately. + The trap command is run once for each child that exits. + + 75. Bash removes an exited background process's status from the list + of such statuses after the ‘wait’ builtin is used to obtain it. There is other POSIX behavior that Bash does not implement by default even when in POSIX mode. Specifically: @@ -365,11 +366,7 @@ even when in POSIX mode. Specifically: entries if ‘FCEDIT’ is unset, rather than defaulting directly to ‘ed’. ‘fc’ uses ‘ed’ if ‘EDITOR’ is unset. - 2. A non-interactive shell does not exit if a variable assignment - preceding the ‘command’ builtin or another non-special builtin - fails. - - 3. As noted above, Bash requires the ‘xpg_echo’ option to be enabled + 2. As noted above, Bash requires the ‘xpg_echo’ option to be enabled for the ‘echo’ builtin to be fully conformant. Bash can be configured to be POSIX-conformant by default, by specifying diff --git a/doc/bash.0 b/doc/bash.0 index c9102921..a786994c 100644 --- a/doc/bash.0 +++ b/doc/bash.0 @@ -77,7 +77,7 @@ OOPPTTIIOONNSS of the eexxttddeebbuugg option to the sshhoopptt builtin below). ----dduummpp--ppoo--ssttrriinnggss - Equivalent to --DD, but the output is in the GNU _g_e_t_t_e_x_t ppoo + Equivalent to --DD, but the output is in the GNU _g_e_t_t_e_x_t "po" (portable object) file format. ----dduummpp--ssttrriinnggss @@ -114,7 +114,7 @@ OOPPTTIIOONNSS Change the behavior of bbaasshh where the default operation differs from the POSIX standard to match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO below for a reference to a document that details how - posix mode affects bash's behavior. + posix mode affects BBaasshh's behavior. ----rreessttrriicctteedd The shell becomes restricted (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). @@ -187,17 +187,17 @@ IINNVVOOCCAATTIIOONN forming to the POSIX standard as well. When invoked as an interactive login shell, or a non-interactive shell with the ----llooggiinn option, it first attempts to read and execute commands from _/_e_t_c_/_p_r_o_f_i_l_e and - _~_/_._p_r_o_f_i_l_e, in that order. The ----nnoopprrooffiillee option may be used to in- - hibit this behavior. When invoked as an interactive shell with the - name sshh, bbaasshh looks for the variable EENNVV, expands its value if it is - defined, and uses the expanded value as the name of a file to read and - execute. Since a shell invoked as sshh does not attempt to read and exe- - cute commands from any other startup files, the ----rrccffiillee option has no - effect. A non-interactive shell invoked with the name sshh does not at- - tempt to read any other startup files. When invoked as sshh, bbaasshh enters - _p_o_s_i_x mode after the startup files are read. - - When bbaasshh is started in _p_o_s_i_x mode, as with the ----ppoossiixx command line + _~_/_._p_r_o_f_i_l_e, in that order. The ----nnoopprrooffiillee option will inhibit this + behavior. When invoked as an interactive shell with the name sshh, bbaasshh + looks for the variable EENNVV, expands its value if it is defined, and + uses the expanded value as the name of a file to read and execute. + Since a shell invoked as sshh does not attempt to read and execute com- + mands from any other startup files, the ----rrccffiillee option has no effect. + A non-interactive shell invoked with the name sshh does not attempt to + read any other startup files. When invoked as sshh, bbaasshh enters posix + mode after reading the startup files. + + When bbaasshh is started in posix mode, as with the ----ppoossiixx command line option, it follows the POSIX standard for startup files. In this mode, interactive shells expand the EENNVV variable and read and execute com- mands from the file whose name is the expanded value. No other startup @@ -209,30 +209,30 @@ IINNVVOOCCAATTIIOONN daemon _s_s_h_d. If bbaasshh determines it is being run non-interactively in this fashion, it reads and executes commands from _~_/_._b_a_s_h_r_c, if that file exists and is readable. It will not do this if invoked as sshh. - The ----nnoorrcc option may be used to inhibit this behavior, and the ----rrcc-- - ffiillee option will make bbaasshh use a different file instead of _~_/_._b_a_s_h_r_c, - but neither _r_s_h_d nor _s_s_h_d generally invoke the shell with those options - or allow them to be specified. + The ----nnoorrcc option will inhibit this behavior, and the ----rrccffiillee option + will make bbaasshh use a different file instead of _~_/_._b_a_s_h_r_c, but neither + _r_s_h_d nor _s_s_h_d generally invoke the shell with those options or allow + them to be specified. If the shell is started with the effective user (group) id not equal to the real user (group) id, and the --pp option is not supplied, no startup files are read, shell functions are not inherited from the environment, - the SSHHEELLLLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- - pear in the environment, are ignored, and the effective user id is set - to the real user id. If the --pp option is supplied at invocation, the + the SSHHEELLLLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- + pear in the environment, are ignored, and the effective user id is set + to the real user id. If the --pp option is supplied at invocation, the startup behavior is the same, but the effective user id is not reset. DDEEFFIINNIITTIIOONNSS - The following definitions are used throughout the rest of this docu- + The following definitions are used throughout the rest of this docu- ment. bbllaannkk A space or tab. - wwoorrdd A sequence of characters considered as a single unit by the + wwoorrdd A sequence of characters considered as a single unit by the shell. Also known as a ttookkeenn. - nnaammee A _w_o_r_d consisting only of alphanumeric characters and under- - scores, and beginning with an alphabetic character or an under- + nnaammee A _w_o_r_d consisting only of alphanumeric characters and under- + scores, and beginning with an alphabetic character or an under- score. Also referred to as an iiddeennttiiffiieerr. mmeettaacchhaarraacctteerr - A character that, when unquoted, separates words. One of the + A character that, when unquoted, separates words. One of the following: || && ;; (( )) << >> ssppaaccee ttaabb nneewwlliinnee ccoonnttrrooll ooppeerraattoorr @@ -243,204 +243,204 @@ DDEEFFIINNIITTIIOONNSS RREESSEERRVVEEDD WWOORRDDSS _R_e_s_e_r_v_e_d _w_o_r_d_s are words that have a special meaning to the shell. The following words are recognized as reserved when unquoted and either the - first word of a command (see SSHHEELLLL GGRRAAMMMMAARR below), the third word of a - ccaassee or sseelleecctt command (only iinn is valid), or the third word of a ffoorr + first word of a command (see SSHHEELLLL GGRRAAMMMMAARR below), the third word of a + ccaassee or sseelleecctt command (only iinn is valid), or the third word of a ffoorr command (only iinn and ddoo are valid): - !! ccaassee ccoopprroocc ddoo ddoonnee eelliiff eellssee eessaacc ffii ffoorr ffuunnccttiioonn iiff iinn sseelleecctt + !! ccaassee ccoopprroocc ddoo ddoonnee eelliiff eellssee eessaacc ffii ffoorr ffuunnccttiioonn iiff iinn sseelleecctt tthheenn uunnttiill wwhhiillee {{ }} ttiimmee [[[[ ]]]] SSHHEELLLL GGRRAAMMMMAARR - This section describes the syntax of the various forms of shell com- + This section describes the syntax of the various forms of shell com- mands. SSiimmppllee CCoommmmaannddss - A _s_i_m_p_l_e _c_o_m_m_a_n_d is a sequence of optional variable assignments fol- - lowed by bbllaannkk-separated words and redirections, and terminated by a + A _s_i_m_p_l_e _c_o_m_m_a_n_d is a sequence of optional variable assignments fol- + lowed by bbllaannkk-separated words and redirections, and terminated by a _c_o_n_t_r_o_l _o_p_e_r_a_t_o_r. The first word specifies the command to be executed, - and is passed as argument zero. The remaining words are passed as ar- + and is passed as argument zero. The remaining words are passed as ar- guments to the invoked command. - The return value of a _s_i_m_p_l_e _c_o_m_m_a_n_d is its exit status, or 128+_n if + The return value of a _s_i_m_p_l_e _c_o_m_m_a_n_d is its exit status, or 128+_n if the command is terminated by signal _n. PPiippeelliinneess - A _p_i_p_e_l_i_n_e is a sequence of one or more commands separated by one of + A _p_i_p_e_l_i_n_e is a sequence of one or more commands separated by one of the control operators || or ||&&. The format for a pipeline is: [ttiimmee [--pp]] [ ! ] _c_o_m_m_a_n_d_1 [ [|||||&&] _c_o_m_m_a_n_d_2 ... ] The standard output of _c_o_m_m_a_n_d_1 is connected via a pipe to the standard - input of _c_o_m_m_a_n_d_2. This connection is performed before any redirec- - tions specified by the _c_o_m_m_a_n_d_1(see RREEDDIIRREECCTTIIOONN below). If ||&& is the - pipeline operator, _c_o_m_m_a_n_d_1's standard error, in addition to its stan- - dard output, is connected to _c_o_m_m_a_n_d_2's standard input through the - pipe; it is shorthand for 22>>&&11 ||. This implicit redirection of the - standard error to the standard output is performed after any redirec- + input of _c_o_m_m_a_n_d_2. This connection is performed before any redirec- + tions specified by the _c_o_m_m_a_n_d_1(see RREEDDIIRREECCTTIIOONN below). If ||&& is the + pipeline operator, _c_o_m_m_a_n_d_1's standard error, in addition to its stan- + dard output, is connected to _c_o_m_m_a_n_d_2's standard input through the + pipe; it is shorthand for 22>>&&11 ||. This implicit redirection of the + standard error to the standard output is performed after any redirec- tions specified by _c_o_m_m_a_n_d_1. The return status of a pipeline is the exit status of the last command, - unless the ppiippeeffaaiill option is enabled. If ppiippeeffaaiill is enabled, the - pipeline's return status is the value of the last (rightmost) command - to exit with a non-zero status, or zero if all commands exit success- + unless the ppiippeeffaaiill option is enabled. If ppiippeeffaaiill is enabled, the + pipeline's return status is the value of the last (rightmost) command + to exit with a non-zero status, or zero if all commands exit success- fully. If the reserved word !! precedes a pipeline, the exit status of - that pipeline is the logical negation of the exit status as described - above. If a pipeline is executed synchronously, the shell waits for + that pipeline is the logical negation of the exit status as described + above. If a pipeline is executed synchronously, the shell waits for all commands in the pipeline to terminate before returning a value. - If the ttiimmee reserved word precedes a pipeline, the shell reports the - elapsed as well as user and system time consumed by its execution when - the pipeline terminates. The --pp option changes the output format to - that specified by POSIX. When the shell is in _p_o_s_i_x _m_o_d_e, it does not - recognize ttiimmee as a reserved word if the next token begins with a "-". - The value of the TTIIMMEEFFOORRMMAATT variable is a format string that specifies - how the timing information should be displayed; see the description of + If the ttiimmee reserved word precedes a pipeline, the shell reports the + elapsed as well as user and system time consumed by its execution when + the pipeline terminates. The --pp option changes the output format to + that specified by POSIX. When the shell is in posix mode, it does not + recognize ttiimmee as a reserved word if the next token begins with a "-". + The value of the TTIIMMEEFFOORRMMAATT variable is a format string that specifies + how the timing information should be displayed; see the description of TTIIMMEEFFOORRMMAATT below under SShheellll VVaarriiaabblleess. - When the shell is in _p_o_s_i_x _m_o_d_e, ttiimmee may appear by itself as the only - word in a simple command. In this case, the shell displays the total + When the shell is in posix mode, ttiimmee may appear by itself as the only + word in a simple command. In this case, the shell displays the total user and system time consumed by the shell and its children. The TTIIMMEE-- FFOORRMMAATT variable specifies the format of the time information. - Each command in a multi-command pipeline, where pipes are created, is - executed in a _s_u_b_s_h_e_l_l, which is a separate process. See CCOOMMMMAANNDD EEXXEE-- - CCUUTTIIOONN EENNVVIIRROONNMMEENNTT for a description of subshells and a subshell envi- - ronment. If the llaassttppiippee option is enabled using the sshhoopptt builtin - (see the description of sshhoopptt below), and job control is not active, + Each command in a multi-command pipeline, where pipes are created, is + executed in a _s_u_b_s_h_e_l_l, which is a separate process. See CCOOMMMMAANNDD EEXXEE-- + CCUUTTIIOONN EENNVVIIRROONNMMEENNTT for a description of subshells and a subshell envi- + ronment. If the llaassttppiippee option is enabled using the sshhoopptt builtin + (see the description of sshhoopptt below), and job control is not active, the last element of a pipeline may be run by the shell process. LLiissttss - A _l_i_s_t is a sequence of one or more pipelines separated by one of the + A _l_i_s_t is a sequence of one or more pipelines separated by one of the operators ;;, &&, &&&&, or ||||, and optionally terminated by one of ;;, &&, or <>. Of these list operators, &&&& and |||| have equal precedence, followed by ;; and &&, which have equal precedence. - A sequence of one or more newlines may appear in a _l_i_s_t instead of a + A sequence of one or more newlines may appear in a _l_i_s_t instead of a semicolon to delimit commands. - If a command is terminated by the control operator &&, the shell exe- - cutes the command in the _b_a_c_k_g_r_o_u_n_d in a subshell. The shell does not - wait for the command to finish, and the return status is 0. These are - referred to as _a_s_y_n_c_h_r_o_n_o_u_s commands. Commands separated by a ;; are + If a command is terminated by the control operator &&, the shell exe- + cutes the command in the _b_a_c_k_g_r_o_u_n_d in a subshell. The shell does not + wait for the command to finish, and the return status is 0. These are + referred to as _a_s_y_n_c_h_r_o_n_o_u_s commands. Commands separated by a ;; are executed sequentially; the shell waits for each command to terminate in - turn. The return status is the exit status of the last command exe- + turn. The return status is the exit status of the last command exe- cuted. - AND and OR lists are sequences of one or more pipelines separated by - the &&&& and |||| control operators, respectively. AND and OR lists are + AND and OR lists are sequences of one or more pipelines separated by + the &&&& and |||| control operators, respectively. AND and OR lists are executed with left associativity. An AND list has the form _c_o_m_m_a_n_d_1 &&&& _c_o_m_m_a_n_d_2 - _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns an exit status + _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns an exit status of zero (success). An OR list has the form _c_o_m_m_a_n_d_1 |||| _c_o_m_m_a_n_d_2 - _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns a non-zero exit - status. The return status of AND and OR lists is the exit status of + _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns a non-zero exit + status. The return status of AND and OR lists is the exit status of the last command executed in the list. CCoommppoouunndd CCoommmmaannddss - A _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d is one of the following. In most cases a _l_i_s_t in a - command's description may be separated from the rest of the command by - one or more newlines, and may be followed by a newline in place of a + A _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d is one of the following. In most cases a _l_i_s_t in a + command's description may be separated from the rest of the command by + one or more newlines, and may be followed by a newline in place of a semicolon. - (_l_i_s_t) _l_i_s_t is executed in a subshell (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONN-- - MMEENNTT below for a description of a subshell environment). Vari- - able assignments and builtin commands that affect the shell's + (_l_i_s_t) _l_i_s_t is executed in a subshell (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONN-- + MMEENNTT below for a description of a subshell environment). Vari- + able assignments and builtin commands that affect the shell's environment do not remain in effect after the command completes. The return status is the exit status of _l_i_s_t. { _l_i_s_t; } _l_i_s_t is executed in the current shell environment. _l_i_s_t must be - terminated with a newline or semicolon. This is known as a + terminated with a newline or semicolon. This is known as a _g_r_o_u_p _c_o_m_m_a_n_d. The return status is the exit status of _l_i_s_t. - Note that unlike the metacharacters (( and )), {{ and }} are _r_e_- - _s_e_r_v_e_d _w_o_r_d_s and must occur where a reserved word is permitted - to be recognized. Since they do not cause a word break, they - must be separated from _l_i_s_t by whitespace or another shell + Note that unlike the metacharacters (( and )), {{ and }} are _r_e_- + _s_e_r_v_e_d _w_o_r_d_s and must occur where a reserved word is permitted + to be recognized. Since they do not cause a word break, they + must be separated from _l_i_s_t by whitespace or another shell metacharacter. ((_e_x_p_r_e_s_s_i_o_n)) - The arithmetic _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules - described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of - the expression is non-zero, the return status is 0; otherwise - the return status is 1. The _e_x_p_r_e_s_s_i_o_n undergoes the same ex- - pansions as if it were within double quotes, but double quote - characters in _e_x_p_r_e_s_s_i_o_n are not treated specially and are re- + The arithmetic _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules + described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of + the expression is non-zero, the return status is 0; otherwise + the return status is 1. The _e_x_p_r_e_s_s_i_o_n undergoes the same ex- + pansions as if it were within double quotes, but double quote + characters in _e_x_p_r_e_s_s_i_o_n are not treated specially and are re- moved. [[[[ _e_x_p_r_e_s_s_i_o_n ]]]] Evaluate the conditional expression _e_x_p_r_e_s_s_i_o_n and return a sta- - tus of zero (true) or non-zero (false). Expressions are com- + tus of zero (true) or non-zero (false). Expressions are com- posed of the primaries described below under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- - SSIIOONNSS. The words between the [[[[ and ]]]] do not undergo word - splitting and pathname expansion. The shell performs tilde ex- + SSIIOONNSS. The words between the [[[[ and ]]]] do not undergo word + splitting and pathname expansion. The shell performs tilde ex- pansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal on - those words. Conditional operators such as --ff must be unquoted + those words. Conditional operators such as --ff must be unquoted to be recognized as primaries. - When used with [[[[, the << and >> operators sort lexicographically + When used with [[[[, the << and >> operators sort lexicographically using the current locale. - When the ==== and !!== operators are used, the string to the right + When the ==== and !!== operators are used, the string to the right of the operator is considered a pattern and matched according to the rules described below under PPaatttteerrnn MMaattcchhiinngg, as if the eexxtt-- gglloobb shell option were enabled. The == operator is equivalent to - ====. If the nnooccaasseemmaattcchh shell option is enabled, the match is - performed without regard to the case of alphabetic characters. - The return value is 0 if the string matches (====) or does not - match (!!==) the pattern, and 1 otherwise. If any part of the - pattern is quoted, the quoted portion is matched as a string: + ====. If the nnooccaasseemmaattcchh shell option is enabled, the match is + performed without regard to the case of alphabetic characters. + The return value is 0 if the string matches (====) or does not + match (!!==) the pattern, and 1 otherwise. If any part of the + pattern is quoted, the quoted portion is matched as a string: every character in the quoted portion matches itself, instead of having any special pattern matching meaning. - An additional binary operator, ==~~, is available, with the same - precedence as ==== and !!==. When it is used, the string to the + An additional binary operator, ==~~, 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 ex- - pression and matched accordingly (using the POSIX _r_e_g_c_o_m_p and - _r_e_g_e_x_e_c interfaces usually described in _r_e_g_e_x(3)). The return - value is 0 if the string matches the pattern, and 1 otherwise. + pression and matched accordingly (using the POSIX _r_e_g_c_o_m_p and + _r_e_g_e_x_e_c interfaces usually described in _r_e_g_e_x(3)). The return + value is 0 if the string matches the pattern, and 1 otherwise. If the regular expression is syntactically incorrect, the condi- tional expression's return value is 2. If the nnooccaasseemmaattcchh shell - option is enabled, the match is performed without regard to the + option is enabled, the match is performed without regard to the case of alphabetic characters. - If any part of the pattern is quoted, the quoted portion is - matched literally, as above. If the pattern is stored in a + If any part of the pattern is quoted, the quoted portion is + matched literally, as above. If the pattern is stored in a shell variable, quoting the variable expansion forces the entire - pattern to be matched literally. Treat bracket expressions in - regular expressions carefully, since normal quoting and pattern + pattern to be matched literally. Treat bracket expressions in + regular expressions carefully, since normal quoting and pattern characters lose their meanings between brackets. - The pattern will match if it matches any part of the string. - Anchor the pattern using the ^^ and $$ regular expression opera- + The pattern will match if it matches any part of the string. + Anchor the pattern using the ^^ and $$ regular expression opera- tors to force it to match the entire string. - The array variable BBAASSHH__RREEMMAATTCCHH records which parts of the - string matched the pattern. The element of BBAASSHH__RREEMMAATTCCHH with - index 0 contains the portion of the string matching the entire - regular expression. Substrings matched by parenthesized subex- + The array variable BBAASSHH__RREEMMAATTCCHH records which parts of the + string matched the pattern. The element of BBAASSHH__RREEMMAATTCCHH with + index 0 contains the portion of the string matching the entire + regular expression. Substrings matched by parenthesized subex- pressions within the regular expression are saved in the remain- - ing BBAASSHH__RREEMMAATTCCHH indices. The element of BBAASSHH__RREEMMAATTCCHH with in- - dex _n is the portion of the string matching the _nth parenthe- - sized subexpression. BBaasshh sets BBAASSHH__RREEMMAATTCCHH in the global - scope; declaring it as a local variable will lead to unexpected + ing BBAASSHH__RREEMMAATTCCHH indices. The element of BBAASSHH__RREEMMAATTCCHH with in- + dex _n is the portion of the string matching the _nth parenthe- + sized subexpression. BBaasshh sets BBAASSHH__RREEMMAATTCCHH in the global + scope; declaring it as a local variable will lead to unexpected results. - Expressions may be combined using the following operators, + Expressions may be combined using the following operators, listed in decreasing order of precedence: (( _e_x_p_r_e_s_s_i_o_n )) - Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to + Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to override the normal precedence of operators. !! _e_x_p_r_e_s_s_i_o_n True if _e_x_p_r_e_s_s_i_o_n is false. @@ -450,72 +450,72 @@ SSHHEELLLL GGRRAAMMMMAARR True if either _e_x_p_r_e_s_s_i_o_n_1 or _e_x_p_r_e_s_s_i_o_n_2 is true. The &&&& and |||| operators do not evaluate _e_x_p_r_e_s_s_i_o_n_2 if the value - of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of + of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of the entire conditional expression. ffoorr _n_a_m_e [ [ iinn [ _w_o_r_d _._._. ] ] ; ] ddoo _l_i_s_t ; ddoonnee - First, expand The list of words following iinn, generating a list - of items. Then, the variable _n_a_m_e is set to each element of - this list in turn, and _l_i_s_t is executed each time. If the iinn + First, expand The list of words following iinn, generating a list + of items. Then, the variable _n_a_m_e is set to each element of + this list in turn, and _l_i_s_t is executed each time. If the iinn _w_o_r_d is omitted, the ffoorr command executes _l_i_s_t once for each po- - sitional parameter that is set (see PPAARRAAMMEETTEERRSS below). The re- - turn status is the exit status of the last command that exe- + sitional parameter that is set (see PPAARRAAMMEETTEERRSS below). The re- + turn status is the exit status of the last command that exe- cutes. If the expansion of the items following iinn results in an - empty list, no commands are executed, and the return status is + empty list, no commands are executed, and the return status is 0. ffoorr (( _e_x_p_r_1 ; _e_x_p_r_2 ; _e_x_p_r_3 )) ; ddoo _l_i_s_t ; ddoonnee First, evaluate the arithmetic expression _e_x_p_r_1 according to the - rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. Then, re- + rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. Then, re- peatedly evaluate the arithmetic expression _e_x_p_r_2 until it eval- - uates to zero. Each time _e_x_p_r_2 evaluates to a non-zero value, - execute _l_i_s_t and evaluate the arithmetic expression _e_x_p_r_3. If - any expression is omitted, it behaves as if it evaluates to 1. - The return value is the exit status of the last command in _l_i_s_t - that is executed, or non-zero if any of the expressions is in- + uates to zero. Each time _e_x_p_r_2 evaluates to a non-zero value, + execute _l_i_s_t and evaluate the arithmetic expression _e_x_p_r_3. If + any expression is omitted, it behaves as if it evaluates to 1. + The return value is the exit status of the last command in _l_i_s_t + that is executed, or non-zero if any of the expressions is in- valid. - Use the bbrreeaakk and ccoonnttiinnuuee builtins (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS + Use the bbrreeaakk and ccoonnttiinnuuee builtins (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) to control loop execution. sseelleecctt _n_a_m_e [ iinn _w_o_r_d ] ; ddoo _l_i_s_t ; ddoonnee - First, expand the list of words following iinn, generating a list - of items, and print the set of expanded words the standard er- - ror, each preceded by a number. If the iinn _w_o_r_d is omitted, - print the positional parameters (see PPAARRAAMMEETTEERRSS below). sseelleecctt - then displays the PPSS33 prompt and reads a line from the standard + First, expand the list of words following iinn, generating a list + of items, and print the set of expanded words the standard er- + ror, each preceded by a number. If the iinn _w_o_r_d is omitted, + print the positional parameters (see PPAARRAAMMEETTEERRSS below). sseelleecctt + then displays the PPSS33 prompt and reads a line from the standard input. If the line consists of a number corresponding to one of - the displayed words, then sseelleecctt sets the value of _n_a_m_e to that - word. If the line is empty, sseelleecctt displays the words and - prompt again. If EOF is read, sseelleecctt completes and returns 1. - Any other value sets _n_a_m_e to null. The line read is saved in - the variable RREEPPLLYY. The _l_i_s_t is executed after each selection + the displayed words, then sseelleecctt sets the value of _n_a_m_e to that + word. If the line is empty, sseelleecctt displays the words and + prompt again. If EOF is read, sseelleecctt completes and returns 1. + Any other value sets _n_a_m_e to null. The line read is saved in + the variable RREEPPLLYY. The _l_i_s_t is executed after each selection until a bbrreeaakk command is executed. The exit status of sseelleecctt is the exit status of the last command executed in _l_i_s_t, or zero if no commands were executed. ccaassee _w_o_r_d iinn [ [(] _p_a_t_t_e_r_n [ || _p_a_t_t_e_r_n ] ... ) _l_i_s_t ;; ] ... eessaacc A ccaassee command first expands _w_o_r_d, and tries to match it against - each _p_a_t_t_e_r_n in turn, proceeding from first to last, using the - matching rules described under PPaatttteerrnn MMaattcchhiinngg below. A pat- - tern list is a set of one or more patterns separated by , and - the ) operator terminates the pattern list. The _w_o_r_d is ex- - panded using tilde expansion, parameter and variable expansion, + each _p_a_t_t_e_r_n in turn, proceeding from first to last, using the + matching rules described under PPaatttteerrnn MMaattcchhiinngg below. A pat- + tern list is a set of one or more patterns separated by , and + the ) operator terminates the pattern list. The _w_o_r_d is ex- + panded using tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution - and quote removal. Each _p_a_t_t_e_r_n examined is expanded using - tilde expansion, parameter and variable expansion, arithmetic + and quote removal. Each _p_a_t_t_e_r_n examined is expanded using + tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote - removal. If the nnooccaasseemmaattcchh shell option is enabled, the match - is performed without regard to the case of alphabetic charac- + removal. If the nnooccaasseemmaattcchh shell option is enabled, the match + is performed without regard to the case of alphabetic charac- ters. A _c_l_a_u_s_e is a pattern list and an associated _l_i_s_t. When a match is found, ccaassee executes the corresponding _l_i_s_t. If - the ;;;; operator terminates the case clause, the ccaassee command + the ;;;; operator terminates the case clause, the ccaassee command completes after the first match. Using ;;&& in place of ;;;; causes - execution to continue with the _l_i_s_t associated with the next + execution to continue with the _l_i_s_t associated with the next pattern list. Using ;;;;&& in place of ;;;; causes the shell to test - the next pattern list in the statement, if any, and execute any - associated _l_i_s_t if the match succeeds. continuing the case + the next pattern list in the statement, if any, and execute any + associated _l_i_s_t if the match succeeds. continuing the case statement execution as if the pattern list had not matched. The exit status is zero if no pattern matches. @@ -523,19 +523,19 @@ SSHHEELLLL GGRRAAMMMMAARR the last _l_i_s_t executed. iiff _l_i_s_t; tthheenn _l_i_s_t; [ eelliiff _l_i_s_t; tthheenn _l_i_s_t; ] ... [ eellssee _l_i_s_t; ] ffii - The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn - _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in - turn, and if its exit status is zero, the corresponding tthheenn + The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn + _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in + turn, and if its exit status is zero, the corresponding tthheenn _l_i_s_t is executed and the command completes. Otherwise, the eellssee - _l_i_s_t is executed, if present. The exit status is the exit sta- + _l_i_s_t is executed, if present. The exit status is the exit sta- tus of the last command executed, or zero if no condition tested true. wwhhiillee _l_i_s_t_-_1; ddoo _l_i_s_t_-_2; ddoonnee uunnttiill _l_i_s_t_-_1; ddoo _l_i_s_t_-_2; ddoonnee - The wwhhiillee command continuously executes the list _l_i_s_t_-_2 as long + The wwhhiillee command continuously executes the list _l_i_s_t_-_2 as long as the last command in the list _l_i_s_t_-_1 returns an exit status of - zero. The uunnttiill command is identical to the wwhhiillee command, ex- + zero. The uunnttiill command is identical to the wwhhiillee command, ex- cept that the test is negated: _l_i_s_t_-_2 is executed as long as the last command in _l_i_s_t_-_1 returns a non-zero exit status. The exit status of the wwhhiillee and uunnttiill commands is the exit status of the @@ -543,143 +543,143 @@ SSHHEELLLL GGRRAAMMMMAARR CCoopprroocceesssseess A _c_o_p_r_o_c_e_s_s is a shell command preceded by the ccoopprroocc reserved word. A - coprocess is executed asynchronously in a subshell, as if the command - had been terminated with the && control operator, with a two-way pipe + coprocess is executed asynchronously in a subshell, as if the command + had been terminated with the && control operator, with a two-way pipe established between the executing shell and the coprocess. The syntax for a coprocess is: ccoopprroocc [_N_A_M_E] _c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n_s] - This creates a coprocess named _N_A_M_E. _c_o_m_m_a_n_d may be either a simple - command or a compound command (see above). _N_A_M_E is a shell variable + This creates a coprocess named _N_A_M_E. _c_o_m_m_a_n_d may be either a simple + command or a compound command (see above). _N_A_M_E is a shell variable name. If _N_A_M_E is not supplied, the default name is CCOOPPRROOCC. The recommended form to use for a coprocess is ccoopprroocc _N_A_M_E { _c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n_s]; } - This form is preferred because simple commands result in the coprocess - always being named CCOOPPRROOCC, and it is simpler to use and more complete + This form is preferred because simple commands result in the coprocess + always being named CCOOPPRROOCC, and it is simpler to use and more complete than the other compound commands. - If _c_o_m_m_a_n_d is a compound command, _N_A_M_E is optional. The word following - ccoopprroocc determines whether that word is interpreted as a variable name: - it is interpreted as _N_A_M_E if it is not a reserved word that introduces - a compound command. If _c_o_m_m_a_n_d is a simple command, _N_A_M_E is not al- - lowed; this is to avoid confusion between _N_A_M_E and the first word of + If _c_o_m_m_a_n_d is a compound command, _N_A_M_E is optional. The word following + ccoopprroocc determines whether that word is interpreted as a variable name: + it is interpreted as _N_A_M_E if it is not a reserved word that introduces + a compound command. If _c_o_m_m_a_n_d is a simple command, _N_A_M_E is not al- + lowed; this is to avoid confusion between _N_A_M_E and the first word of the simple command. - When the coprocess is executed, the shell creates an array variable - (see AArrrraayyss below) named _N_A_M_E in the context of the executing shell. - The standard output of _c_o_m_m_a_n_d is connected via a pipe to a file de- - scriptor in the executing shell, and that file descriptor is assigned + When the coprocess is executed, the shell creates an array variable + (see AArrrraayyss below) named _N_A_M_E in the context of the executing shell. + The standard output of _c_o_m_m_a_n_d is connected via a pipe to a file de- + scriptor in the executing shell, and that file descriptor is assigned to _N_A_M_E[0]. The standard input of _c_o_m_m_a_n_d is connected via a pipe to a file descriptor in the executing shell, and that file descriptor is as- - signed to _N_A_M_E[1]. This pipe is established before any redirections + signed to _N_A_M_E[1]. This pipe is established before any redirections specified by the command (see RREEDDIIRREECCTTIIOONN below). The file descriptors - can be utilized as arguments to shell commands and redirections using - standard word expansions. Other than those created to execute command - and process substitutions, the file descriptors are not available in + can be utilized as arguments to shell commands and redirections using + standard word expansions. Other than those created to execute command + and process substitutions, the file descriptors are not available in subshells. - The process ID of the shell spawned to execute the coprocess is avail- - able as the value of the variable _N_A_M_E_PID. The wwaaiitt builtin may be + The process ID of the shell spawned to execute the coprocess is avail- + able as the value of the variable _N_A_M_E_PID. The wwaaiitt builtin may be used to wait for the coprocess to terminate. - Since the coprocess is created as an asynchronous command, the ccoopprroocc - command always returns success. The return status of a coprocess is + Since the coprocess is created as an asynchronous command, the ccoopprroocc + command always returns success. The return status of a coprocess is the exit status of _c_o_m_m_a_n_d. SShheellll FFuunnccttiioonn DDeeffiinniittiioonnss - A shell function is an object that is called like a simple command and - executes a compound command with a new set of positional parameters. + A shell function is an object that is called like a simple command and + executes a compound command with a new set of positional parameters. Shell functions are declared as follows: _f_n_a_m_e () _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] ffuunnccttiioonn _f_n_a_m_e [()] _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] This defines a function named _f_n_a_m_e. The reserved word ffuunnccttiioonn - is optional. If the ffuunnccttiioonn reserved word is supplied, the - parentheses are optional. The _b_o_d_y of the function is the com- - pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). - That command is usually a _l_i_s_t of commands between { and }, but + is optional. If the ffuunnccttiioonn reserved word is supplied, the + parentheses are optional. The _b_o_d_y of the function is the com- + pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). + That command is usually a _l_i_s_t of commands between { and }, but may be any command listed under CCoommppoouunndd CCoommmmaannddss above. If the ffuunnccttiioonn reserved word is used, but the parentheses are not sup- plied, the braces are recommended. _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d is executed - whenever _f_n_a_m_e is specified as the name of a simple command. - When in _p_o_s_i_x _m_o_d_e, _f_n_a_m_e must be a valid shell _n_a_m_e and may not - be the name of one of the POSIX _s_p_e_c_i_a_l _b_u_i_l_t_i_n_s. In default - mode, a function name can be any unquoted shell word that does + whenever _f_n_a_m_e is specified as the name of a simple command. + When in posix mode, _f_n_a_m_e must be a valid shell _n_a_m_e and may not + be the name of one of the POSIX _s_p_e_c_i_a_l _b_u_i_l_t_i_n_s. In default + mode, a function name can be any unquoted shell word that does not contain $$. - Any redirections (see RREEDDIIRREECCTTIIOONN below) specified when a function is + Any redirections (see RREEDDIIRREECCTTIIOONN below) specified when a function is defined are performed when the function is executed. - The exit status of a function definition is zero unless a syntax error - occurs or a readonly function with the same name already exists. When - executed, the exit status of a function is the exit status of the last + The exit status of a function definition is zero unless a syntax error + occurs or a readonly function with the same name already exists. When + executed, the exit status of a function is the exit status of the last command executed in the body. (See FFUUNNCCTTIIOONNSS below.) CCOOMMMMEENNTTSS In a non-interactive shell, or an interactive shell in which the iinntteerr-- - aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL - BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## introduces a comment. + aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## introduces a comment. A word begins at the beginning of a line, after unquoted whitespace, or - after an operator. The comment causes that word and all remaining - characters on that line to be ignored. An interactive shell without - the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow comments. The + after an operator. The comment causes that word and all remaining + characters on that line to be ignored. An interactive shell without + the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow comments. The iinntteerraaccttiivvee__ccoommmmeennttss option is enabled by default in interactive shells. QQUUOOTTIINNGG - _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or - words to the shell. Quoting can be used to disable special treatment + _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or + words to the shell. Quoting can be used to disable special treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion. - Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS has special + Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS has special meaning to the shell and must be quoted if it is to represent itself. - When the command history expansion facilities are being used (see HHIISS-- + When the command history expansion facilities are being used (see HHIISS-- TTOORRYY EEXXPPAANNSSIIOONN below), the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, usually !!, must be quoted to prevent history expansion. There are four quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single quotes, double quotes, and dollar-single quotes. - A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the - literal value of the next character that follows, removing any special - meaning it has, with the exception of . If a \\ pair - appears, and the backslash is not itself quoted, the \\ is - treated as a line continuation (that is, it is removed from the input + A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the + literal value of the next character that follows, removing any special + meaning it has, with the exception of . If a \\ pair + appears, and the backslash is not itself quoted, the \\ is + treated as a line continuation (that is, it is removed from the input stream and effectively ignored). - Enclosing characters in single quotes preserves the literal value of + Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash. - Enclosing characters in double quotes preserves the literal value of - all characters within the quotes, with the exception of $$, ``, \\, and, - when history expansion is enabled, !!. When the shell is in _p_o_s_i_x _m_o_d_e, - the !! has no special meaning within double quotes, even when history - expansion is enabled. The characters $$ and `` retain their special - meaning within double quotes. The backslash retains its special mean- - ing only when followed by one of the following characters: $$, ``, "", \\, + Enclosing characters in double quotes preserves the literal value of + all characters within the quotes, with the exception of $$, ``, \\, and, + when history expansion is enabled, !!. When the shell is in posix mode, + the !! has no special meaning within double quotes, even when history + expansion is enabled. The characters $$ and `` retain their special + meaning within double quotes. The backslash retains its special mean- + ing only when followed by one of the following characters: $$, ``, "", \\, or <>. Backslashes preceding characters without a special mean- ing are left unmodified. - A double quote may be quoted within double quotes by preceding it with + A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion will be performed unless an - !! appearing in double quotes is escaped using a backslash. The back- + !! appearing in double quotes is escaped using a backslash. The back- slash preceding the !! is not removed. - The special parameters ** and @@ have special meaning when in double + The special parameters ** and @@ have special meaning when in double quotes (see PPAARRAAMMEETTEERRSS below). - Character sequences of the form $$'_s_t_r_i_n_g' are treated as a special - variant of single quotes. The sequence expands to _s_t_r_i_n_g, with back- - slash-escaped characters in _s_t_r_i_n_g replaced as specified by the ANSI C - standard. Backslash escape sequences, if present, are decoded as fol- + Character sequences of the form $$'_s_t_r_i_n_g' are treated as a special + variant of single quotes. The sequence expands to _s_t_r_i_n_g, with back- + slash-escaped characters in _s_t_r_i_n_g replaced as specified by the ANSI C + standard. Backslash escape sequences, if present, are decoded as fol- lows: \\aa alert (bell) \\bb backspace @@ -694,88 +694,88 @@ QQUUOOTTIINNGG \\'' single quote \\"" double quote \\?? question mark - \\_n_n_n The eight-bit character whose value is the octal value + \\_n_n_n The eight-bit character whose value is the octal value _n_n_n (one to three octal digits). - \\xx_H_H The eight-bit character whose value is the hexadecimal + \\xx_H_H The eight-bit character whose value is the hexadecimal value _H_H (one or two hex digits). - \\uu_H_H_H_H The Unicode (ISO/IEC 10646) character whose value is the + \\uu_H_H_H_H The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H (one to four hex digits). \\UU_H_H_H_H_H_H_H_H - The Unicode (ISO/IEC 10646) character whose value is the + The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits). \\cc_x A control-_x character. - The expanded result is single-quoted, as if the dollar sign had not + The expanded result is single-quoted, as if the dollar sign had not been present. TTrraannssllaattiinngg SSttrriinnggss A double-quoted string preceded by a dollar sign ($$"_s_t_r_i_n_g") will cause - the string to be translated according to the current locale. The _g_e_t_- - _t_e_x_t infrastructure performs the lookup and translation, using the - LLCC__MMEESSSSAAGGEESS, TTEEXXTTDDOOMMAAIINNDDIIRR, and TTEEXXTTDDOOMMAAIINN shell variables. If the - current locale is CC or PPOOSSIIXX, if there are no translations available, + the string to be translated according to the current locale. The _g_e_t_- + _t_e_x_t infrastructure performs the lookup and translation, using the + LLCC__MMEESSSSAAGGEESS, TTEEXXTTDDOOMMAAIINNDDIIRR, and TTEEXXTTDDOOMMAAIINN shell variables. If the + current locale is CC or PPOOSSIIXX, if there are no translations available, or if the string is not translated, the dollar sign is ignored, and the - string is treated as double-quoted as described above. This is a form - of double quoting, so the string remains double-quoted by default, + string is treated as double-quoted as described above. This is a form + of double quoting, so the string remains double-quoted by default, whether or not it is translated and replaced. If the nnooeexxppaanndd__ttrraannssllaa-- - ttiioonn option is enabled using the sshhoopptt builtin, translated strings are - single-quoted instead of double-quoted. See the description of sshhoopptt + ttiioonn option is enabled using the sshhoopptt builtin, translated strings are + single-quoted instead of double-quoted. See the description of sshhoopptt below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS. PPAARRAAMMEETTEERRSS - A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- - ber, or one of the special characters listed below under SSppeecciiaall PPaarraa-- + A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- + ber, or one of the special characters listed below under SSppeecciiaall PPaarraa-- mmeetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a - _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the - ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). + _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the + ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). The eexxppoorrtt and rreeaaddoonnllyy builtins assign specific attributes. A parameter is set if it has been assigned a value. The null string is - a valid value. Once a variable is set, it may be unset only by using + a valid value. Once a variable is set, it may be unset only by using the uunnsseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). A _v_a_r_i_a_b_l_e may be assigned to by a statement of the form _n_a_m_e=[_v_a_l_u_e] - If _v_a_l_u_e is not given, the variable is assigned the null string. All - _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- - mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- + If _v_a_l_u_e is not given, the variable is assigned the null string. All + _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- + mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- SSIIOONN below). If the variable has its iinntteeggeerr attribute set, then _v_a_l_u_e is evaluated as an arithmetic expression even if the $$((((...)))) expansion is not used (see AArriitthhmmeettiicc EExxppaannssiioonn below). Word splitting and path- - name expansion are not performed. Assignment statements may also ap- + name expansion are not performed. Assignment statements may also ap- pear as arguments to the aalliiaass, ddeeccllaarree, ttyyppeesseett, eexxppoorrtt, rreeaaddoonnllyy, and - llooccaall builtin commands (_d_e_c_l_a_r_a_t_i_o_n commands). When in _p_o_s_i_x _m_o_d_e, - these builtins may appear in a command after one or more instances of + llooccaall builtin commands (_d_e_c_l_a_r_a_t_i_o_n commands). When in posix mode, + these builtins may appear in a command after one or more instances of the ccoommmmaanndd builtin and retain these assignment statement properties. - In the context where an assignment statement is assigning a value to a + In the context where an assignment statement is assigning a value to a shell variable or array index, the += operator will append to or add to - the variable's previous value. This includes arguments to _d_e_c_l_a_r_a_t_i_o_n + the variable's previous value. This includes arguments to _d_e_c_l_a_r_a_t_i_o_n commands such as ddeeccllaarree that accept assignment statements. When += is applied to a variable for which the iinntteeggeerr attribute has been set, the variable's current value and _v_a_l_u_e are each evaluated as arithmetic ex- - pressions, and the sum of the results is assigned as the variable's + pressions, and the sum of the results is assigned as the variable's value. The current value is usually an integer constant, but may be an expression. When += is applied to an array variable using compound as- - signment (see AArrrraayyss below), the variable's value is not unset (as it + signment (see AArrrraayyss below), the variable's value is not unset (as it is when using =), and new values are appended to the array beginning at - one greater than the array's maximum index (for indexed arrays) or - added as additional key-value pairs in an associative array. When ap- - plied to a string-valued variable, _v_a_l_u_e is expanded and appended to + one greater than the array's maximum index (for indexed arrays) or + added as additional key-value pairs in an associative array. When ap- + plied to a string-valued variable, _v_a_l_u_e is expanded and appended to the variable's value. A variable can be assigned the _n_a_m_e_r_e_f attribute using the --nn option to - the ddeeccllaarree or llooccaall builtin commands (see the descriptions of ddeeccllaarree - and llooccaall below) to create a _n_a_m_e_r_e_f, or a reference to another vari- - able. This allows variables to be manipulated indirectly. Whenever - the nameref variable is referenced, assigned to, unset, or has its at- - tributes modified (other than using or changing the _n_a_m_e_r_e_f attribute - itself), the operation is actually performed on the variable specified - by the nameref variable's value. A nameref is commonly used within + the ddeeccllaarree or llooccaall builtin commands (see the descriptions of ddeeccllaarree + and llooccaall below) to create a _n_a_m_e_r_e_f, or a reference to another vari- + able. This allows variables to be manipulated indirectly. Whenever + the nameref variable is referenced, assigned to, unset, or has its at- + tributes modified (other than using or changing the _n_a_m_e_r_e_f attribute + itself), the operation is actually performed on the variable specified + by the nameref variable's value. A nameref is commonly used within shell functions to refer to a variable whose name is passed as an argu- - ment to the function. For instance, if a variable name is passed to a + ment to the function. For instance, if a variable name is passed to a shell function as its first argument, running declare -n ref=$1 @@ -784,206 +784,206 @@ PPAARRAAMMEETTEERRSS the variable name passed as the first argument. References and assign- ments to rreeff, and changes to its attributes, are treated as references, assignments, and attribute modifications to the variable whose name was - passed as $$11. If the control variable in a ffoorr loop has the nameref - attribute, the list of words can be a list of shell variables, and a - name reference will be established for each word in the list, in turn, + passed as $$11. If the control variable in a ffoorr loop has the nameref + attribute, the list of words can be a list of shell variables, and a + name reference will be established for each word in the list, in turn, when the loop is executed. Array variables cannot be given the nnaammeerreeff - attribute. However, nameref variables can reference array variables - and subscripted array variables. Namerefs can be unset using the --nn - option to the uunnsseett builtin. Otherwise, if uunnsseett is executed with the - name of a nameref variable as an argument, the variable referenced by + attribute. However, nameref variables can reference array variables + and subscripted array variables. Namerefs can be unset using the --nn + option to the uunnsseett builtin. Otherwise, if uunnsseett is executed with the + name of a nameref variable as an argument, the variable referenced by the nameref variable will be unset. PPoossiittiioonnaall PPaarraammeetteerrss - A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, + A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, other than the single digit 0. Positional parameters are assigned from - the shell's arguments when it is invoked, and may be reassigned using - the sseett builtin command. Positional parameters may not be assigned to - with assignment statements. The positional parameters are temporarily + the shell's arguments when it is invoked, and may be reassigned using + the sseett builtin command. Positional parameters may not be assigned to + with assignment statements. The positional parameters are temporarily replaced when a shell function is executed (see FFUUNNCCTTIIOONNSS below). - When a positional parameter consisting of more than a single digit is + When a positional parameter consisting of more than a single digit is expanded, it must be enclosed in braces (see EEXXPPAANNSSIIOONN below). Without braces, a digit following $ can only refer to one of the first nine po- - sitional parameters ($$11--$$99) or the special parameter $$00 (see the next + sitional parameters ($$11--$$99) or the special parameter $$00 (see the next section). SSppeecciiaall PPaarraammeetteerrss - The shell treats several parameters specially. These parameters may + The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. Special parame- ters are denoted by one of the following characters. - ** ($$**) Expands to the positional parameters, starting from one. - When the expansion is not within double quotes, each positional - parameter expands to a separate word. In contexts where word - expansions are performed, those words are subject to further - word splitting and pathname expansion. When the expansion oc- - curs within double quotes, it expands to a single word with the - value of each parameter separated by the first character of the + ** ($$**) Expands to the positional parameters, starting from one. + When the expansion is not within double quotes, each positional + parameter expands to a separate word. In contexts where word + expansions are performed, those words are subject to further + word splitting and pathname expansion. When the expansion oc- + curs within double quotes, it expands to a single word with the + value of each parameter separated by the first character of the IIFFSS variable. That is, ""$$**"" is equivalent to ""$$11_c$$22_c......"", where - _c is the first character of the value of the IIFFSS variable. If + _c is the first character of the value of the IIFFSS variable. If IIFFSS is unset, the parameters are separated by spaces. If IIFFSS is null, the parameters are joined without intervening separators. - @@ ($$@@) Expands to the positional parameters, starting from one. + @@ ($$@@) Expands to the positional parameters, starting from one. In contexts where word splitting is performed, this expands each - positional parameter to a separate word; if not within double - quotes, these words are subject to word splitting. In contexts + positional parameter to a separate word; if not within double + quotes, these words are subject to word splitting. In contexts where word splitting is not performed, such as the value portion - of an assignment statement, this expands to a single word with + of an assignment statement, this expands to a single word with each positional parameter separated by a space. When the expan- - sion occurs within double quotes, and word splitting is per- - formed, each parameter expands to a separate word. That is, + sion occurs within double quotes, and word splitting is per- + formed, each parameter expands to a separate word. That is, ""$$@@"" is equivalent to ""$$11"" ""$$22"" ...... If the double-quoted expan- - sion occurs within a word, the expansion of the first parameter + sion occurs within a word, the expansion of the first parameter is joined with the expansion of the beginning part of the origi- nal word, and the expansion of the last parameter is joined with the expansion of the last part of the original word. When there - are no positional parameters, ""$$@@"" and $$@@ expand to nothing + are no positional parameters, ""$$@@"" and $$@@ expand to nothing (i.e., they are removed). ## ($$##) Expands to the number of positional parameters in decimal. - ?? ($$??) Expands to the exit status of the most recently executed + ?? ($$??) Expands to the exit status of the most recently executed command. -- ($$--) Expands to the current option flags as specified upon invo- - cation, by the sseett builtin command, or those set by the shell + cation, by the sseett builtin command, or those set by the shell itself (such as the --ii option). - $$ ($$$$) Expands to the process ID of the shell. In a subshell, it + $$ ($$$$) Expands to the process ID of the shell. In a subshell, it expands to the process ID of the parent shell, not the subshell. - !! ($$!!)Expands to the process ID of the job most recently placed + !! ($$!!)Expands to the process ID of the job most recently placed into the background, whether executed as an asynchronous command or using the bbgg builtin (see JJOOBB CCOONNTTRROOLL below). - 00 ($$00) Expands to the name of the shell or shell script. This is - set at shell initialization. If bbaasshh is invoked with a file of - commands, $$00 is set to the name of that file. If bbaasshh is + 00 ($$00) Expands to the name of the shell or shell script. This is + set at shell initialization. If bbaasshh is invoked with a file of + commands, $$00 is set to the name of that file. If bbaasshh is started with the --cc option, then $$00 is set to the first argument - after the string to be executed, if one is present. Otherwise, + after the string to be executed, if one is present. Otherwise, it is set to the filename used to invoke bbaasshh, as given by argu- ment zero. SShheellll VVaarriiaabblleess The shell sets following variables: - __ ($$__, an underscore) This has a number of meanings depending on + __ ($$__, an underscore) This has a number of meanings depending on context. At shell startup, __ is set to the pathname used to in- - voke the shell or shell script being executed as passed in the - environment or argument list. Subsequently, it expands to the - last argument to the previous simple command executed in the - foreground, after expansion. It is also set to the full path- - name used to invoke each command executed and placed in the en- - vironment exported to that command. When checking mail, $$__ ex- + voke the shell or shell script being executed as passed in the + environment or argument list. Subsequently, it expands to the + last argument to the previous simple command executed in the + foreground, after expansion. It is also set to the full path- + name used to invoke each command executed and placed in the en- + vironment exported to that command. When checking mail, $$__ ex- pands to the name of the mail file currently being checked. - BBAASSHH Expands to the full filename used to invoke this instance of + BBAASSHH Expands to the full filename used to invoke this instance of bbaasshh. BBAASSHHOOPPTTSS - A colon-separated list of enabled shell options. Each word in - the list is a valid argument for the --ss option to the sshhoopptt + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --ss option to the sshhoopptt builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options - appearing in BBAASSHHOOPPTTSS are those reported as _o_n by sshhoopptt. If - this variable is in the environment when bbaasshh starts up, the + appearing in BBAASSHHOOPPTTSS are those reported as _o_n by sshhoopptt. If + this variable is in the environment when bbaasshh starts up, the shell enables each option in the list before reading any startup files. This variable is read-only. BBAASSHHPPIIDD - Expands to the process ID of the current bbaasshh process. This - differs from $$$$ under certain circumstances, such as subshells - that do not require bbaasshh to be re-initialized. Assignments to - BBAASSHHPPIIDD have no effect. If BBAASSHHPPIIDD is unset, it loses its spe- + Expands to the process ID of the current bbaasshh process. This + differs from $$$$ under certain circumstances, such as subshells + that do not require bbaasshh to be re-initialized. Assignments to + BBAASSHHPPIIDD have no effect. If BBAASSHHPPIIDD is unset, it loses its spe- cial properties, even if it is subsequently reset. BBAASSHH__AALLIIAASSEESS - An associative array variable whose members correspond to the - internal list of aliases as maintained by the aalliiaass builtin. - Elements added to this array appear in the alias list; however, - unsetting array elements currently does not remove aliases from - the alias list. If BBAASSHH__AALLIIAASSEESS is unset, it loses its special + An associative array variable whose members correspond to the + internal list of aliases as maintained by the aalliiaass builtin. + Elements added to this array appear in the alias list; however, + unsetting array elements currently does not remove aliases from + the alias list. If BBAASSHH__AALLIIAASSEESS is unset, it loses its special properties, even if it is subsequently reset. BBAASSHH__AARRGGCC - An array variable whose values are the number of parameters in + An array variable whose values are the number of parameters in each frame of the current bbaasshh execution call stack. The number - of parameters to the current subroutine (shell function or - script executed with .. or ssoouurrccee) is at the top of the stack. - When a subroutine is executed, the number of parameters passed + of parameters to the current subroutine (shell function or + script executed with .. or ssoouurrccee) is at the top of the stack. + When a subroutine is executed, the number of parameters passed is pushed onto BBAASSHH__AARRGGCC. The shell sets BBAASSHH__AARRGGCC only when in extended debugging mode (see the description of the eexxttddeebbuugg op- - tion to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the + tion to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the shell has started to execute a script, or referencing this vari- - able when eexxttddeebbuugg is not set, may result in inconsistent val- + able when eexxttddeebbuugg is not set, may result in inconsistent val- ues. Assignments to BBAASSHH__AARRGGCC have no effect, and it may not be unset. BBAASSHH__AARRGGVV - An array variable containing all of the parameters in the cur- + An array variable containing all of the parameters in the cur- rent bbaasshh execution call stack. The final parameter of the last - subroutine call is at the top of the stack; the first parameter + subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is exe- - cuted, the shell pushes the supplied parameters onto BBAASSHH__AARRGGVV. - The shell sets BBAASSHH__AARRGGVV only when in extended debugging mode + cuted, the shell pushes the supplied parameters onto BBAASSHH__AARRGGVV. + The shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see the description of the eexxttddeebbuugg option to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the shell has started to execute a script, or referencing this variable when eexxttddeebbuugg is not set, - may result in inconsistent values. Assignments to BBAASSHH__AARRGGVV + may result in inconsistent values. Assignments to BBAASSHH__AARRGGVV have no effect, and it may not be unset. BBAASSHH__AARRGGVV00 - When referenced, this variable expands to the name of the shell + When referenced, this variable expands to the name of the shell or shell script (identical to $$00; see the description of special parameter 0 above). Assigning a value to BBAASSHH__AARRGGVV00 assigns the - same value to $$00. If BBAASSHH__AARRGGVV00 is unset, it loses its special + same value to $$00. If BBAASSHH__AARRGGVV00 is unset, it loses its special properties, even if it is subsequently reset. BBAASSHH__CCMMDDSS - An associative array variable whose members correspond to the - internal hash table of commands as maintained by the hhaasshh + An associative array variable whose members correspond to the + internal hash table of commands as maintained by the hhaasshh builtin. Adding elements to this array makes them appear in the hash table; however, unsetting array elements currently does not - remove command names from the hash table. If BBAASSHH__CCMMDDSS is un- + remove command names from the hash table. If BBAASSHH__CCMMDDSS is un- set, it loses its special properties, even if it is subsequently reset. BBAASSHH__CCOOMMMMAANNDD - Expands to the command currently being executed or about to be - executed, unless the shell is executing a command as the result + Expands to the command currently being executed or about to be + executed, unless the shell is executing a command as the result of a trap, in which case it is the command executing at the time - of the trap. If BBAASSHH__CCOOMMMMAANNDD is unset, it loses its special + of the trap. If BBAASSHH__CCOOMMMMAANNDD is unset, it loses its special properties, even if it is subsequently reset. BBAASSHH__EEXXEECCUUTTIIOONN__SSTTRRIINNGG The command argument to the --cc invocation option. BBAASSHH__LLIINNEENNOO - An array variable whose members are the line numbers in source - files where each corresponding member of FFUUNNCCNNAAMMEE was invoked. + An array variable whose members are the line numbers in source + files where each corresponding member of FFUUNNCCNNAAMMEE was invoked. $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file ($${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}) where $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or - $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func- - tion). Use LLIINNEENNOO to obtain the current line number. Assign- + $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func- + tion). Use LLIINNEENNOO to obtain the current line number. Assign- ments to BBAASSHH__LLIINNEENNOO have no effect, and it may not be unset. BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH - A colon-separated list of directories in which the eennaabbllee com- + A colon-separated list of directories in which the eennaabbllee com- mand. looks for dynamically loadable builtins. BBAASSHH__MMOONNOOSSEECCOONNDDSS - Each time this variable is referenced, it expands to the value - returned by the system's monotonic clock, if one is available. - If there is no monotonic clock, this is equivalent to EEPPOOCCHHSSEECC-- - OONNDDSS. If BBAASSHH__MMOONNOOSSEECCOONNDDSS is unset, it loses its special prop- + Each time this variable is referenced, it expands to the value + returned by the system's monotonic clock, if one is available. + If there is no monotonic clock, this is equivalent to EEPPOOCCHHSSEECC-- + OONNDDSS. If BBAASSHH__MMOONNOOSSEECCOONNDDSS is unset, it loses its special prop- erties, even if it is subsequently reset. BBAASSHH__RREEMMAATTCCHH - An array variable whose members are assigned by the ==~~ binary - operator to the [[[[ conditional command. The element with index - 0 is the portion of the string matching the entire regular ex- + An array variable whose members are assigned by the ==~~ binary + operator to the [[[[ conditional command. The element with index + 0 is the portion of the string matching the entire regular ex- pression. The element with index _n is the portion of the string matching the _nth parenthesized subexpression. BBAASSHH__SSOOUURRCCEE - An array variable whose members are the source filenames where - the corresponding shell function names in the FFUUNNCCNNAAMMEE array + An array variable whose members are the source filenames where + the corresponding shell function names in the FFUUNNCCNNAAMMEE array variable are defined. The shell function $${{FFUUNNCCNNAAMMEE[[_$_i]]}} is de- - fined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from - $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}. Assignments to BBAASSHH__SSOOUURRCCEE have no ef- + fined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from + $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}. Assignments to BBAASSHH__SSOOUURRCCEE have no ef- fect, and it may not be unset. BBAASSHH__SSUUBBSSHHEELLLL - Incremented by one within each subshell or subshell environment - when the shell begins executing in that environment. The ini- - tial value is 0. If BBAASSHH__SSUUBBSSHHEELLLL is unset, it loses its spe- + Incremented by one within each subshell or subshell environment + when the shell begins executing in that environment. The ini- + tial value is 0. If BBAASSHH__SSUUBBSSHHEELLLL is unset, it loses its spe- cial properties, even if it is subsequently reset. BBAASSHH__TTRRAAPPSSIIGG - Set to the signal number corresponding to the trap action being - executed during its execution. See the description of ttrraapp un- - der SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below for information about signal + Set to the signal number corresponding to the trap action being + executed during its execution. See the description of ttrraapp un- + der SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below for information about signal numbers and trap execution. BBAASSHH__VVEERRSSIINNFFOO A readonly array variable whose members hold version information - for this instance of bbaasshh. The values assigned to the array + for this instance of bbaasshh. The values assigned to the array members are as follows: BBAASSHH__VVEERRSSIINNFFOO[[0]] The major version number (the _r_e_l_e_a_s_e). BBAASSHH__VVEERRSSIINNFFOO[[1]] The minor version number (the _v_e_r_s_i_o_n). @@ -992,96 +992,96 @@ PPAARRAAMMEETTEERRSS BBAASSHH__VVEERRSSIINNFFOO[[4]] The release status (e.g., _b_e_t_a). BBAASSHH__VVEERRSSIINNFFOO[[5]] The value of MMAACCHHTTYYPPEE. BBAASSHH__VVEERRSSIIOONN - Expands to a string describing the version of this instance of + Expands to a string describing the version of this instance of bbaasshh (e.g., 5.2.37(3)-release). CCOOMMPP__CCWWOORRDD - An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current + An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current cursor position. This variable is available only in shell func- - tions invoked by the programmable completion facilities (see + tions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__KKEEYY The key (or final key of a key sequence) used to invoke the cur- - rent completion function. This variable is available only in - shell functions and external commands invoked by the programma- + rent completion function. This variable is available only in + shell functions and external commands invoked by the programma- ble completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__LLIINNEE - The current command line. This variable is available only in - shell functions and external commands invoked by the programma- + The current command line. This variable is available only in + shell functions and external commands invoked by the programma- ble completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__PPOOIINNTT - The index of the current cursor position relative to the begin- - ning of the current command. If the current cursor position is + The index of the current cursor position relative to the begin- + ning of the current command. If the current cursor position is at the end of the current command, the value of this variable is - equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in - shell functions and external commands invoked by the programma- + equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in + shell functions and external commands invoked by the programma- ble completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__TTYYPPEE - Set to an integer value corresponding to the type of attempted - completion that caused a completion function to be called: _T_A_B, - for normal completion, _?, for listing completions after succes- - sive tabs, _!, for listing alternatives on partial word comple- - tion, _@, to list completions if the word is not unmodified, or - _%, for menu completion. This variable is available only in - shell functions and external commands invoked by the programma- + Set to an integer value corresponding to the type of attempted + completion that caused a completion function to be called: _T_A_B, + for normal completion, _?, for listing completions after succes- + sive tabs, _!, for listing alternatives on partial word comple- + tion, _@, to list completions if the word is not unmodified, or + _%, for menu completion. This variable is available only in + shell functions and external commands invoked by the programma- ble completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__WWOORRDDBBRREEAAKKSS - The set of characters that the rreeaaddlliinnee library treats as word - separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS - is unset, it loses its special properties, even if it is subse- + The set of characters that the rreeaaddlliinnee library treats as word + separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS + is unset, it loses its special properties, even if it is subse- quently reset. CCOOMMPP__WWOORRDDSS - An array variable (see AArrrraayyss below) consisting of the individ- - ual words in the current command line. The line is split into - words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as de- - scribed above. This variable is available only in shell func- - tions invoked by the programmable completion facilities (see + An array variable (see AArrrraayyss below) consisting of the individ- + ual words in the current command line. The line is split into + words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as de- + scribed above. This variable is available only in shell func- + tions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). - CCOOPPRROOCC An array variable (see AArrrraayyss below) created to hold the file - descriptors for output from and input to an unnamed coprocess + CCOOPPRROOCC An array variable (see AArrrraayyss below) created to hold the file + descriptors for output from and input to an unnamed coprocess (see CCoopprroocceesssseess above). DDIIRRSSTTAACCKK An array variable (see AArrrraayyss below) containing the current con- - tents of the directory stack. Directories appear in the stack - in the order they are displayed by the ddiirrss builtin. Assigning + tents of the directory stack. Directories appear in the stack + in the order they are displayed by the ddiirrss builtin. Assigning to members of this array variable may be used to modify directo- - ries already in the stack, but the ppuusshhdd and ppooppdd builtins must + ries already in the stack, but the ppuusshhdd and ppooppdd builtins must be used to add and remove directories. Assignment to this vari- - able will not change the current directory. If DDIIRRSSTTAACCKK is un- + able will not change the current directory. If DDIIRRSSTTAACCKK is un- set, it loses its special properties, even if it is subsequently reset. EEPPOOCCHHRREEAALLTTIIMMEE Each time this parameter is referenced, it expands to the number - of seconds since the Unix Epoch (see _t_i_m_e(3)) as a floating + of seconds since the Unix Epoch (see _t_i_m_e(3)) as a floating- point value with micro-second granularity. Assignments to - EEPPOOCCHHRREEAALLTTIIMMEE are ignored. If EEPPOOCCHHRREEAALLTTIIMMEE is unset, it loses + EEPPOOCCHHRREEAALLTTIIMMEE are ignored. If EEPPOOCCHHRREEAALLTTIIMMEE is unset, it loses its special properties, even if it is subsequently reset. EEPPOOCCHHSSEECCOONNDDSS Each time this parameter is referenced, it expands to the number - of seconds since the Unix Epoch (see _t_i_m_e(3)). Assignments to - EEPPOOCCHHSSEECCOONNDDSS are ignored. If EEPPOOCCHHSSEECCOONNDDSS is unset, it loses + of seconds since the Unix Epoch (see _t_i_m_e(3)). Assignments to + EEPPOOCCHHSSEECCOONNDDSS are ignored. If EEPPOOCCHHSSEECCOONNDDSS is unset, it loses its special properties, even if it is subsequently reset. - EEUUIIDD Expands to the effective user ID of the current user, initial- + EEUUIIDD Expands to the effective user ID of the current user, initial- ized at shell startup. This variable is readonly. FFUUNNCCNNAAMMEE - An array variable containing the names of all shell functions + An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The bot- - tom-most element (the one with the highest index) is "main". - This variable exists only when a shell function is executing. - Assignments to FFUUNNCCNNAAMMEE have no effect. If FFUUNNCCNNAAMMEE is unset, - it loses its special properties, even if it is subsequently re- + tom-most element (the one with the highest index) is "main". + This variable exists only when a shell function is executing. + Assignments to FFUUNNCCNNAAMMEE have no effect. If FFUUNNCCNNAAMMEE is unset, + it loses its special properties, even if it is subsequently re- set. - This variable can be used with BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE. - Each element of FFUUNNCCNNAAMMEE has corresponding elements in + This variable can be used with BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE. + Each element of FFUUNNCCNNAAMMEE has corresponding elements in BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE to describe the call stack. For in- - stance, $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called from the file - $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}} at line number $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}}. The + stance, $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called from the file + $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}} at line number $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}}. The ccaalllleerr builtin displays the current call stack using this infor- mation. - GGRROOUUPPSS An array variable containing the list of groups of which the + GGRROOUUPPSS An array variable containing the list of groups of which the current user is a member. Assignments to GGRROOUUPPSS have no effect. - If GGRROOUUPPSS is unset, it loses its special properties, even if it + If GGRROOUUPPSS is unset, it loses its special properties, even if it is subsequently reset. HHIISSTTCCMMDD The history number, or index in the history list, of the current @@ -1091,46 +1091,46 @@ PPAARRAAMMEETTEERRSS HHOOSSTTNNAAMMEE Automatically set to the name of the current host. HHOOSSTTTTYYPPEE - Automatically set to a string that uniquely describes the type - of machine on which bbaasshh is executing. The default is system- + Automatically set to a string that uniquely describes the type + of machine on which bbaasshh is executing. The default is system- dependent. - LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a - decimal number representing the current sequential line number - (starting with 1) within a script or function. When not in a - script or function, the value substituted is not guaranteed to + LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a + decimal number representing the current sequential line number + (starting with 1) within a script or function. When not in a + script or function, the value substituted is not guaranteed to be meaningful. If LLIINNEENNOO is unset, it loses its special proper- ties, even if it is subsequently reset. MMAACCHHTTYYPPEE - Automatically set to a string that fully describes the system - type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- + Automatically set to a string that fully describes the system + type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- _p_a_n_y_-_s_y_s_t_e_m format. The default is system-dependent. MMAAPPFFIILLEE - An array variable (see AArrrraayyss below) created to hold the text + An array variable (see AArrrraayyss below) created to hold the text read by the mmaappffiillee builtin when no variable name is supplied. OOLLDDPPWWDD The previous working directory as set by the ccdd command. - OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss + OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss + OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOSSTTYYPPEE Automatically set to a string that describes the operating sys- - tem on which bbaasshh is executing. The default is system-depen- + OOSSTTYYPPEE Automatically set to a string that describes the operating sys- + tem on which bbaasshh is executing. The default is system-depen- dent. PPIIPPEESSTTAATTUUSS - An array variable (see AArrrraayyss below) containing a list of exit - status values from the processes in the most-recently-executed - foreground pipeline, which may consist of only a simple command + An array variable (see AArrrraayyss below) containing a list of exit + status values from the processes in the most-recently-executed + foreground pipeline, which may consist of only a simple command (see SSHHEELLLL GGRRAAMMMMAARR above). - PPPPIIDD The process ID of the shell's parent. This variable is read- + PPPPIIDD The process ID of the shell's parent. This variable is read- only. PPWWDD The current working directory as set by the ccdd command. - RRAANNDDOOMM Each time this parameter is referenced, it expands to a random - integer between 0 and 32767. Assigning a value to RRAANNDDOOMM ini- - tializes (seeds) the sequence of random numbers. Seeding the - random number generator with the same constant value will pro- - duce the same sequence of values. If RRAANNDDOOMM is unset, it loses + RRAANNDDOOMM Each time this parameter is referenced, it expands to a random + integer between 0 and 32767. Assigning a value to RRAANNDDOOMM ini- + tializes (seeds) the sequence of random numbers. Seeding the + random number generator with the same constant value will pro- + duce the same sequence of values. If RRAANNDDOOMM is unset, it loses its special properties, even if it is subsequently reset. RREEAADDLLIINNEE__AARRGGUUMMEENNTT - Any numeric argument given to a readline command that was de- + Any numeric argument given to a rreeaaddlliinnee command that was de- fined using "bind -x" (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) when it was invoked. RREEAADDLLIINNEE__LLIINNEE @@ -1138,138 +1138,139 @@ PPAARRAAMMEETTEERRSS (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). RREEAADDLLIINNEE__MMAARRKK The position of the mark (saved insertion point) in the rreeaaddlliinnee - line buffer, for use with "bind -x" (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS + line buffer, for use with "bind -x" (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The characters between the insertion point and the mark are often called the _r_e_g_i_o_n. RREEAADDLLIINNEE__PPOOIINNTT The position of the insertion point in the rreeaaddlliinnee line buffer, for use with "bind -x" (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when + RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when no arguments are supplied. SSEECCOONNDDSS Each time this parameter is referenced, it expands to the number - of seconds since shell invocation. If a value is assigned to - SSEECCOONNDDSS, the value returned upon subsequent references is the - number of seconds since the assignment plus the value assigned. - The number of seconds at shell invocation and the current time + of seconds since shell invocation. If a value is assigned to + SSEECCOONNDDSS, the value returned upon subsequent references is the + number of seconds since the assignment plus the value assigned. + The number of seconds at shell invocation and the current time are always determined by querying the system clock at one-second - resolution. If SSEECCOONNDDSS is unset, it loses its special proper- + resolution. If SSEECCOONNDDSS is unset, it loses its special proper- ties, even if it is subsequently reset. SSHHEELLLLOOPPTTSS - A colon-separated list of enabled shell options. Each word in - the list is a valid argument for the --oo option to the sseett + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --oo option to the sseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options - appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If - this variable is in the environment when bbaasshh starts up, the + appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If + this variable is in the environment when bbaasshh starts up, the shell enables each option in the list before reading any startup files. This variable is read-only. SSHHLLVVLL Incremented by one each time an instance of bbaasshh is started. SSRRAANNDDOOMM - Each time it is referenced, this variable expands to a 32-bit + Each time it is referenced, this variable expands to a 32-bit pseudo-random number. The random number generator is not linear - on systems that support _/_d_e_v_/_u_r_a_n_d_o_m or _a_r_c_4_r_a_n_d_o_m(3), so each + on systems that support _/_d_e_v_/_u_r_a_n_d_o_m or _a_r_c_4_r_a_n_d_o_m(3), so each returned number has no relationship to the numbers preceding it. - The random number generator cannot be seeded, so assignments to + The random number generator cannot be seeded, so assignments to this variable have no effect. If SSRRAANNDDOOMM is unset, it loses its special properties, even if it is subsequently reset. UUIIDD Expands to the user ID of the current user, initialized at shell startup. This variable is readonly. - The shell uses the following variables. In some cases, bbaasshh assigns a + The shell uses the following variables. In some cases, bbaasshh assigns a default value to a variable; these cases are noted below. BBAASSHH__CCOOMMPPAATT - The value is used to set the shell's compatibility level. See - SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE below for a description of the various + The value is used to set the shell's compatibility level. See + SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE below for a description of the various compatibility levels and their effects. The value may be a dec- - imal number (e.g., 4.2) or an integer (e.g., 42) corresponding - to the desired compatibility level. If BBAASSHH__CCOOMMPPAATT is unset or - set to the empty string, the compatibility level is set to the - default for the current version. If BBAASSHH__CCOOMMPPAATT is set to a - value that is not one of the valid compatibility levels, the - shell prints an error message and sets the compatibility level - to the default for the current version. A subset of the valid - values correspond to the compatibility levels described below - under SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE. For example, 4.2 and 42 are - valid values that correspond to the ccoommppaatt4422 sshhoopptt option and - set the compatibility level to 42. The current version is also + imal number (e.g., 4.2) or an integer (e.g., 42) corresponding + to the desired compatibility level. If BBAASSHH__CCOOMMPPAATT is unset or + set to the empty string, the compatibility level is set to the + default for the current version. If BBAASSHH__CCOOMMPPAATT is set to a + value that is not one of the valid compatibility levels, the + shell prints an error message and sets the compatibility level + to the default for the current version. A subset of the valid + values correspond to the compatibility levels described below + under SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE. For example, 4.2 and 42 are + valid values that correspond to the ccoommppaatt4422 sshhoopptt option and + set the compatibility level to 42. The current version is also a valid value. BBAASSHH__EENNVV - If this parameter is set when bbaasshh is executing a shell script, - its expanded value is interpreted as a filename containing com- - mands to initialize the shell before it reads and executes com- - mands from the script. The value of BBAASSHH__EENNVV is subjected to + If this parameter is set when bbaasshh is executing a shell script, + its expanded value is interpreted as a filename containing com- + mands to initialize the shell before it reads and executes com- + mands from the script. The value of BBAASSHH__EENNVV is subjected to parameter expansion, command substitution, and arithmetic expan- - sion before being interpreted as a filename. PPAATTHH is not used + sion before being interpreted as a filename. PPAATTHH is not used to search for the resultant filename. BBAASSHH__XXTTRRAACCEEFFDD - If set to an integer corresponding to a valid file descriptor, - bbaasshh will write the trace output generated when "set -x" is en- - abled to that file descriptor. The file descriptor is closed - when BBAASSHH__XXTTRRAACCEEFFDD is unset or assigned a new value. Unsetting - BBAASSHH__XXTTRRAACCEEFFDD or assigning it the empty string causes the trace - output to be sent to the standard error. Note that setting + If set to an integer corresponding to a valid file descriptor, + bbaasshh will write the trace output generated when "set -x" is en- + abled to that file descriptor. The file descriptor is closed + when BBAASSHH__XXTTRRAACCEEFFDD is unset or assigned a new value. Unsetting + BBAASSHH__XXTTRRAACCEEFFDD or assigning it the empty string causes the trace + output to be sent to the standard error. Note that setting BBAASSHH__XXTTRRAACCEEFFDD to 2 (the standard error file descriptor) and then unsetting it will result in the standard error being closed. - CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated + CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated list of directories where the shell looks for directories speci- - fied as arguments to the ccdd command. A sample value is + fied as arguments to the ccdd command. A sample value is ".:~:/usr". CCHHIILLDD__MMAAXX - Set the number of exited child status values for the shell to - remember. BBaasshh will not allow this value to be decreased below - a POSIX-mandated minimum, and there is a maximum value (cur- - rently 8192) that this may not exceed. The minimum value is + Set the number of exited child status values for the shell to + remember. BBaasshh will not allow this value to be decreased below + a POSIX-mandated minimum, and there is a maximum value (cur- + rently 8192) that this may not exceed. The minimum value is system-dependent. CCOOLLUUMMNNSS - Used by the sseelleecctt compound command to determine the terminal - width when printing selection lists. Automatically set if the - cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon + Used by the sseelleecctt compound command to determine the terminal + width when printing selection lists. Automatically set if the + cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon receipt of a SSIIGGWWIINNCCHH. CCOOMMPPRREEPPLLYY An array variable from which bbaasshh reads the possible completions - generated by a shell function invoked by the programmable com- - pletion facility (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). Each ar- + generated by a shell function invoked by the programmable com- + pletion facility (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). Each ar- ray element contains one possible completion. - EEMMAACCSS If bbaasshh finds this variable in the environment when the shell - starts with value "t", it assumes that the shell is running in + EEMMAACCSS If bbaasshh finds this variable in the environment when the shell + starts with value "t", it assumes that the shell is running in an Emacs shell buffer and disables line editing. - EENNVV Expanded and executed similarly to BBAASSHH__EENNVV (see IINNVVOOCCAATTIIOONN - above) when an interactive shell is invoked in _p_o_s_i_x _m_o_d_e. + EENNVV Expanded and executed similarly to BBAASSHH__EENNVV (see IINNVVOOCCAATTIIOONN + above) when an interactive shell is invoked in posix mode. EEXXEECCIIGGNNOORREE - A colon-separated list of shell patterns (see PPaatttteerrnn MMaattcchhiinngg) - defining the set of filenames to be ignored by command search - using PPAATTHH. Files whose full pathnames match one of these pat- - terns are not considered executable files for the purposes of + A colon-separated list of shell patterns (see PPaatttteerrnn MMaattcchhiinngg) + defining the set of filenames to be ignored by command search + using PPAATTHH. Files whose full pathnames match one of these pat- + terns are not considered executable files for the purposes of completion and command execution via PPAATTHH lookup. This does not affect the behavior of the [[, tteesstt, and [[[[ commands. Full path- - names in the command hash table are not subject to EEXXEECCIIGGNNOORREE. - Use this variable to ignore shared library files that have the - executable bit set, but are not executable files. The pattern + names in the command hash table are not subject to EEXXEECCIIGGNNOORREE. + Use this variable to ignore shared library files that have the + executable bit set, but are not executable files. The pattern matching honors the setting of the eexxttgglloobb shell option. FFCCEEDDIITT The default editor for the ffcc builtin command. FFIIGGNNOORREE - A colon-separated list of suffixes to ignore when performing + A colon-separated list of suffixes to ignore when performing filename completion (see RREEAADDLLIINNEE below). A filename whose suf- - fix matches one of the entries in FFIIGGNNOORREE is excluded from the + fix matches one of the entries in FFIIGGNNOORREE is excluded from the list of matched filenames. A sample value is ".o:~". FFUUNNCCNNEESSTT - If set to a numeric value greater than 0, defines a maximum - function nesting level. Function invocations that exceed this + If set to a numeric value greater than 0, defines a maximum + function nesting level. Function invocations that exceed this nesting level will cause the current command to abort. GGLLOOBBIIGGNNOORREE - A colon-separated list of patterns defining the set of file - names to be ignored by pathname expansion. If a file name - matched by a pathname expansion pattern also matches one of the - patterns in GGLLOOBBIIGGNNOORREE, it is removed from the list of matches. + A colon-separated list of patterns defining the set of file + names to be ignored by pathname expansion. If a file name + matched by a pathname expansion pattern also matches one of the + patterns in GGLLOOBBIIGGNNOORREE, it is removed from the list of matches. The pattern matching honors the setting of the eexxttgglloobb shell op- tion. GGLLOOBBSSOORRTT - Controls how the results of pathname expansion are sorted. The - value of this variable specifies the sort criteria and sort or- - der for the results of pathname expansion. If this variable is - unset or set to the null string, pathname expansion uses the - historical behavior of sorting by name. + Controls how the results of pathname expansion are sorted. The + value of this variable specifies the sort criteria and sort or- + der for the results of pathname expansion. If this variable is + unset or set to the null string, pathname expansion uses the + historical behavior of sorting by name, in ascending lexico- + graphic order as determined by the LLCC__CCOOLLLLAATTEE shell variable. If set, a valid value begins with an optional _+, which is ig- nored, or _-, which reverses the sort order from ascending to de- @@ -1285,215 +1286,215 @@ PPAARRAAMMEETTEERRSS order by modification time (newest first). The _n_u_m_e_r_i_c specifier treats names consisting solely of digits - as numbers and sorts them using the numeric value (so "2" will - sort before "10", for example). When using _n_u_m_e_r_i_c, names con- - taining non-digits sort after all the all-digit names and are + as numbers and sorts them using their numeric value (so "2" will + sort before "10", for example). When using _n_u_m_e_r_i_c, names con- + taining non-digits sort after all the all-digit names and are sorted by name using the traditional behavior. - A sort specifier of _n_o_s_o_r_t disables sorting completely; the re- - sults are returned in the order they are read from the file sys- - tem, and any leading _+ or _- is ignored. + A sort specifier of _n_o_s_o_r_t disables sorting completely; bbaasshh re- + turns the results in the order they are read from the file sys- + tem, ignoring any leading _-. - If the sort specifier is missing, it defaults to _n_a_m_e, so a - value of _+ is equivalent to the null string, and a value of _- - sorts by name in descending order. Any invalid value restores + If the sort specifier is missing, it defaults to _n_a_m_e, so a + value of _+ is equivalent to the null string, and a value of _- + sorts by name in descending order. Any invalid value restores the historical sorting behavior. HHIISSTTCCOONNTTRROOLL - A colon-separated list of values controlling how commands are - saved on the history list. If the list of values includes - _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not - saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines + A colon-separated list of values controlling how commands are + saved on the history list. If the list of values includes + _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not + saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines matching the previous history entry not to be saved. A value of _i_g_n_o_r_e_b_o_t_h is shorthand for _i_g_n_o_r_e_s_p_a_c_e and _i_g_n_o_r_e_d_u_p_s. A value of _e_r_a_s_e_d_u_p_s causes all previous lines matching the current line - to be removed from the history list before that line is saved. - Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is - unset, or does not include a valid value, all lines read by the + to be removed from the history list before that line is saved. + Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is + unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value - of HHIISSTTIIGGNNOORREE. The second and subsequent lines of a multi-line - compound command are not tested, and are added to the history - regardless of the value of HHIISSTTCCOONNTTRROOLL if the first line of the - command was saved. If the first line was not saved, the second + of HHIISSTTIIGGNNOORREE. The second and subsequent lines of a multi-line + compound command are not tested, and are added to the history + regardless of the value of HHIISSTTCCOONNTTRROOLL if the first line of the + command was saved. If the first line was not saved, the second and subsequent lines of the command are not saved either. HHIISSTTFFIILLEE The name of the file in which command history is saved (see HHIISS-- - TTOORRYY below). BBaasshh assigns a default value of _~_/_._b_a_s_h___h_i_s_t_o_r_y. - If HHIISSTTFFIILLEE is unset or null, the shell does not save the com- + TTOORRYY below). BBaasshh assigns a default value of _~_/_._b_a_s_h___h_i_s_t_o_r_y. + If HHIISSTTFFIILLEE is unset or null, the shell does not save the com- mand history when it exits. HHIISSTTFFIILLEESSIIZZEE The maximum number of lines contained in the history file. When - this variable is assigned a value, the history file is trun- - cated, if necessary, to contain no more than that number of - lines by removing the oldest entries. The history file is also + this variable is assigned a value, the history file is trun- + cated, if necessary, to contain no more than that number of + lines by removing the oldest entries. The history file is also truncated to this size after writing it when a shell exits or by - the hhiissttoorryy builtin. If the value is 0, the history file is - truncated to zero size. Non-numeric values and numeric values - less than zero inhibit truncation. The shell sets the default + the hhiissttoorryy builtin. If the value is 0, the history file is + truncated to zero size. Non-numeric values and numeric values + less than zero inhibit truncation. The shell sets the default value to the value of HHIISSTTSSIIZZEE after reading any startup files. HHIISSTTIIGGNNOORREE - A colon-separated list of patterns used to decide which command - lines should be saved on the history list. If a command line - matches one of the patterns in the value of HHIISSTTIIGGNNOORREE, it is - not saved on the history list. Each pattern is anchored at the - beginning of the line and must match the complete line (bbaasshh - will not implicitly append a "**"). Each pattern is tested - against the line after the checks specified by HHIISSTTCCOONNTTRROOLL are + A colon-separated list of patterns used to decide which command + lines should be saved on the history list. If a command line + matches one of the patterns in the value of HHIISSTTIIGGNNOORREE, it is + not saved on the history list. Each pattern is anchored at the + beginning of the line and must match the complete line (bbaasshh + will not implicitly append a "**"). Each pattern is tested + against the line after the checks specified by HHIISSTTCCOONNTTRROOLL are applied. In addition to the normal shell pattern matching char- acters, "&&" matches the previous history line. A backslash will - escape the "&&"; the backslash is removed before attempting a + escape the "&&"; the backslash is removed before attempting a match. The second and subsequent lines of a multi-line compound - command are not tested, and are added to the history regardless - of the value of HHIISSTTIIGGNNOORREE. If the first line was not saved, + command are not tested, and are added to the history regardless + of the value of HHIISSTTIIGGNNOORREE. If the first line was not saved, the second and subsequent lines of the command are not saved ei- - ther. The pattern matching honors the setting of the eexxttgglloobb + ther. The pattern matching honors the setting of the eexxttgglloobb shell option. HHIISSTTSSIIZZEE - The number of commands to remember in the command history (see - HHIISSTTOORRYY below). If the value is 0, commands are not saved in + The number of commands to remember in the command history (see + HHIISSTTOORRYY below). If the value is 0, commands are not saved in the history list. Numeric values less than zero result in every - command being saved on the history list (there is no limit). - The shell sets the default value to 500 after reading any + command being saved on the history list (there is no limit). + The shell sets the default value to 500 after reading any startup files. HHIISSTTTTIIMMEEFFOORRMMAATT - If this variable is set and not null, its value is used as a + If this variable is set and not null, its value is used as a format string for _s_t_r_f_t_i_m_e(3) to print the time stamp associated - with each history entry displayed by the hhiissttoorryy builtin. If - this variable is set, the shell writes time stamps to the his- - tory file so they may be preserved across shell sessions. This - uses the history comment character to distinguish timestamps + with each history entry displayed by the hhiissttoorryy builtin. If + this variable is set, the shell writes time stamps to the his- + tory file so they may be preserved across shell sessions. This + uses the history comment character to distinguish timestamps from other history lines. HHOOMMEE The home directory of the current user; the default argument for the ccdd builtin command. The value of this variable is also used when performing tilde expansion. HHOOSSTTFFIILLEE - Contains the name of a file in the same format as _/_e_t_c_/_h_o_s_t_s + Contains the name of a file in the same format as _/_e_t_c_/_h_o_s_t_s that should be read when the shell needs to complete a hostname. - The list of possible hostname completions may be changed while - the shell is running; the next time hostname completion is at- - tempted after the value is changed, bbaasshh adds the contents of - the new file to the existing list. If HHOOSSTTFFIILLEE is set, but has - no value, or does not name a readable file, bbaasshh attempts to - read _/_e_t_c_/_h_o_s_t_s to obtain the list of possible hostname comple- + The list of possible hostname completions may be changed while + the shell is running; the next time hostname completion is at- + tempted after the value is changed, bbaasshh adds the contents of + the new file to the existing list. If HHOOSSTTFFIILLEE is set, but has + no value, or does not name a readable file, bbaasshh attempts to + read _/_e_t_c_/_h_o_s_t_s to obtain the list of possible hostname comple- tions. When HHOOSSTTFFIILLEE is unset, the hostname list is cleared. IIFFSS The _I_n_t_e_r_n_a_l _F_i_e_l_d _S_e_p_a_r_a_t_o_r that is used for word splitting af- - ter expansion and to split lines into words with the rreeaadd + ter expansion and to split lines into words with the rreeaadd builtin command. Word splitting is described above under EEXXPPAANN-- SSIIOONN. The default value is "". IIGGNNOORREEEEOOFF Controls the action of an interactive shell on receipt of an EEOOFF character as the sole input. If set, the value is the number of - consecutive EEOOFF characters which must be typed as the first - characters on an input line before bbaasshh exits. If the variable - is set but does not have a numeric value, or the value is null, - the default value is 10. If it is unset, EEOOFF signifies the end + consecutive EEOOFF characters which must be typed as the first + characters on an input line before bbaasshh exits. If the variable + is set but does not have a numeric value, or the value is null, + the default value is 10. If it is unset, EEOOFF signifies the end of input to the shell. IINNPPUUTTRRCC - The filename for the rreeaaddlliinnee startup file, overriding the de- + The filename for the rreeaaddlliinnee startup file, overriding the de- fault of _~_/_._i_n_p_u_t_r_c (see RREEAADDLLIINNEE below). IINNSSIIDDEE__EEMMAACCSS - If this variable appears in the environment when the shell - starts, bbaasshh assumes that it is running inside an Emacs shell - buffer and may disable line editing, depending on the value of + If this variable appears in the environment when the shell + starts, bbaasshh assumes that it is running inside an Emacs shell + buffer and may disable line editing, depending on the value of TTEERRMM. - LLAANNGG Used to determine the locale category for any category not + LLAANNGG Used to determine the locale category for any category not specifically selected with a variable starting with LLCC__. - LLCC__AALLLL This variable overrides the value of LLAANNGG and any other LLCC__ + LLCC__AALLLL This variable overrides the value of LLAANNGG and any other LLCC__ variable specifying a locale category. LLCC__CCOOLLLLAATTEE - This variable determines the collation order used when sorting - the results of pathname expansion, and determines the behavior - of range expressions, equivalence classes, and collating se- + This variable determines the collation order used when sorting + the results of pathname expansion, and determines the behavior + of range expressions, equivalence classes, and collating se- quences within pathname expansion and pattern matching. LLCC__CCTTYYPPEE - This variable determines the interpretation of characters and - the behavior of character classes within pathname expansion and + This variable determines the interpretation of characters and + the behavior of character classes within pathname expansion and pattern matching. LLCC__MMEESSSSAAGGEESS - This variable determines the locale used to translate double- + This variable determines the locale used to translate double- quoted strings preceded by a $$. LLCC__NNUUMMEERRIICC - This variable determines the locale category used for number + This variable determines the locale category used for number formatting. LLCC__TTIIMMEE - This variable determines the locale category used for data and + This variable determines the locale category used for data and time formatting. - LLIINNEESS Used by the sseelleecctt compound command to determine the column - length for printing selection lists. Automatically set if the - cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon + LLIINNEESS Used by the sseelleecctt compound command to determine the column + length for printing selection lists. Automatically set if the + cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon receipt of a SSIIGGWWIINNCCHH. MMAAIILL If the value is set to a file or directory name and the MMAAIILLPPAATTHH - variable is not set, bbaasshh informs the user of the arrival of + variable is not set, bbaasshh informs the user of the arrival of mail in the specified file or Maildir-format directory. MMAAIILLCCHHEECCKK - Specifies how often (in seconds) bbaasshh checks for mail. The de- - fault is 60 seconds. When it is time to check for mail, the - shell does so before displaying the primary prompt. If this - variable is unset, or set to a value that is not a number + Specifies how often (in seconds) bbaasshh checks for mail. The de- + fault is 60 seconds. When it is time to check for mail, the + shell does so before displaying the primary prompt. If this + variable is unset, or set to a value that is not a number greater than or equal to zero, the shell disables mail checking. MMAAIILLPPAATTHH A colon-separated list of filenames to be checked for mail. The message to be printed when mail arrives in a particular file may - be specified by separating the filename from the message with a - "?". When used in the text of the message, $$__ expands to the + be specified by separating the filename from the message with a + "?". When used in the text of the message, $$__ expands to the name of the current mailfile. Example: MMAAIILLPPAATTHH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"' - BBaasshh can be configured to supply a default value for this vari- - able (there is no value by default), but the location of the + BBaasshh can be configured to supply a default value for this vari- + able (there is no value by default), but the location of the user mail files that it uses is system dependent (e.g., /var/mail/$$UUSSEERR). OOPPTTEERRRR If set to the value 1, bbaasshh displays error messages generated by - the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOPPTTEERRRR is initialized to 1 each time the shell is invoked or a + the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + OOPPTTEERRRR is initialized to 1 each time the shell is invoked or a shell script is executed. - PPAATTHH The search path for commands. It is a colon-separated list of - directories in which the shell looks for commands (see CCOOMMMMAANNDD - EEXXEECCUUTTIIOONN below). A zero-length (null) directory name in the + PPAATTHH The search path for commands. It is a colon-separated list of + directories in which the shell looks for commands (see CCOOMMMMAANNDD + EEXXEECCUUTTIIOONN below). A zero-length (null) directory name in the value of PPAATTHH indicates the current directory. A null directory - name may appear as two adjacent colons, or as an initial or - trailing colon. The default path is system-dependent, and is + name may appear as two adjacent colons, or as an initial or + trailing colon. The default path is system-dependent, and is set by the administrator who installs bbaasshh. A common value is "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin". PPOOSSIIXXLLYY__CCOORRRREECCTT - If this variable is in the environment when bbaasshh starts, the - shell enters _p_o_s_i_x _m_o_d_e before reading the startup files, as if - the ----ppoossiixx invocation option had been supplied. If it is set - while the shell is running, bbaasshh enables _p_o_s_i_x _m_o_d_e, as if the + If this variable is in the environment when bbaasshh starts, the + shell enters posix mode before reading the startup files, as if + the ----ppoossiixx invocation option had been supplied. If it is set + while the shell is running, bbaasshh enables posix mode, as if the command "set -o posix" had been executed. When the shell enters - _p_o_s_i_x _m_o_d_e, it sets this variable if it was not already set. + posix mode, it sets this variable if it was not already set. PPRROOMMPPTT__CCOOMMMMAANNDD - If this variable is set, and is an array, the value of each set - element is executed as a command prior to issuing each primary - prompt. If this is set but not an array variable, its value is + If this variable is set, and is an array, the value of each set + element is executed as a command prior to issuing each primary + prompt. If this is set but not an array variable, its value is used as a command to execute instead. PPRROOMMPPTT__DDIIRRTTRRIIMM - If set to a number greater than zero, the value is used as the + If set to a number greater than zero, the value is used as the number of trailing directory components to retain when expanding - the \\ww and \\WW prompt string escapes (see PPRROOMMPPTTIINNGG below). + the \\ww and \\WW prompt string escapes (see PPRROOMMPPTTIINNGG below). Characters removed are replaced with an ellipsis. - PPSS00 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) - and displayed by interactive shells after reading a command and + PPSS00 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) + and displayed by interactive shells after reading a command and before the command is executed. - PPSS11 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) - and used as the primary prompt string. The default value is + PPSS11 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) + and used as the primary prompt string. The default value is "\s-\v\$ ". - PPSS22 The value of this parameter is expanded as with PPSS11 and used as + PPSS22 The value of this parameter is expanded as with PPSS11 and used as the secondary prompt string. The default is "> ". PPSS33 The value of this parameter is used as the prompt for the sseelleecctt command (see SSHHEELLLL GGRRAAMMMMAARR above). - PPSS44 The value of this parameter is expanded as with PPSS11 and the + PPSS44 The value of this parameter is expanded as with PPSS11 and the value is printed before each command bbaasshh displays during an ex- ecution trace. The first character of the expanded value of PPSS44 is replicated multiple times, as necessary, to indicate multiple levels of indirection. The default is "+ ". - SSHHEELLLL This variable expands to the full pathname to the shell. If it - is not set when the shell starts, bbaasshh assigns to it the full + SSHHEELLLL This variable expands to the full pathname to the shell. If it + is not set when the shell starts, bbaasshh assigns to it the full pathname of the current user's login shell. TTIIMMEEFFOORRMMAATT - The value of this parameter is used as a format string specify- - ing how the timing information for pipelines prefixed with the - ttiimmee reserved word should be displayed. The %% character intro- - duces an escape sequence that is expanded to a time value or - other information. The escape sequences and their meanings are + The value of this parameter is used as a format string specify- + ing how the timing information for pipelines prefixed with the + ttiimmee reserved word should be displayed. The %% character intro- + duces an escape sequence that is expanded to a time value or + other information. The escape sequences and their meanings are as follows; the brackets denote optional portions. %%%% A literal %%. %%[[_p]][[ll]]RR The elapsed time in seconds. @@ -1501,77 +1502,76 @@ PPAARRAAMMEETTEERRSS %%[[_p]][[ll]]SS The number of CPU seconds spent in system mode. %%PP The CPU percentage, computed as (%U + %S) / %R. - The optional _p is a digit specifying the _p_r_e_c_i_s_i_o_n, the number + The optional _p is a digit specifying the _p_r_e_c_i_s_i_o_n, the number of fractional digits after a decimal point. A value of 0 causes - no decimal point or fraction to be output. ttiimmee will print at - most six digits after the decimal point; values of _p greater - than 6 are changed to 6. If _p is not specified, ttiimmee prints + no decimal point or fraction to be output. ttiimmee will print at + most six digits after the decimal point; values of _p greater + than 6 are changed to 6. If _p is not specified, ttiimmee prints three digits after the decimal point. - The optional ll specifies a longer format, including minutes, of - the form _M_Mm_S_S._F_Fs. The value of _p determines whether or not + The optional ll specifies a longer format, including minutes, of + the form _M_Mm_S_S._F_Fs. The value of _p determines whether or not the fraction is included. - If this variable is not set, bbaasshh acts as if it had the value - $$''\\nnrreeaall\\tt%%33llRR\\nnuusseerr\\tt%%33llUU\\nnssyyss\\tt%%33llSS''. If the value is null, - bbaasshh does not display any timing information. A trailing new- + If this variable is not set, bbaasshh acts as if it had the value + $$''\\nnrreeaall\\tt%%33llRR\\nnuusseerr\\tt%%33llUU\\nnssyyss\\tt%%33llSS''. If the value is null, + bbaasshh does not display any timing information. A trailing new- line is added when the format string is displayed. - TTMMOOUUTT If set to a value greater than zero, the rreeaadd builtin uses the - value as its default timeout. The sseelleecctt command terminates if - input does not arrive after TTMMOOUUTT seconds when input is coming - from a terminal. In an interactive shell, the value is inter- - preted as the number of seconds to wait for a line of input af- - ter issuing the primary prompt. BBaasshh terminates after waiting - for that number of seconds if a complete line of input does not + TTMMOOUUTT If set to a value greater than zero, the rreeaadd builtin uses the + value as its default timeout. The sseelleecctt command terminates if + input does not arrive after TTMMOOUUTT seconds when input is coming + from a terminal. In an interactive shell, the value is inter- + preted as the number of seconds to wait for a line of input af- + ter issuing the primary prompt. BBaasshh terminates after waiting + for that number of seconds if a complete line of input does not arrive. - TTMMPPDDIIRR If set, bbaasshh uses its value as the name of a directory in which + TTMMPPDDIIRR If set, bbaasshh uses its value as the name of a directory in which bbaasshh creates temporary files for the shell's use. aauuttoo__rreessuummee This variable controls how the shell interacts with the user and - job control. If this variable is set, simple commands consist- - ing of only a single word, without redirections, are treated as - candidates for resumption of an existing stopped job. There is - no ambiguity allowed; if there is more than one job beginning - with or containing the word, this selects the most recently ac- - cessed job. The _n_a_m_e of a stopped job, in this context, is the - command line used to start it, as displayed by jjoobbss. If set to - the value _e_x_a_c_t, the word must match the name of a stopped job - exactly; if set to _s_u_b_s_t_r_i_n_g, the word needs to match a sub- - string of the name of a stopped job. The _s_u_b_s_t_r_i_n_g value pro- + job control. If this variable is set, simple commands consist- + ing of only a single word, without redirections, are treated as + candidates for resumption of an existing stopped job. There is + no ambiguity allowed; if there is more than one job beginning + with or containing the word, this selects the most recently ac- + cessed job. The _n_a_m_e of a stopped job, in this context, is the + command line used to start it, as displayed by jjoobbss. If set to + the value _e_x_a_c_t, the word must match the name of a stopped job + exactly; if set to _s_u_b_s_t_r_i_n_g, the word needs to match a sub- + string of the name of a stopped job. The _s_u_b_s_t_r_i_n_g value pro- vides functionality analogous to the %%?? job identifier (see JJOOBB - CCOONNTTRROOLL below). If set to any other value (e.g., _p_r_e_f_i_x), the - word must be a prefix of a stopped job's name; this provides + CCOONNTTRROOLL below). If set to any other value (e.g., _p_r_e_f_i_x), the + word must be a prefix of a stopped job's name; this provides functionality analogous to the %%_s_t_r_i_n_g job identifier. hhiissttcchhaarrss - The two or three characters which control history expansion and + The two or three characters which control history expansion and tokenization (see HHIISSTTOORRYY EEXXPPAANNSSIIOONN below). The first character - is the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, the character which signals - the start of a history expansion, normally "!!". The second - character is the _q_u_i_c_k _s_u_b_s_t_i_t_u_t_i_o_n character, which is used as - shorthand for re-running the previous command entered, substi- - tuting one string for another in the command, when it appears as - the first character on the line. The default is "^^". The op- - tional third character is the character which indicates that the - remainder of the line is a comment when found as the first char- - acter of a word, normally "##". The history comment character - causes history substitution to be skipped for the remaining - words on the line. It does not necessarily cause the shell - parser to treat the rest of the line as a comment. + is the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, the character which begins a + history expansion, normally "!!". The second character is the + _q_u_i_c_k _s_u_b_s_t_i_t_u_t_i_o_n character, normally "^^". When it appears as + the first character on the line, history substitution repeats + the previous command, replacing one string with another. 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 comment charac- + ter disables history substitution for the remaining words on the + line. It does not necessarily cause the shell parser to treat + the rest of the line as a comment. AArrrraayyss - BBaasshh provides one-dimensional indexed and associative array variables. - Any variable may be used as an indexed array; the ddeeccllaarree builtin will - explicitly declare an array. There is no maximum limit on the size of - an array, nor any requirement that members be indexed or assigned con- - tiguously. Indexed arrays are referenced using integers (including + BBaasshh provides one-dimensional indexed and associative array variables. + Any variable may be used as an indexed array; the ddeeccllaarree builtin will + explicitly declare an array. There is no maximum limit on the size of + an array, nor any requirement that members be indexed or assigned con- + tiguously. Indexed arrays are referenced using integers (including arithmetic expressions) and are zero-based; associative arrays are ref- erenced using arbitrary strings. Unless otherwise noted, indexed array indices must be non-negative integers. - An indexed array is created automatically if any variable is assigned + An indexed array is created automatically if any variable is assigned to using the syntax _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e. The _s_u_b_s_c_r_i_p_t is treated as an arithmetic expression that must evaluate to a number greater than or - equal to zero. To explicitly declare an indexed array, use ddeeccllaarree --aa + equal to zero. To explicitly declare an indexed array, use ddeeccllaarree --aa _n_a_m_e (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). ddeeccllaarree --aa _n_a_m_e[[_s_u_b_s_c_r_i_p_t]] is also accepted; the _s_u_b_s_c_r_i_p_t is ignored. @@ -1581,104 +1581,104 @@ PPAARRAAMMEETTEERRSS rreeaaddoonnllyy builtins. Each attribute applies to all members of an array. Arrays are assigned using compound assignments of the form _n_a_m_e=((value_1 - ... value_n)), where each _v_a_l_u_e may be of the form [_s_u_b_s_c_r_i_p_t]=_s_t_r_i_n_g. - Indexed array assignments do not require anything but _s_t_r_i_n_g. Each - _v_a_l_u_e in the list is expanded using the shell expansions described be- + ... value_n)), where each _v_a_l_u_e may be of the form [_s_u_b_s_c_r_i_p_t]=_s_t_r_i_n_g. + Indexed array assignments do not require anything but _s_t_r_i_n_g. Each + _v_a_l_u_e in the list is expanded using the shell expansions described be- low under EEXXPPAANNSSIIOONN, but _v_a_l_u_es that are valid variable assignments in- - cluding the brackets and subscript do not undergo brace expansion and + cluding the brackets and subscript do not undergo brace expansion and word splitting, as with individual variable assignments. - When assigning to indexed arrays, if the optional brackets and sub- - script are supplied, that index is assigned to; otherwise the index of - the element assigned is the last index assigned to by the statement + When assigning to indexed arrays, if the optional brackets and sub- + script are supplied, that index is assigned to; otherwise the index of + the element assigned is the last index assigned to by the statement plus one. Indexing starts at zero. When assigning to an associative array, the words in a compound assign- - ment may be either assignment statements, for which the subscript is - required, or a list of words that is interpreted as a sequence of al- - ternating keys and values: _n_a_m_e=(( _k_e_y_1 _v_a_l_u_e_1 _k_e_y_2 _v_a_l_u_e_2 ...)). These - are treated identically to _n_a_m_e=(( [_k_e_y_1]=_v_a_l_u_e_1 [_k_e_y_2]=_v_a_l_u_e_2 ...)). - The first word in the list determines how the remaining words are in- - terpreted; all assignments in a list must be of the same type. When - using key/value pairs, the keys may not be missing or empty; a final + ment may be either assignment statements, for which the subscript is + required, or a list of words that is interpreted as a sequence of al- + ternating keys and values: _n_a_m_e=(( _k_e_y_1 _v_a_l_u_e_1 _k_e_y_2 _v_a_l_u_e_2 ...)). These + are treated identically to _n_a_m_e=(( [_k_e_y_1]=_v_a_l_u_e_1 [_k_e_y_2]=_v_a_l_u_e_2 ...)). + The first word in the list determines how the remaining words are in- + terpreted; all assignments in a list must be of the same type. When + using key/value pairs, the keys may not be missing or empty; a final missing value is treated like the empty string. - This syntax is also accepted by the ddeeccllaarree builtin. Individual array - elements may be assigned to using the _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e syntax in- + This syntax is also accepted by the ddeeccllaarree builtin. Individual array + elements may be assigned to using the _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e syntax in- troduced above. - When assigning to an indexed array, if _n_a_m_e is subscripted by a nega- + When assigning to an indexed array, if _n_a_m_e is subscripted by a nega- tive number, that number is interpreted as relative to one greater than - the maximum index of _n_a_m_e, so negative indices count back from the end + the maximum index of _n_a_m_e, so negative indices count back from the end of the array, and an index of -1 references the last element. - The += operator will append to an array variable when assigning using + The += operator will append to an array variable when assigning using the compound assignment syntax; see PPAARRAAMMEETTEERRSS above. - An array element is referenced using ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. The braces - are required to avoid conflicts with pathname expansion. If _s_u_b_s_c_r_i_p_t + An array element is referenced using ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. The braces + are required to avoid conflicts with pathname expansion. If _s_u_b_s_c_r_i_p_t is @@ or **, the word expands to all members of _n_a_m_e, unless noted in the - description of a builtin or word expansion. These subscripts differ - only when the word appears within double quotes. If the word is dou- - ble-quoted, ${_n_a_m_e[*]} expands to a single word with the value of each - array member separated by the first character of the IIFFSS special vari- - able, and ${_n_a_m_e[@]} expands each element of _n_a_m_e to a separate word. + description of a builtin or word expansion. These subscripts differ + only when the word appears within double quotes. If the word is dou- + ble-quoted, ${_n_a_m_e[*]} expands to a single word with the value of each + array member separated by the first character of the IIFFSS special vari- + able, and ${_n_a_m_e[@]} expands each element of _n_a_m_e to a separate word. When there are no array members, ${_n_a_m_e[@]} expands to nothing. If the - double-quoted expansion occurs within a word, the expansion of the - first parameter is joined with the beginning part of the expansion of - the original word, and the expansion of the last parameter is joined - with the last part of the expansion of the original word. This is - analogous to the expansion of the special parameters ** and @@ (see SSppee-- + double-quoted expansion occurs within a word, the expansion of the + first parameter is joined with the beginning part of the expansion of + the original word, and the expansion of the last parameter is joined + with the last part of the expansion of the original word. This is + analogous to the expansion of the special parameters ** and @@ (see SSppee-- cciiaall PPaarraammeetteerrss above). - ${#_n_a_m_e[_s_u_b_s_c_r_i_p_t]} expands to the length of ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. If + ${#_n_a_m_e[_s_u_b_s_c_r_i_p_t]} expands to the length of ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. If _s_u_b_s_c_r_i_p_t is ** or @@, the expansion is the number of elements in the ar- ray. If the _s_u_b_s_c_r_i_p_t used to reference an element of an indexed array eval- - uates to a number less than zero, it is interpreted as relative to one - greater than the maximum index of the array, so negative indices count - back from the end of the array, and an index of -1 references the last + uates to a number less than zero, it is interpreted as relative to one + greater than the maximum index of the array, so negative indices count + back from the end of the array, and an index of -1 references the last element. Referencing an array variable without a subscript is equivalent to ref- - erencing the array with a subscript of 0. Any reference to a variable + erencing the array with a subscript of 0. Any reference to a variable using a valid subscript is valid, and bbaasshh will create an array if nec- essary. - An array variable is considered set if a subscript has been assigned a + An array variable is considered set if a subscript has been assigned a value. The null string is a valid value. - It is possible to obtain the keys (indices) of an array as well as the - values. ${!!_n_a_m_e[_@]} and ${!!_n_a_m_e[_*]} expand to the indices assigned in + It is possible to obtain the keys (indices) of an array as well as the + values. ${!!_n_a_m_e[_@]} and ${!!_n_a_m_e[_*]} expand to the indices assigned in array variable _n_a_m_e. The treatment when in double quotes is similar to the expansion of the special parameters _@ and _* within double quotes. The uunnsseett builtin is used to destroy arrays. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] un- - sets the array element at index _s_u_b_s_c_r_i_p_t, for both indexed and asso- - ciative arrays. Negative subscripts to indexed arrays are interpreted - as described above. Unsetting the last element of an array variable - does not unset the variable. uunnsseett _n_a_m_e, where _n_a_m_e is an array, re- - moves the entire array. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] behaves differently de- - pending on whether _n_a_m_e is an indexed or associative array when _s_u_b_- + sets the array element at index _s_u_b_s_c_r_i_p_t, for both indexed and asso- + ciative arrays. Negative subscripts to indexed arrays are interpreted + as described above. Unsetting the last element of an array variable + does not unset the variable. uunnsseett _n_a_m_e, where _n_a_m_e is an array, re- + moves the entire array. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] behaves differently de- + pending on whether _n_a_m_e is an indexed or associative array when _s_u_b_- _s_c_r_i_p_t is ** or @@. If _n_a_m_e is an associative array, this unsets the el- - ement with subscript ** or @@. If _n_a_m_e is an indexed array, unset re- + ement with subscript ** or @@. If _n_a_m_e is an indexed array, unset re- moves all of the elements but does not remove the array itself. - When using a variable name with a subscript as an argument to a com- - mand, such as with uunnsseett, without using the word expansion syntax de- - scribed above, (e.g., unset a[4]), the argument is subject to pathname - expansion. Quote the argument if pathname expansion is not desired + When using a variable name with a subscript as an argument to a com- + mand, such as with uunnsseett, without using the word expansion syntax de- + scribed above, (e.g., unset a[4]), the argument is subject to pathname + expansion. Quote the argument if pathname expansion is not desired (e.g., unset 'a[4]'). - The ddeeccllaarree, llooccaall, and rreeaaddoonnllyy builtins each accept a --aa option to - specify an indexed array and a --AA option to specify an associative ar- - ray. If both options are supplied, --AA takes precedence. The rreeaadd - builtin accepts a --aa option to assign a list of words read from the + The ddeeccllaarree, llooccaall, and rreeaaddoonnllyy builtins each accept a --aa option to + specify an indexed array and a --AA option to specify an associative ar- + ray. If both options are supplied, --AA takes precedence. The rreeaadd + builtin accepts a --aa option to assign a list of words read from the standard input to an array. The sseett and ddeeccllaarree builtins display array - values in a way that allows them to be reused as assignments. Other - builtins accept array name arguments as well (e.g., mmaappffiillee); see the - descriptions of individual builtins below for details. The shell pro- + values in a way that allows them to be reused as assignments. Other + builtins accept array name arguments as well (e.g., mmaappffiillee); see the + descriptions of individual builtins below for details. The shell pro- vides a number of builtin array variables. EEXXPPAANNSSIIOONN @@ -1688,65 +1688,65 @@ EEXXPPAANNSSIIOONN _m_e_t_i_c _e_x_p_a_n_s_i_o_n, _w_o_r_d _s_p_l_i_t_t_i_n_g, _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, and _q_u_o_t_e _r_e_m_o_v_a_l. The order of expansions is: brace expansion; tilde expansion, parameter - and variable expansion, arithmetic expansion, and command substitution - (done in a left-to-right fashion); word splitting; pathname expansion; + and variable expansion, arithmetic expansion, and command substitution + (done in a left-to-right fashion); word splitting; pathname expansion; and quote removal. On systems that can support it, there is an additional expansion avail- - able: _p_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n. This is performed at the same time as - tilde, parameter, variable, and arithmetic expansion and command sub- + able: _p_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n. This is performed at the same time as + tilde, parameter, variable, and arithmetic expansion and command sub- stitution. - _Q_u_o_t_e _r_e_m_o_v_a_l is always performed last. It removes quote characters - present in the original word, not ones resulting from one of the other + _Q_u_o_t_e _r_e_m_o_v_a_l is always performed last. It removes quote characters + present in the original word, not ones resulting from one of the other expansions, unless they have been quoted themselves. - Only brace expansion, word splitting, and pathname expansion can in- - crease the number of words of the expansion; other expansions expand a - single word to a single word. The only exceptions to this are the ex- + Only brace expansion, word splitting, and pathname expansion can in- + crease the number of words of the expansion; other expansions expand a + single word to a single word. The only exceptions to this are the ex- pansions of ""$$@@"" and ""$${{_n_a_m_e[[@@]]}}"", and, in most cases, $$** and $${{_n_a_m_e[[**]]}} as explained above (see PPAARRAAMMEETTEERRSS). BBrraaccee EExxppaannssiioonn - _B_r_a_c_e _e_x_p_a_n_s_i_o_n is a mechanism to generate arbitrary strings sharing a + _B_r_a_c_e _e_x_p_a_n_s_i_o_n is a mechanism to generate arbitrary strings sharing a common prefix and suffix, either of which can be empty. This mechanism - is similar to _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, but the filenames generated need not - exist. Patterns to be brace expanded are formed from an optional _p_r_e_- - _a_m_b_l_e, followed by either a series of comma-separated strings or a se- - quence expression between a pair of braces, followed by an optional - _p_o_s_t_s_c_r_i_p_t. The preamble is prefixed to each string contained within - the braces, and the postscript is then appended to each resulting + is similar to _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, but the filenames generated need not + exist. Patterns to be brace expanded are formed from an optional _p_r_e_- + _a_m_b_l_e, followed by either a series of comma-separated strings or a se- + quence expression between a pair of braces, followed by an optional + _p_o_s_t_s_c_r_i_p_t. The preamble is prefixed to each string contained within + the braces, and the postscript is then appended to each resulting string, expanding left to right. - Brace expansions may be nested. The results of each expanded string + Brace expansions may be nested. The results of each expanded string are not sorted; brace expansion preserves left to right order. For ex- ample, a{{d,c,b}}e expands into "ade ace abe". - A sequence expression takes the form {{_x...._y[[...._i_n_c_r]]}}, where _x and _y are - either integers or single letters, and _i_n_c_r, an optional increment, is + A sequence expression takes the form {{_x...._y[[...._i_n_c_r]]}}, where _x and _y are + either integers or single letters, and _i_n_c_r, an optional increment, is an integer. When integers are supplied, the expression expands to each - number between _x and _y, inclusive. If the supplied integers are pre- - fixed with _0, each term will have the same width, zero-padding if nec- - essary. When either _x or _y begins with a zero, the shell attempts to - force all generated terms to contain the same number of digits, zero- + number between _x and _y, inclusive. If the supplied integers are pre- + fixed with _0, each term will have the same width, zero-padding if nec- + essary. When either _x or _y begins with a zero, the shell attempts to + force all generated terms to contain the same number of digits, zero- padding where necessary. When letters are supplied, the expression ex- - pands to each character lexicographically between _x and _y, inclusive, + pands to each character lexicographically between _x and _y, inclusive, using the default C locale. Note that both _x and _y must be of the same - type (integer or letter). When the increment is supplied, it is used - as the difference between each term. The default increment is 1 or -1 + type (integer or letter). When the increment is supplied, it is used + as the difference between each term. The default increment is 1 or -1 as appropriate. Brace expansion is performed before any other expansions, and any char- - acters special to other expansions are preserved in the result. It is - strictly textual. BBaasshh does not apply any syntactic interpretation to + acters special to other expansions are preserved in the result. It is + strictly textual. BBaasshh does not apply any syntactic interpretation to the context of the expansion or the text between the braces. - A correctly-formed brace expansion must contain unquoted opening and + A correctly-formed brace expansion must contain unquoted opening and closing braces, and at least one unquoted comma or a valid sequence ex- pression. Any incorrectly formed brace expansion is left unchanged. A {{ or ,, may be quoted with a backslash to prevent its being considered - part of a brace expression. To avoid conflicts with parameter expan- + part of a brace expression. To avoid conflicts with parameter expan- sion, the string $${{ is not considered eligible for brace expansion, and inhibits brace expansion until the closing }}. @@ -1757,67 +1757,67 @@ EEXXPPAANNSSIIOONN or chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} - Brace expansion introduces a slight incompatibility with historical - versions of sshh. sshh does not treat opening or closing braces specially - when they appear as part of a word, and preserves them in the output. - BBaasshh removes braces from words as a consequence of brace expansion. - For example, a word entered to sshh as _f_i_l_e_{_1_,_2_} appears identically in - the output. BBaasshh outputs that word as _f_i_l_e_1 _f_i_l_e_2 after brace expan- - sion. Start bbaasshh with the ++BB option or disable brace expansion with + Brace expansion introduces a slight incompatibility with historical + versions of sshh. sshh does not treat opening or closing braces specially + when they appear as part of a word, and preserves them in the output. + BBaasshh removes braces from words as a consequence of brace expansion. + For example, a word entered to sshh as _f_i_l_e_{_1_,_2_} appears identically in + the output. BBaasshh outputs that word as _f_i_l_e_1 _f_i_l_e_2 after brace expan- + sion. Start bbaasshh with the ++BB option or disable brace expansion with the ++BB option to the sseett command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) for strict sshh compatibility. TTiillddee EExxppaannssiioonn - If a word begins with an unquoted tilde character ("~~"), all of the - characters preceding the first unquoted slash (or all characters, if - there is no unquoted slash) are considered a _t_i_l_d_e_-_p_r_e_f_i_x. If none of - the characters in the tilde-prefix are quoted, the characters in the - tilde-prefix following the tilde are treated as a possible _l_o_g_i_n _n_a_m_e. - If this login name is the null string, the tilde is replaced with the + If a word begins with an unquoted tilde character ("~~"), all of the + characters preceding the first unquoted slash (or all characters, if + there is no unquoted slash) are considered a _t_i_l_d_e_-_p_r_e_f_i_x. If none of + the characters in the tilde-prefix are quoted, the characters in the + tilde-prefix following the tilde are treated as a possible _l_o_g_i_n _n_a_m_e. + If this login name is the null string, the tilde is replaced with the value of the shell parameter HHOOMMEE. If HHOOMMEE is unset, the tilde expands - to the home directory of the user executing the shell instead. Other- - wise, the tilde-prefix is replaced with the home directory associated + to the home directory of the user executing the shell instead. Other- + wise, 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 PPWWDD re- + If the tilde-prefix is a "~+", the value of the shell variable PPWWDD re- places the tilde-prefix. If the tilde-prefix is a "~-", the shell sub- - stitutes the value of the shell variable OOLLDDPPWWDD, if it is set. If the - characters following the tilde in the tilde-prefix consist of a number - _N, optionally prefixed by a "+" or a "-", the tilde-prefix is replaced + stitutes the value of the shell variable OOLLDDPPWWDD, if it is set. If the + characters following the tilde in the tilde-prefix consist of a number + _N, optionally prefixed by a "+" or a "-", the tilde-prefix is replaced with the corresponding element from the directory stack, as it would be displayed by the ddiirrss builtin invoked with the characters following the - tilde in the tilde-prefix as an argument. If the characters following + tilde in the tilde-prefix as an argument. If the characters following the tilde in the tilde-prefix consist of a number without a leading "+" or "-", tilde expansion assumes "+". - The results of tilde expansion are treated as if they were quoted, so - the replacement is not subject to word splitting and pathname expan- + The results of tilde expansion are treated as if they were quoted, so + the replacement is not subject to word splitting and pathname expan- sion. - If the login name is invalid, or the tilde expansion fails, the tilde- + If the login name is invalid, or the tilde expansion fails, the tilde- prefix is unchanged. - BBaasshh checks each variable assignment for unquoted tilde-prefixes imme- - diately following a :: or the first ==, and performs tilde expansion in - these cases. Consequently, one may use filenames with tildes in as- - signments to PPAATTHH, MMAAIILLPPAATTHH, and CCDDPPAATTHH, and the shell assigns the ex- + BBaasshh checks each variable assignment for unquoted tilde-prefixes imme- + diately following a :: or the first ==, and performs tilde expansion in + these cases. Consequently, one may use filenames with tildes in as- + signments to PPAATTHH, MMAAIILLPPAATTHH, and CCDDPPAATTHH, and the shell assigns the ex- panded value. - BBaasshh also performs tilde expansion on words satisfying the conditions + BBaasshh also performs tilde expansion on words satisfying the conditions of variable assignments (as described above under PPAARRAAMMEETTEERRSS) when they - appear as arguments to simple commands. BBaasshh does not do this, except - for the _d_e_c_l_a_r_a_t_i_o_n commands listed above, when in _p_o_s_i_x _m_o_d_e. + appear as arguments to simple commands. BBaasshh does not do this, except + for the _d_e_c_l_a_r_a_t_i_o_n commands listed above, when in posix mode. PPaarraammeetteerr EExxppaannssiioonn The "$$" character introduces parameter expansion, command substitution, - or arithmetic expansion. The parameter name or symbol to be expanded - may be enclosed in braces, which are optional but serve to protect the - variable to be expanded from characters immediately following it which + or arithmetic expansion. The parameter name or symbol to be expanded + may be enclosed in braces, which are optional but serve to protect the + variable to be expanded from characters immediately following it which could be interpreted as part of the name. - When braces are used, the matching ending brace is the first "}}" not + When braces are used, the matching ending brace is the first "}}" not escaped by a backslash or within a quoted string, and not within an em- - bedded arithmetic expansion, command substitution, or parameter expan- + bedded arithmetic expansion, command substitution, or parameter expan- sion. The basic form of parameter expansion is @@ -1825,124 +1825,124 @@ EEXXPPAANNSSIIOONN ${_p_a_r_a_m_e_t_e_r} which substitutes the value of _p_a_r_a_m_e_t_e_r. The braces are required when - _p_a_r_a_m_e_t_e_r is a positional parameter with more than one digit, or when - _p_a_r_a_m_e_t_e_r is followed by a character which is not to be interpreted as - part of its name. The _p_a_r_a_m_e_t_e_r is a shell parameter as described + _p_a_r_a_m_e_t_e_r is a positional parameter with more than one digit, or when + _p_a_r_a_m_e_t_e_r is followed by a character which is not to be interpreted as + part of its name. The _p_a_r_a_m_e_t_e_r is a shell parameter as described above PPAARRAAMMEETTEERRSS) or an array reference (AArrrraayyss). - If the first character of _p_a_r_a_m_e_t_e_r is an exclamation point (!!), and + If the first character of _p_a_r_a_m_e_t_e_r is an exclamation point (!!), and _p_a_r_a_m_e_t_e_r is not a _n_a_m_e_r_e_f, it introduces a level of indirection. BBaasshh uses the value formed by expanding the rest of _p_a_r_a_m_e_t_e_r as the new _p_a_- - _r_a_m_e_t_e_r; this new parameter is then expanded and that value is used in - the rest of the expansion, rather than the expansion of the original - _p_a_r_a_m_e_t_e_r. This is known as _i_n_d_i_r_e_c_t _e_x_p_a_n_s_i_o_n. The value is subject - to tilde expansion, parameter expansion, command substitution, and - arithmetic expansion. If _p_a_r_a_m_e_t_e_r is a nameref, this expands to the + _r_a_m_e_t_e_r; this new parameter is then expanded and that value is used in + the rest of the expansion, rather than the expansion of the original + _p_a_r_a_m_e_t_e_r. This is known as _i_n_d_i_r_e_c_t _e_x_p_a_n_s_i_o_n. The value is subject + to tilde expansion, parameter expansion, command substitution, and + arithmetic expansion. If _p_a_r_a_m_e_t_e_r is a nameref, this expands to the name of the parameter referenced by _p_a_r_a_m_e_t_e_r instead of performing the complete indirect expansion, for compatibility. The exceptions to this are the expansions of ${!!_p_r_e_f_i_x**} and ${!!_n_a_m_e[_@]} described below. The - exclamation point must immediately follow the left brace in order to + exclamation point must immediately follow the left brace in order to introduce indirection. In each of the cases below, _w_o_r_d is subject to tilde expansion, parame- ter expansion, command substitution, and arithmetic expansion. When not performing substring expansion, using the forms documented be- - low (e.g., ::--), bbaasshh tests for a parameter that is unset or null. + low (e.g., ::--), bbaasshh tests for a parameter that is unset or null. Omitting the colon tests only for a parameter that is unset. ${_p_a_r_a_m_e_t_e_r::--_w_o_r_d} - UUssee DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the expan- - sion of _w_o_r_d is substituted. Otherwise, the value of _p_a_r_a_m_e_t_e_r + UUssee DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the expan- + sion of _w_o_r_d is substituted. Otherwise, the value of _p_a_r_a_m_e_t_e_r is substituted. ${_p_a_r_a_m_e_t_e_r::==_w_o_r_d} - AAssssiiggnn DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the ex- - pansion of _w_o_r_d is assigned to _p_a_r_a_m_e_t_e_r, and the expansion is + AAssssiiggnn DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the ex- + pansion of _w_o_r_d is assigned to _p_a_r_a_m_e_t_e_r, and the expansion is the final value of _p_a_r_a_m_e_t_e_r. Positional parameters and special parameters may not be assigned in this way. ${_p_a_r_a_m_e_t_e_r::??_w_o_r_d} - DDiissppllaayy EErrrroorr iiff NNuullll oorr UUnnsseett. If _p_a_r_a_m_e_t_e_r is null or unset, + DDiissppllaayy EErrrroorr iiff NNuullll oorr UUnnsseett. If _p_a_r_a_m_e_t_e_r is null or unset, the shell writes the expansion of _w_o_r_d (or a message to that ef- fect if _w_o_r_d is not present) to the standard error and, if it is - not interactive, exits with a non-zero status. An interactive + not interactive, exits with a non-zero status. An interactive shell does not exit, but does not execute the command associated - with the expansion. Otherwise, the value of _p_a_r_a_m_e_t_e_r is sub- + with the expansion. Otherwise, the value of _p_a_r_a_m_e_t_e_r is sub- stituted. ${_p_a_r_a_m_e_t_e_r::++_w_o_r_d} - UUssee AAlltteerrnnaattee VVaalluuee. If _p_a_r_a_m_e_t_e_r is null or unset, nothing is - substituted, otherwise the expansion of _w_o_r_d is substituted. + UUssee AAlltteerrnnaattee VVaalluuee. If _p_a_r_a_m_e_t_e_r is null or unset, nothing is + substituted, otherwise the expansion of _w_o_r_d is substituted. The value of _p_a_r_a_m_e_t_e_r is not used. ${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t} ${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t::_l_e_n_g_t_h} - SSuubbssttrriinngg EExxppaannssiioonn. Expands to up to _l_e_n_g_t_h characters of the - value of _p_a_r_a_m_e_t_e_r starting at the character specified by _o_f_f_- - _s_e_t. If _p_a_r_a_m_e_t_e_r is @@ or **, an indexed array subscripted by @@ - or **, or an associative array name, the results differ as de- - scribed below. If _l_e_n_g_t_h is omitted, expands to the substring + SSuubbssttrriinngg EExxppaannssiioonn. Expands to up to _l_e_n_g_t_h characters of the + value of _p_a_r_a_m_e_t_e_r starting at the character specified by _o_f_f_- + _s_e_t. If _p_a_r_a_m_e_t_e_r is @@ or **, an indexed array subscripted by @@ + or **, or an associative array name, the results differ as de- + scribed below. If _l_e_n_g_t_h is omitted, expands to the substring of the value of _p_a_r_a_m_e_t_e_r starting at the character specified by _o_f_f_s_e_t and extending to the end of the value. _l_e_n_g_t_h and _o_f_f_s_e_t are arithmetic expressions (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN below). - If _o_f_f_s_e_t evaluates to a number less than zero, the value is + If _o_f_f_s_e_t evaluates to a number less than zero, the value is used as an offset in characters from the end of the value of _p_a_- - _r_a_m_e_t_e_r. If _l_e_n_g_t_h evaluates to a number less than zero, it is + _r_a_m_e_t_e_r. If _l_e_n_g_t_h evaluates to a number less than zero, it is interpreted as an offset in characters from the end of the value - of _p_a_r_a_m_e_t_e_r rather than a number of characters, and the expan- - sion is the characters between _o_f_f_s_e_t and that result. Note - that a negative offset must be separated from the colon by at + of _p_a_r_a_m_e_t_e_r rather than a number of characters, and the expan- + sion is the characters between _o_f_f_s_e_t and that result. Note + that a negative offset must be separated from the colon by at least one space to avoid being confused with the ::-- expansion. - If _p_a_r_a_m_e_t_e_r is @@ or **, the result is _l_e_n_g_t_h positional parame- - ters beginning at _o_f_f_s_e_t. A negative _o_f_f_s_e_t is taken relative - to one greater than the greatest positional parameter, so an + If _p_a_r_a_m_e_t_e_r is @@ or **, the result is _l_e_n_g_t_h positional parame- + ters beginning at _o_f_f_s_e_t. A negative _o_f_f_s_e_t is taken relative + to one greater than the greatest positional parameter, so an offset of -1 evaluates to the last positional parameter (or 0 if - there are no positional parameters). It is an expansion error + there are no positional parameters). It is an expansion error if _l_e_n_g_t_h evaluates to a number less than zero. If _p_a_r_a_m_e_t_e_r is an indexed array name subscripted by @ or *, the result is the _l_e_n_g_t_h members of the array beginning with ${_p_a_r_a_- - _m_e_t_e_r[_o_f_f_s_e_t]}. A negative _o_f_f_s_e_t is taken relative to one + _m_e_t_e_r[_o_f_f_s_e_t]}. A negative _o_f_f_s_e_t is taken relative to one greater than the maximum index of the specified array. It is an expansion error if _l_e_n_g_t_h evaluates to a number less than zero. Substring expansion applied to an associative array produces un- defined results. - Substring indexing is zero-based unless the positional parame- - ters are used, in which case the indexing starts at 1 by de- - fault. If _o_f_f_s_e_t is 0, and the positional parameters are used, + Substring indexing is zero-based unless the positional parame- + ters are used, in which case the indexing starts at 1 by de- + fault. If _o_f_f_s_e_t is 0, and the positional parameters are used, $$00 is prefixed to the list. ${!!_p_r_e_f_i_x**} ${!!_p_r_e_f_i_x@@} - NNaammeess mmaattcchhiinngg pprreeffiixx. Expands to the names of variables whose + NNaammeess mmaattcchhiinngg pprreeffiixx. Expands to the names of variables whose names begin with _p_r_e_f_i_x, separated by the first character of the - IIFFSS special variable. When _@ is used and the expansion appears - within double quotes, each variable name expands to a separate + IIFFSS special variable. When _@ is used and the expansion appears + within double quotes, each variable name expands to a separate word. ${!!_n_a_m_e[_@]} ${!!_n_a_m_e[_*]} - LLiisstt ooff aarrrraayy kkeeyyss. If _n_a_m_e is an array variable, expands to - the list of array indices (keys) assigned in _n_a_m_e. If _n_a_m_e is - not an array, expands to 0 if _n_a_m_e is set and null otherwise. - When _@ is used and the expansion appears within double quotes, + LLiisstt ooff aarrrraayy kkeeyyss. If _n_a_m_e is an array variable, expands to + the list of array indices (keys) assigned in _n_a_m_e. If _n_a_m_e is + not an array, expands to 0 if _n_a_m_e is set and null otherwise. + When _@ is used and the expansion appears within double quotes, each key expands to a separate word. ${##_p_a_r_a_m_e_t_e_r} - PPaarraammeetteerr lleennggtthh. Substitutes the length in characters of the - expanded value of _p_a_r_a_m_e_t_e_r. If _p_a_r_a_m_e_t_e_r is ** or @@, the value - substituted is the number of positional parameters. If _p_a_r_a_m_e_- - _t_e_r is an array name subscripted by ** or @@, the value substi- - tuted is the number of elements in the array. If _p_a_r_a_m_e_t_e_r is - an indexed array name subscripted by a negative number, that - number is interpreted as relative to one greater than the maxi- - mum index of _p_a_r_a_m_e_t_e_r, so negative indices count back from the - end of the array, and an index of -1 references the last ele- + PPaarraammeetteerr lleennggtthh. Substitutes the length in characters of the + expanded value of _p_a_r_a_m_e_t_e_r. If _p_a_r_a_m_e_t_e_r is ** or @@, the value + substituted is the number of positional parameters. If _p_a_r_a_m_e_- + _t_e_r is an array name subscripted by ** or @@, the value substi- + tuted is the number of elements in the array. If _p_a_r_a_m_e_t_e_r is + an indexed array name subscripted by a negative number, that + number is interpreted as relative to one greater than the maxi- + mum index of _p_a_r_a_m_e_t_e_r, so negative indices count back from the + end of the array, and an index of -1 references the last ele- ment. ${_p_a_r_a_m_e_t_e_r##_w_o_r_d} @@ -1950,15 +1950,15 @@ EEXXPPAANNSSIIOONN RReemmoovvee mmaattcchhiinngg pprreeffiixx ppaatttteerrnn. The _w_o_r_d is expanded to produce a pattern just as in pathname expansion, and matched against the expanded value of _p_a_r_a_m_e_t_e_r using the rules described under PPaatt-- - tteerrnn MMaattcchhiinngg below. If the pattern matches the beginning of - the value of _p_a_r_a_m_e_t_e_r, then the result of the expansion is the - expanded value of _p_a_r_a_m_e_t_e_r with the shortest matching pattern - (the "#" case) or the longest matching pattern (the "##" case) - deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the pattern removal operation - is applied to each positional parameter in turn, and the expan- - sion is the resultant list. If _p_a_r_a_m_e_t_e_r is an array variable - subscripted with @@ or **, the pattern removal operation is ap- - plied to each member of the array in turn, and the expansion is + tteerrnn MMaattcchhiinngg below. If the pattern matches the beginning of + the value of _p_a_r_a_m_e_t_e_r, then the result of the expansion is the + expanded value of _p_a_r_a_m_e_t_e_r with the shortest matching pattern + (the "#" case) or the longest matching pattern (the "##" case) + deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the pattern removal operation + is applied to each positional parameter in turn, and the expan- + sion is the resultant list. If _p_a_r_a_m_e_t_e_r is an array variable + subscripted with @@ or **, the pattern removal operation is ap- + plied to each member of the array in turn, and the expansion is the resultant list. ${_p_a_r_a_m_e_t_e_r%%_w_o_r_d} @@ -1966,15 +1966,15 @@ EEXXPPAANNSSIIOONN RReemmoovvee mmaattcchhiinngg ssuuffffiixx ppaatttteerrnn. The _w_o_r_d is expanded to produce a pattern just as in pathname expansion, and matched against the expanded value of _p_a_r_a_m_e_t_e_r using the rules described under PPaatt-- - tteerrnn MMaattcchhiinngg below. If the pattern matches a trailing portion - of the expanded value of _p_a_r_a_m_e_t_e_r, then the result of the ex- - pansion is the expanded value of _p_a_r_a_m_e_t_e_r with the shortest - matching pattern (the "%" case) or the longest matching pattern - (the "%%" case) deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the pattern - removal operation is applied to each positional parameter in - turn, and the expansion is the resultant list. If _p_a_r_a_m_e_t_e_r is - an array variable subscripted with @@ or **, the pattern removal - operation is applied to each member of the array in turn, and + tteerrnn MMaattcchhiinngg below. If the pattern matches a trailing portion + of the expanded value of _p_a_r_a_m_e_t_e_r, then the result of the ex- + pansion is the expanded value of _p_a_r_a_m_e_t_e_r with the shortest + matching pattern (the "%" case) or the longest matching pattern + (the "%%" case) deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the pattern + removal operation is applied to each positional parameter in + turn, and the expansion is the resultant list. If _p_a_r_a_m_e_t_e_r is + an array variable subscripted with @@ or **, the pattern removal + operation is applied to each member of the array in turn, and the expansion is the resultant list. ${_p_a_r_a_m_e_t_e_r//_p_a_t_t_e_r_n//_s_t_r_i_n_g} @@ -1982,127 +1982,127 @@ EEXXPPAANNSSIIOONN ${_p_a_r_a_m_e_t_e_r//##_p_a_t_t_e_r_n//_s_t_r_i_n_g} ${_p_a_r_a_m_e_t_e_r//%%_p_a_t_t_e_r_n//_s_t_r_i_n_g} PPaatttteerrnn ssuubbssttiittuuttiioonn. The _p_a_t_t_e_r_n is expanded to produce a pat- - tern just as in pathname expansion and matched against the ex- - panded value of _p_a_r_a_m_e_t_e_r using the rules described under PPaatt-- - tteerrnn MMaattcchhiinngg below. The longest match of _p_a_t_t_e_r_n in the ex- - panded value is replaced with _s_t_r_i_n_g. _s_t_r_i_n_g undergoes tilde - expansion, parameter and variable expansion, arithmetic expan- + tern just as in pathname expansion and matched against the ex- + panded value of _p_a_r_a_m_e_t_e_r using the rules described under PPaatt-- + tteerrnn MMaattcchhiinngg below. The longest match of _p_a_t_t_e_r_n in the ex- + panded value is replaced with _s_t_r_i_n_g. _s_t_r_i_n_g undergoes tilde + expansion, parameter and variable expansion, arithmetic expan- sion, command and process substitution, and quote removal. - In the first form above, only the first match is replaced. If + In the first form above, only the first match is replaced. If there are two slashes separating _p_a_r_a_m_e_t_e_r and _p_a_t_t_e_r_n (the sec- - ond form above), all matches of _p_a_t_t_e_r_n are replaced with - _s_t_r_i_n_g. If _p_a_t_t_e_r_n is preceded by ## (the third form above), it - must match at the beginning of the expanded value of _p_a_r_a_m_e_t_e_r. - If _p_a_t_t_e_r_n is preceded by %% (the fourth form above), it must + ond form above), all matches of _p_a_t_t_e_r_n are replaced with + _s_t_r_i_n_g. If _p_a_t_t_e_r_n is preceded by ## (the third form above), it + must match at the beginning of the expanded value of _p_a_r_a_m_e_t_e_r. + If _p_a_t_t_e_r_n is preceded by %% (the fourth form above), it must match at the end of the expanded value of _p_a_r_a_m_e_t_e_r. - If the expansion of _s_t_r_i_n_g is null, matches of _p_a_t_t_e_r_n are + If the expansion of _s_t_r_i_n_g is null, matches of _p_a_t_t_e_r_n are deleted and the // following _p_a_t_t_e_r_n may be omitted. - If the ppaattssuubb__rreeppllaacceemmeenntt shell option is enabled using sshhoopptt, - any unquoted instances of && in _s_t_r_i_n_g are replaced with the + If the ppaattssuubb__rreeppllaacceemmeenntt shell option is enabled using sshhoopptt, + any unquoted instances of && in _s_t_r_i_n_g are replaced with the matching portion of _p_a_t_t_e_r_n. Quoting any part of _s_t_r_i_n_g inhibits replacement in the expansion - of the quoted portion, including replacement strings stored in - shell variables. Backslash will escape && in _s_t_r_i_n_g; the back- - slash is removed in order to permit a literal && in the replace- - ment string. Backslash can also be used to escape a backslash; - \\\\ results in a literal backslash in the replacement. Users - should take care if _s_t_r_i_n_g is double-quoted to avoid unwanted - interactions between the backslash and double-quoting, since - backslash has special meaning within double quotes. Pattern - substitution performs the check for unquoted && after expanding + of the quoted portion, including replacement strings stored in + shell variables. Backslash will escape && in _s_t_r_i_n_g; the back- + slash is removed in order to permit a literal && in the replace- + ment string. Backslash can also be used to escape a backslash; + \\\\ results in a literal backslash in the replacement. Users + should take care if _s_t_r_i_n_g is double-quoted to avoid unwanted + interactions between the backslash and double-quoting, since + backslash has special meaning within double quotes. Pattern + substitution performs the check for unquoted && after expanding _s_t_r_i_n_g; shell programmers should quote any occurrences of && they want to be taken literally in the replacement and ensure any in- stances of && they want to be replaced are unquoted. - Like the pattern removal operators, double quotes surrounding + Like the pattern removal operators, double quotes surrounding the replacement string quote the expanded characters, while dou- - ble quotes enclosing the entire parameter substitution do not, - since the expansion is performed in a context that doesn't take + ble quotes enclosing the entire parameter substitution do not, + since the expansion is performed in a context that doesn't take any enclosing double quotes into account. - If the nnooccaasseemmaattcchh shell option is enabled, the match is per- + If the nnooccaasseemmaattcchh shell option is enabled, the match is per- formed without regard to the case of alphabetic characters. If _p_a_r_a_m_e_t_e_r is @@ or **, the substitution operation is applied to - each positional parameter in turn, and the expansion is the re- - sultant list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted - with @@ or **, the substitution operation is applied to each mem- - ber of the array in turn, and the expansion is the resultant + each positional parameter in turn, and the expansion is the re- + sultant list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted + with @@ or **, the substitution operation is applied to each mem- + ber of the array in turn, and the expansion is the resultant list. ${_p_a_r_a_m_e_t_e_r^^_p_a_t_t_e_r_n} ${_p_a_r_a_m_e_t_e_r^^^^_p_a_t_t_e_r_n} ${_p_a_r_a_m_e_t_e_r,,_p_a_t_t_e_r_n} ${_p_a_r_a_m_e_t_e_r,,,,_p_a_t_t_e_r_n} - CCaassee mmooddiiffiiccaattiioonn. This expansion modifies the case of alpha- - betic characters in _p_a_r_a_m_e_t_e_r. The _p_a_t_t_e_r_n is expanded to pro- + CCaassee mmooddiiffiiccaattiioonn. This expansion modifies the case of alpha- + betic characters in _p_a_r_a_m_e_t_e_r. The _p_a_t_t_e_r_n is expanded to pro- duce a pattern just as in pathname expansion. Each character in - the expanded value of _p_a_r_a_m_e_t_e_r is tested against _p_a_t_t_e_r_n, and, - if it matches the pattern, its case is converted. The pattern + the expanded value of _p_a_r_a_m_e_t_e_r is tested against _p_a_t_t_e_r_n, 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 _p_a_t_t_e_r_n to + The ^^ operator converts lowercase letters matching _p_a_t_t_e_r_n to uppercase; the ,, operator converts matching uppercase letters to - lowercase. The ^^^^ and ,,,, expansions convert each matched char- - acter in the expanded value; the ^^ and ,, expansions match and + lowercase. The ^^^^ and ,,,, expansions convert each matched char- + acter in the expanded value; the ^^ and ,, expansions match and convert only the first character in the expanded value. If _p_a_t_- - _t_e_r_n is omitted, it is treated like a ??, which matches every + _t_e_r_n is omitted, it is treated like a ??, which matches every character. - If _p_a_r_a_m_e_t_e_r is @@ or **, the case modification operation is ap- + If _p_a_r_a_m_e_t_e_r is @@ or **, the case modification operation is ap- plied to each positional parameter in turn, and the expansion is - the resultant list. If _p_a_r_a_m_e_t_e_r is an array variable sub- + the resultant list. If _p_a_r_a_m_e_t_e_r is an array variable sub- scripted with @@ or **, the case modification operation is applied - to each member of the array in turn, and the expansion is the + to each member of the array in turn, and the expansion is the resultant list. ${_p_a_r_a_m_e_t_e_r@@_o_p_e_r_a_t_o_r} PPaarraammeetteerr ttrraannssffoorrmmaattiioonn. The expansion is either a transforma- - tion of the value of _p_a_r_a_m_e_t_e_r or information about _p_a_r_a_m_e_t_e_r - itself, depending on the value of _o_p_e_r_a_t_o_r. Each _o_p_e_r_a_t_o_r is a + tion of the value of _p_a_r_a_m_e_t_e_r or information about _p_a_r_a_m_e_t_e_r + itself, depending on the value of _o_p_e_r_a_t_o_r. Each _o_p_e_r_a_t_o_r is a single letter: - UU The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r - with lowercase alphabetic characters converted to upper- + UU The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r + with lowercase alphabetic characters converted to upper- case. - uu The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r + uu The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r with the first character converted to uppercase, if it is alphabetic. - LL The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r - with uppercase alphabetic characters converted to lower- + LL The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r + with uppercase alphabetic characters converted to lower- case. - QQ The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r + QQ The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r quoted in a format that can be reused as input. - EE The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r - with backslash escape sequences expanded as with the + EE The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r + with backslash escape sequences expanded as with the $$''...'' quoting mechanism. PP The expansion is a string that is the result of expanding the value of _p_a_r_a_m_e_t_e_r as if it were a prompt string (see PPRROOMMPPTTIINNGG below). - AA The expansion is a string in the form of an assignment - statement or ddeeccllaarree command that, if evaluated, will + AA The expansion is a string in the form of an assignment + statement or ddeeccllaarree command that, if evaluated, will recreate _p_a_r_a_m_e_t_e_r with its attributes and value. - KK Produces a possibly-quoted version of the value of _p_a_r_a_- - _m_e_t_e_r, except that it prints the values of indexed and - associative arrays as a sequence of quoted key-value + KK Produces a possibly-quoted version of the value of _p_a_r_a_- + _m_e_t_e_r, except that it prints the values of indexed and + associative arrays as a sequence of quoted key-value pairs (see AArrrraayyss above). The keys and values are quoted in a format that can be reused as input. - aa The expansion is a string consisting of flag values rep- + aa The expansion is a string consisting of flag values rep- resenting _p_a_r_a_m_e_t_e_r's attributes. - kk Like the K transformation, but expands the keys and val- - ues of indexed and associative arrays to separate words + kk Like the K transformation, but expands the keys and val- + ues of indexed and associative arrays to separate words after word splitting. - If _p_a_r_a_m_e_t_e_r is @@ or **, the operation is applied to each posi- - tional parameter in turn, and the expansion is the resultant - list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted with @@ or + If _p_a_r_a_m_e_t_e_r is @@ or **, the operation is applied to each posi- + tional parameter in turn, and the expansion is the resultant + list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted with @@ or **, the operation is applied to each member of the array in turn, and the expansion is the resultant list. - The result of the expansion is subject to word splitting and + The result of the expansion is subject to word splitting and pathname expansion as described below. CCoommmmaanndd SSuubbssttiittuuttiioonn @@ -2116,46 +2116,46 @@ EEXXPPAANNSSIIOONN BBaasshh performs the expansion by executing _c_o_m_m_a_n_d in a subshell environ- ment and replacing the command substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are - not deleted, but they may be removed during word splitting. The com- - mand substitution $$((ccaatt _f_i_l_e)) can be replaced by the equivalent but + not deleted, but they may be removed during word splitting. The com- + mand substitution $$((ccaatt _f_i_l_e)) can be replaced by the equivalent but faster $$((<< _f_i_l_e)). - With the old-style backquote form of substitution, backslash retains - its literal meaning except when followed by $$, ``, or \\. The first - backquote not preceded by a backslash terminates the command substitu- - tion. When using the $(_c_o_m_m_a_n_d) form, all characters between the + With the old-style backquote form of substitution, backslash retains + its literal meaning except when followed by $$, ``, or \\. The first + backquote not preceded by a backslash terminates the command substitu- + tion. When using the $(_c_o_m_m_a_n_d) form, all characters between the parentheses make up the command; none are treated specially. There is an alternate form of command substitution: $${{_c _c_o_m_m_a_n_d;;}} - which executes _c_o_m_m_a_n_d in the current execution environment and cap- + which executes _c_o_m_m_a_n_d in the current execution environment and cap- tures its output, again with trailing newlines removed. The character _c following the open brace must be a space, tab, newline, - or ||, and the close brace must be in a position where a reserved word - may appear (i.e., preceded by a command terminator such as semicolon). + or ||, and the close brace must be in a position where a reserved word + may appear (i.e., preceded by a command terminator such as semicolon). BBaasshh allows the close brace to be joined to the remaining characters in - the word without being followed by a shell metacharacter as a reserved + the word without being followed by a shell metacharacter as a reserved word would usually require. Any side effects of _c_o_m_m_a_n_d take effect immediately in the current exe- - cution environment and persist in the current environment after the + cution environment and persist in the current environment after the command completes (e.g., the eexxiitt builtin will exit the shell). - This type of command substitution superficially resembles executing an - unnamed shell function: local variables are created as when a shell - function is executing, and the rreettuurrnn builtin forces _c_o_m_m_a_n_d to com- - plete; however, the rest of the execution environment, including the + This type of command substitution superficially resembles executing an + unnamed shell function: local variables are created as when a shell + function is executing, and the rreettuurrnn builtin forces _c_o_m_m_a_n_d to com- + plete; however, the rest of the execution environment, including the positional parameters, is shared with the caller. - If the first character following the open brace is a ||, the construct - expands to the value of the RREEPPLLYY shell variable after _c_o_m_m_a_n_d exe- - cutes, without removing any trailing newlines, and the standard output - of _c_o_m_m_a_n_d remains the same as in the calling shell. BBaasshh creates RREE-- + If the first character following the open brace is a ||, the construct + expands to the value of the RREEPPLLYY shell variable after _c_o_m_m_a_n_d exe- + cutes, without removing any trailing newlines, and the standard output + of _c_o_m_m_a_n_d remains the same as in the calling shell. BBaasshh creates RREE-- PPLLYY as an initially-unset local variable when _c_o_m_m_a_n_d executes, and re- - stores RREEPPLLYY to the value it had before the command substitution after + stores RREEPPLLYY to the value it had before the command substitution after _c_o_m_m_a_n_d completes, as with any local variable. Command substitutions may be nested. To nest when using the backquoted @@ -2170,117 +2170,117 @@ EEXXPPAANNSSIIOONN $$((((_e_x_p_r_e_s_s_i_o_n)))) - The _e_x_p_r_e_s_s_i_o_n undergoes the same expansions as if it were within dou- - ble quotes, but double quote characters in _e_x_p_r_e_s_s_i_o_n are not treated - specially and are removed. All tokens in the expression undergo para- - meter and variable expansion, command substitution, and quote removal. - The result is treated as the arithmetic expression to be evaluated. + The _e_x_p_r_e_s_s_i_o_n undergoes the same expansions as if it were within dou- + ble quotes, but double quote characters in _e_x_p_r_e_s_s_i_o_n are not treated + specially and are removed. All tokens in the expression undergo para- + meter and variable expansion, command substitution, and quote removal. + The result is treated as the arithmetic expression to be evaluated. Arithmetic expansions may be nested. - The evaluation is performed according to the rules listed below under + The evaluation is performed according to the rules listed below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If _e_x_p_r_e_s_s_i_o_n is invalid, bbaasshh prints a message - to standard error indicating failure, does not perform the substitu- + to standard error indicating failure, does not perform the substitu- tion, and does not execute the command associated with the expansion. PPrroocceessss SSuubbssttiittuuttiioonn - _P_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n allows a process's input or output to be referred - to using a filename. It takes the form of <<((_l_i_s_t)) or >>((_l_i_s_t)). The - process _l_i_s_t is run asynchronously, and its input or output appears as + _P_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n allows a process's input or output to be referred + to using a filename. It takes the form of <<((_l_i_s_t)) or >>((_l_i_s_t)). The + process _l_i_s_t is run asynchronously, and its input or output appears as a filename. This filename is passed as an argument to the current com- mand as the result of the expansion. If the >>((_l_i_s_t)) form is used, writing to the file will provide input for - _l_i_s_t. If the <<((_l_i_s_t)) form is used, reading the file will obtain the - output of _l_i_s_t. No space may appear between the << or >> and the left + _l_i_s_t. If the <<((_l_i_s_t)) form is used, reading the file will obtain the + output of _l_i_s_t. No space may appear between the << or >> and the left parenthesis, otherwise the construct would be interpreted as a redirec- tion. - Process substitution is supported on systems that support named pipes + Process substitution is supported on systems that support named pipes (_F_I_F_O_s) or the //ddeevv//ffdd method of naming open files. - When available, process substitution is performed simultaneously with - parameter and variable expansion, command substitution, and arithmetic + When available, process substitution is performed simultaneously with + parameter and variable expansion, command substitution, and arithmetic expansion. WWoorrdd SSpplliittttiinngg - The shell scans the results of parameter expansion, command substitu- - tion, and arithmetic expansion that did not occur within double quotes + The shell scans the results of parameter expansion, command substitu- + tion, and arithmetic expansion that did not occur within double quotes for _w_o_r_d _s_p_l_i_t_t_i_n_g. - The shell treats each character of IIFFSS as a delimiter, and splits the - results of the other expansions into words using these characters as + The shell treats each character of IIFFSS as a delimiter, and splits the + results of the other expansions into words using these characters as field terminators. If IIFFSS is unset, or its value is exactly <><><>, the de- - fault, then sequences of ssppaaccee, ttaabb, and nneewwlliinnee at the beginning and - end of the results of the previous expansions are ignored, and any se- - quence of IIFFSS characters not at the beginning or end delimits words. + fault, then sequences of ssppaaccee, ttaabb, and nneewwlliinnee at the beginning and + end of the results of the previous expansions are ignored, and any se- + quence of IIFFSS characters not at the beginning or end delimits words. If IIFFSS has a value other than the default, then sequences of the white- - space characters ssppaaccee, ttaabb, and nneewwlliinnee present in the value of IIFFSS - (an IIFFSS whitespace character) are ignored at the beginning and end of - the word. Any character in IIFFSS that is not IIFFSS whitespace, along with - any adjacent IIFFSS whitespace characters, delimits a field. A sequence + space characters ssppaaccee, ttaabb, and nneewwlliinnee present in the value of IIFFSS + (an IIFFSS whitespace character) are ignored at the beginning and end of + the word. Any character in IIFFSS that is not IIFFSS whitespace, along with + any adjacent IIFFSS whitespace characters, delimits a field. A sequence of IIFFSS whitespace characters is also treated as a delimiter. - If the value of IIFFSS is null, no word splitting occurs. If IIFFSS is un- - set, word splitting behaves as if it contained the default value of + If the value of IIFFSS is null, no word splitting occurs. If IIFFSS is un- + set, word splitting behaves as if it contained the default value of <><><>. - Explicit null arguments ("""" or '''') are retained and passed to commands + Explicit null arguments ("""" or '''') are retained and passed to commands as empty strings. Unquoted implicit null arguments, resulting from the expansion of parameters that have no values, are removed. If a parame- ter with no value is expanded within double quotes, a null argument re- sults and is retained and passed to a command as an empty string. When - a quoted null argument appears as part of a word whose expansion is - non-null, the null argument is removed. That is, the word "-d''" be- + a quoted null argument appears as part of a word whose expansion is + non-null, the null argument is removed. That is, the word "-d''" be- comes "-d" after word splitting and null argument removal. Note that if no expansion occurs, no splitting is performed. PPaatthhnnaammee EExxppaannssiioonn - After word splitting, unless the --ff option has been set, bbaasshh scans - each word for the characters **, ??, and [[. If one of these characters + After word splitting, unless the --ff option has been set, bbaasshh scans + each word for the characters **, ??, and [[. If one of these characters appears, and is not quoted, then the word is regarded as a _p_a_t_t_e_r_n, and replaced with a sorted list of filenames matching the pattern (see PPaatt-- - tteerrnn MMaattcchhiinngg below) subject to the value of the GGLLOOBBSSOORRTT shell vari- + tteerrnn MMaattcchhiinngg below) subject to the value of the GGLLOOBBSSOORRTT shell vari- able. - If no matching filenames are found, and the shell option nnuullllgglloobb is - not enabled, the word is left unchanged. If the nnuullllgglloobb option is - set, and no matches are found, the word is removed. If the ffaaiillgglloobb - shell option is set, and no matches are found, bbaasshh prints an error - message and does not execute the command. If the shell option nnooccaassee-- - gglloobb is enabled, the match is performed without regard to the case of + If no matching filenames are found, and the shell option nnuullllgglloobb is + not enabled, the word is left unchanged. If the nnuullllgglloobb option is + set, and no matches are found, the word is removed. If the ffaaiillgglloobb + shell option is set, and no matches are found, bbaasshh prints an error + message and does not execute the command. If the shell option nnooccaassee-- + gglloobb is enabled, the match is performed without regard to the case of alphabetic characters. When a pattern is used for pathname expansion, the character "." at the - start of a name or immediately following a slash must be matched ex- - plicitly, unless the shell option ddoottgglloobb is set. In order to match - the filenames "." and "..", the pattern must begin with "." (for exam- - ple, ".?"), even if ddoottgglloobb is set. If the gglloobbsskkiippddoottss shell option - is enabled, the filenames "." and ".." never match, even if the pattern - begins with a ".". When not matching pathnames, the "." character is - not treated specially. - - When matching a pathname, the slash character must always be matched + start of a name or immediately following a slash must be matched ex- + plicitly, unless the shell option ddoottgglloobb is set. In order to match + the filenames _. and _._., the pattern must begin with "." (for example, + ".?"), even if ddoottgglloobb is set. If the gglloobbsskkiippddoottss shell option is en- + abled, the filenames _. and _._. never match, even if the pattern begins + with a ".". When not matching pathnames, the "." character is not + treated specially. + + When matching a pathname, the slash character must always be matched explicitly by a slash in the pattern, but in other matching contexts it - can be matched by a special pattern character as described below under + can be matched by a special pattern character as described below under PPaatttteerrnn MMaattcchhiinngg. - See the description of sshhoopptt below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS for a - description of the nnooccaasseegglloobb, nnuullllgglloobb, gglloobbsskkiippddoottss, ffaaiillgglloobb, and + See the description of sshhoopptt below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS for a + description of the nnooccaasseegglloobb, nnuullllgglloobb, gglloobbsskkiippddoottss, ffaaiillgglloobb, and ddoottgglloobb shell options. - The GGLLOOBBIIGGNNOORREE shell variable may be used to restrict the set of file - names matching a _p_a_t_t_e_r_n. If GGLLOOBBIIGGNNOORREE is set, each matching file - name that also matches one of the patterns in GGLLOOBBIIGGNNOORREE is removed - from the list of matches. If the nnooccaasseegglloobb option is set, the match- - ing against the patterns in GGLLOOBBIIGGNNOORREE is performed without regard to - case. The filenames "." and ".." are always ignored when GGLLOOBBIIGGNNOORREE is - set and not null. However, setting GGLLOOBBIIGGNNOORREE to a non-null value has - the effect of enabling the ddoottgglloobb shell option, so all other filenames - beginning with a "." will match. To get the old behavior of ignoring - filenames beginning with a ".", make ".*" one of the patterns in GGLLOO-- + The GGLLOOBBIIGGNNOORREE shell variable may be used to restrict the set of file + names matching a _p_a_t_t_e_r_n. If GGLLOOBBIIGGNNOORREE is set, each matching file + name that also matches one of the patterns in GGLLOOBBIIGGNNOORREE is removed + from the list of matches. If the nnooccaasseegglloobb option is set, the match- + ing against the patterns in GGLLOOBBIIGGNNOORREE is performed without regard to + case. The filenames _. and _._. are always ignored when GGLLOOBBIIGGNNOORREE is set + and not null. However, setting GGLLOOBBIIGGNNOORREE to a non-null value has the + effect of enabling the ddoottgglloobb shell option, so all other filenames be- + ginning with a "." will match. To get the old behavior of ignoring + filenames beginning with a ".", make ".*" one of the patterns in GGLLOO-- BBIIGGNNOORREE. The ddoottgglloobb option is disabled when GGLLOOBBIIGGNNOORREE is unset. The GGLLOOBBIIGGNNOORREE pattern matching honors the setting of the eexxttgglloobb shell op- tion. @@ -2291,46 +2291,46 @@ EEXXPPAANNSSIIOONN PPaatttteerrnn MMaattcchhiinngg Any character that appears in a pattern, other than the special pattern - characters described below, matches itself. The NUL character may not - occur in a pattern. A backslash escapes the following character; the - escaping backslash is discarded when matching. The special pattern + characters described below, matches itself. The NUL character may not + occur in a pattern. A backslash escapes the following character; the + escaping backslash is discarded when matching. The special pattern characters must be quoted if they are to be matched literally. The special pattern characters have the following meanings: - ** Matches any string, including the null string. When the - gglloobbssttaarr shell option is enabled, and ** is used in a - pathname expansion context, two adjacent **s used as a - single pattern will match all files and zero or more di- - rectories and subdirectories. If followed by a //, two - adjacent **s will match only directories and subdirecto- + ** Matches any string, including the null string. When the + gglloobbssttaarr shell option is enabled, and ** is used in a + pathname expansion context, two adjacent **s used as a + single pattern will match all files and zero or more di- + rectories and subdirectories. If followed by a //, two + adjacent **s will match only directories and subdirecto- ries. ?? Matches any single character. - [[...]] Matches any one of the enclosed characters. A pair of - characters separated by a hyphen denotes a _r_a_n_g_e _e_x_p_r_e_s_- - _s_i_o_n; any character that falls between those two charac- + [[...]] Matches any one of the enclosed characters. A pair of + characters separated by a hyphen denotes a _r_a_n_g_e _e_x_p_r_e_s_- + _s_i_o_n; any character that falls between those two charac- ters, inclusive, using the current locale's collating se- - quence and character set, matches. If the first charac- + quence and character set, matches. If the first charac- ter following the [[ is a !! or a ^^ then any character not - within the range matches. A -- may be matched by includ- - ing it as the first or last character in the set. A ]] - may be matched by including it as the first character in + within the range matches. A -- may be matched by includ- + ing it as the first or last character in the set. A ]] + may be matched by including it as the first character in the set. The sorting order of characters in range expressions, and - the characters included in the range, are determined by - the current locale and the values of the LLCC__CCOOLLLLAATTEE or - LLCC__AALLLL shell variables, if set. To obtain the tradi- - tional interpretation of range expressions, where [[aa--dd]] - is equivalent to [[aabbccdd]], set the value of the LLCC__CCOOLLLLAATTEE - or LLCC__AALLLL shell variables to CC, or enable the gglloobbaassccii-- + the characters included in the range, are determined by + the current locale and the values of the LLCC__CCOOLLLLAATTEE or + LLCC__AALLLL shell variables, if set. To obtain the tradi- + tional interpretation of range expressions, where [[aa--dd]] + is equivalent to [[aabbccdd]], set the value of the LLCC__CCOOLLLLAATTEE + or LLCC__AALLLL shell variables to CC, or enable the gglloobbaassccii-- iirraannggeess shell option. - Within [[ and ]], _c_h_a_r_a_c_t_e_r _c_l_a_s_s_e_s can be specified using + Within [[ and ]], _c_h_a_r_a_c_t_e_r _c_l_a_s_s_e_s can be specified using the syntax [[::_c_l_a_s_s::]], where _c_l_a_s_s is one of the following classes defined in the POSIX standard: - aallnnuumm aallpphhaa aasscciiii bbllaannkk ccnnttrrll ddiiggiitt ggrraapphh lloowweerr pprriinntt + aallnnuumm aallpphhaa aasscciiii bbllaannkk ccnnttrrll ddiiggiitt ggrraapphh lloowweerr pprriinntt ppuunncctt ssppaaccee uuppppeerr wwoorrdd xxddiiggiitt A character class matches any character belonging to that @@ -2338,17 +2338,17 @@ EEXXPPAANNSSIIOONN and the character _. Within [[ and ]], an _e_q_u_i_v_a_l_e_n_c_e _c_l_a_s_s can be specified us- - ing the syntax [[==_c==]], which matches all characters with - the same collation weight (as defined by the current lo- + ing the syntax [[==_c==]], which matches all characters with + the same collation weight (as defined by the current lo- cale) as the character _c. Within [[ and ]], the syntax [[.._s_y_m_b_o_l..]] matches the collat- ing symbol _s_y_m_b_o_l. - If the eexxttgglloobb shell option is enabled using the sshhoopptt builtin, the - shell recognizes several extended pattern matching operators. In the + If the eexxttgglloobb shell option is enabled using the sshhoopptt builtin, the + shell recognizes several extended pattern matching operators. In the following description, a _p_a_t_t_e_r_n_-_l_i_s_t is a list of one or more patterns - separated by a ||. Composite patterns may be formed using one or more + separated by a ||. Composite patterns may be formed using one or more of the following sub-patterns: ??((_p_a_t_t_e_r_n_-_l_i_s_t)) @@ -2363,18 +2363,18 @@ EEXXPPAANNSSIIOONN Matches anything except one of the given patterns. The eexxttgglloobb option changes the behavior of the parser, since the paren- - theses are normally treated as operators with syntactic meaning. To - ensure that extended matching patterns are parsed correctly, make sure - that eexxttgglloobb is enabled before parsing constructs containing the pat- + theses are normally treated as operators with syntactic meaning. To + ensure that extended matching patterns are parsed correctly, make sure + that eexxttgglloobb is enabled before parsing constructs containing the pat- terns, including shell functions and command substitutions. When matching filenames, the ddoottgglloobb shell option determines the set of - filenames that are tested: when ddoottgglloobb is enabled, the set of file- - names includes all files beginning with ".", but "." and ".." must be - matched by a pattern or sub-pattern that begins with a dot; when it is + filenames that are tested: when ddoottgglloobb is enabled, the set of file- + names includes all files beginning with ".", but _. and _._. must be + matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not include any filenames beginning with "." un- less the pattern or sub-pattern begins with a ".". If the gglloobbsskkiippddoottss - shell option is enabled, the filenames "." and ".." never appear in the + shell option is enabled, the filenames _. and _._. never appear in the set. As above, "." only has a special meaning when matching filenames. Complicated extended pattern matching against long strings is slow, es- @@ -2868,18 +2868,18 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS sions. If the operating system on which bbaasshh is running provides these special files, bash will use them; otherwise it will emulate them in- ternally with this behavior: If any _f_i_l_e argument to one of the pri- - maries is of the form _/_d_e_v_/_f_d_/_n, then file descriptor _n is checked. If - the _f_i_l_e argument to one of the primaries is one of _/_d_e_v_/_s_t_d_i_n, - _/_d_e_v_/_s_t_d_o_u_t, or _/_d_e_v_/_s_t_d_e_r_r, file descriptor 0, 1, or 2, respectively, - is checked. + maries is of the form _/_d_e_v_/_f_d_/_n, then bbaasshh checks file descriptor _n. + If the _f_i_l_e argument to one of the primaries is one of _d_e_v_/_s_t_d_i_n, + _d_e_v_/_s_t_d_o_u_t, or _d_e_v_/_s_t_d_e_r_r, bbaasshh checks file descriptor 0, 1, or 2, re- + spectively. Unless otherwise specified, primaries that operate on files follow sym- bolic links and operate on the target of the link, rather than the link itself. - When used with [[[[, or when the shell is in _p_o_s_i_x _m_o_d_e, the << and >> op- - erators sort lexicographically using the current locale. When the - shell is not in _p_o_s_i_x _m_o_d_e, the tteesstt command sorts using ASCII order- + When used with [[[[, or when the shell is in posix mode, the << and >> op- + erators sort lexicographically using the current locale. When the + shell is not in posix mode, the tteesstt command sorts using ASCII order- ing. --aa _f_i_l_e @@ -2918,25 +2918,25 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS --LL _f_i_l_e True if _f_i_l_e exists and is a symbolic link. --NN _f_i_l_e - True if _f_i_l_e exists and has been modified since it was last ac- + True if _f_i_l_e exists and has been modified since it was last ac- cessed. --OO _f_i_l_e True if _f_i_l_e exists and is owned by the effective user id. --SS _f_i_l_e True if _f_i_l_e exists and is a socket. --oo _o_p_t_n_a_m_e - True if the shell option _o_p_t_n_a_m_e is enabled. See the list of - options under the description of the --oo option to the sseett + True if the shell option _o_p_t_n_a_m_e is enabled. See the list of + options under the description of the --oo option to the sseett builtin below. --vv _v_a_r_n_a_m_e - True if the shell variable _v_a_r_n_a_m_e is set (has been assigned a - value). If _v_a_r_n_a_m_e is an indexed array variable name sub- - scripted by _@ or _*, this returns true if the array has any set + True if the shell variable _v_a_r_n_a_m_e is set (has been assigned a + value). If _v_a_r_n_a_m_e is an indexed array variable name sub- + scripted by _@ or _*, this returns true if the array has any set elements. If _v_a_r_n_a_m_e is an associative array variable name sub- - scripted by _@ or _*, this returns true if an element with that + scripted by _@ or _*, this returns true if an element with that key is set. --RR _v_a_r_n_a_m_e - True if the shell variable _v_a_r_n_a_m_e is set and is a name refer- + True if the shell variable _v_a_r_n_a_m_e is set and is a name refer- ence. --zz _s_t_r_i_n_g True if the length of _s_t_r_i_n_g is zero. @@ -2946,8 +2946,8 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS _s_t_r_i_n_g_1 ==== _s_t_r_i_n_g_2 _s_t_r_i_n_g_1 == _s_t_r_i_n_g_2 - True if the strings are equal. == should be used with the tteesstt - command for POSIX conformance. When used with the [[[[ command, + True if the strings are equal. == should be used with the tteesstt + command for POSIX conformance. When used with the [[[[ command, this performs pattern matching as described above (CCoommppoouunndd CCoomm-- mmaannddss). _s_t_r_i_n_g_1 !!== _s_t_r_i_n_g_2 @@ -2958,124 +2958,124 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS True if _s_t_r_i_n_g_1 sorts after _s_t_r_i_n_g_2 lexicographically. _f_i_l_e_1 --eeff _f_i_l_e_2 - True if _f_i_l_e_1 and _f_i_l_e_2 refer to the same device and inode num- + True if _f_i_l_e_1 and _f_i_l_e_2 refer to the same device and inode num- bers. _f_i_l_e_1 -nntt _f_i_l_e_2 - True if _f_i_l_e_1 is newer (according to modification date) than + True if _f_i_l_e_1 is newer (according to modification date) than _f_i_l_e_2, or if _f_i_l_e_1 exists and _f_i_l_e_2 does not. _f_i_l_e_1 -oott _f_i_l_e_2 - True if _f_i_l_e_1 is older than _f_i_l_e_2, or if _f_i_l_e_2 exists and _f_i_l_e_1 + True if _f_i_l_e_1 is older than _f_i_l_e_2, or if _f_i_l_e_2 exists and _f_i_l_e_1 does not. _a_r_g_1 OOPP _a_r_g_2 - OOPP is one of --eeqq, --nnee, --lltt, --llee, --ggtt, or --ggee. These arithmetic - binary operators return true if _a_r_g_1 is equal to, not equal to, - less than, less than or equal to, greater than, or greater than - or equal to _a_r_g_2, respectively. _a_r_g_1 and _a_r_g_2 may be positive - or negative integers. When used with the [[[[ command, _a_r_g_1 and - _a_r_g_2 are evaluated as arithmetic expressions (see AARRIITTHHMMEETTIICC + OOPP is one of --eeqq, --nnee, --lltt, --llee, --ggtt, or --ggee. These arithmetic + binary operators return true if _a_r_g_1 is equal to, not equal to, + less than, less than or equal to, greater than, or greater than + or equal to _a_r_g_2, respectively. _a_r_g_1 and _a_r_g_2 may be positive + or negative integers. When used with the [[[[ command, _a_r_g_1 and + _a_r_g_2 are evaluated as arithmetic expressions (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN above). SSIIMMPPLLEE CCOOMMMMAANNDD EEXXPPAANNSSIIOONN When the shell executes a simple command, it performs the following ex- - pansions, assignments, and redirections, from left to right, in the + pansions, assignments, and redirections, from left to right, in the following order. - 1. The words that the parser has marked as variable assignments - (those preceding the command name) and redirections are saved + 1. The words that the parser has marked as variable assignments + (those preceding the command name) and redirections are saved for later processing. - 2. The words that are not variable assignments or redirections are - expanded. If any words remain after expansion, the first word - is taken to be the name of the command and the remaining words + 2. The words that are not variable assignments or redirections are + expanded. If any words remain after expansion, the first word + is taken to be the name of the command and the remaining words are the arguments. 3. Redirections are performed as described above under RREEDDIIRREECCTTIIOONN. 4. The text after the == in each variable assignment undergoes tilde expansion, parameter expansion, command substitution, arithmetic - expansion, and quote removal before being assigned to the vari- + expansion, and quote removal before being assigned to the vari- able. If no command name results, the variable assignments affect the current - shell environment. In the case of such a command (one that consists - only of assignment statements and redirections), assignment statements - are performed before redirections. Otherwise, the variables are added - to the environment of the executed command and do not affect the cur- + shell environment. In the case of such a command (one that consists + only of assignment statements and redirections), assignment statements + are performed before redirections. Otherwise, the variables are added + to the environment of the executed command and do not affect the cur- rent shell environment. If any of the assignments attempts to assign a - value to a readonly variable, an error occurs, and the command exits + value to a readonly variable, an error occurs, and the command exits with a non-zero status. - If no command name results, redirections are performed, but do not af- - fect the current shell environment. A redirection error causes the + If no command name results, redirections are performed, but do not af- + fect the current shell environment. A redirection error causes the command to exit with a non-zero status. - If there is a command name left after expansion, execution proceeds as - described below. Otherwise, the command exits. If one of the expan- - sions contained a command substitution, the exit status of the command - is the exit status of the last command substitution performed. If + If there is a command name left after expansion, execution proceeds as + described below. Otherwise, the command exits. If one of the expan- + sions contained a command substitution, the exit status of the command + is the exit status of the last command substitution performed. If there were no command substitutions, the command exits with a zero sta- tus. CCOOMMMMAANNDD EEXXEECCUUTTIIOONN - After a command has been split into words, if it results in a simple - command and an optional list of arguments, the shell performs the fol- + After a command has been split into words, if it results in a simple + command and an optional list of arguments, the shell performs the fol- lowing actions. - If the command name contains no slashes, the shell attempts to locate - it. If there exists a shell function by that name, that function is - invoked as described above in FFUUNNCCTTIIOONNSS. If the name does not match a - function, the shell searches for it in the list of shell builtins. If + If the command name contains no slashes, the shell attempts to locate + it. If there exists a shell function by that name, that function is + invoked as described above in FFUUNNCCTTIIOONNSS. If the name does not match a + function, the shell searches for it in the list of shell builtins. If a match is found, that builtin is invoked. - If the name is neither a shell function nor a builtin, and contains no - slashes, bbaasshh searches each element of the PPAATTHH for a directory con- + If the name is neither a shell function nor a builtin, and contains no + slashes, bbaasshh searches each element of the PPAATTHH for a directory con- taining an executable file by that name. BBaasshh uses a hash table to re- - member the full pathnames of executable files (see hhaasshh under SSHHEELLLL - BBUUIILLTTIINN CCOOMMMMAANNDDSS below). Bash performs a full search of the directo- - ries in PPAATTHH only if the command is not found in the hash table. If - the search is unsuccessful, the shell searches for a defined shell - function named ccoommmmaanndd__nnoott__ffoouunndd__hhaannddllee. If that function exists, it - is invoked in a separate execution environment with the original com- - mand and the original command's arguments as its arguments, and the - function's exit status becomes the exit status of that subshell. If + member the full pathnames of executable files (see hhaasshh under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below). Bash performs a full search of the directo- + ries in PPAATTHH only if the command is not found in the hash table. If + the search is unsuccessful, the shell searches for a defined shell + function named ccoommmmaanndd__nnoott__ffoouunndd__hhaannddllee. If that function exists, it + is invoked in a separate execution environment with the original com- + mand and the original command's arguments as its arguments, and the + function's exit status becomes the exit status of that subshell. If that function is not defined, the shell prints an error message and re- turns an exit status of 127. - If the search is successful, or if the command name contains one or + If the search is successful, or if the command name contains one or more slashes, the shell executes the named program in a separate execu- tion environment. Argument 0 is set to the name given, and the remain- ing arguments to the command are set to the arguments given, if any. - If this execution fails because the file is not in executable format, - and the file is not a directory, it is assumed to be a _s_h_e_l_l _s_c_r_i_p_t, a + If this execution fails because the file is not in executable format, + and the file is not a directory, it is assumed to be a _s_h_e_l_l _s_c_r_i_p_t, a file containing shell commands, and the shell creates a new instance of - itself to execute it. Bash tries to determine whether the file is a - text file or a binary, and will not execute files it determines to be + itself to execute it. Bash tries to determine whether the file is a + text file or a binary, and will not execute files it determines to be binaries. This subshell reinitializes itself, so that the effect is as - if a new shell had been invoked to handle the script, with the excep- - tion that the locations of commands remembered by the parent (see hhaasshh + if a new shell had been invoked to handle the script, with the excep- + tion that the locations of commands remembered by the parent (see hhaasshh below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS are retained by the child. - If the program is a file beginning with ##!!, the remainder of the first - line specifies an interpreter for the program. The shell executes the + If the program is a file beginning with ##!!, the remainder of the first + line specifies an interpreter for the program. The shell executes the specified interpreter on operating systems that do not handle this exe- cutable format themselves. The arguments to the interpreter consist of - a single optional argument following the interpreter name on the first - line of the program, followed by the name of the program, followed by + a single optional argument following the interpreter name on the first + line of the program, followed by the name of the program, followed by the command arguments, if any. CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT - The shell has an _e_x_e_c_u_t_i_o_n _e_n_v_i_r_o_n_m_e_n_t, which consists of the follow- + The shell has an _e_x_e_c_u_t_i_o_n _e_n_v_i_r_o_n_m_e_n_t, which consists of the follow- ing: - +o Open files inherited by the shell at invocation, as modified by + +o Open files inherited by the shell at invocation, as modified by redirections supplied to the eexxeecc builtin. - +o The current working directory as set by ccdd, ppuusshhdd, or ppooppdd, or + +o The current working directory as set by ccdd, ppuusshhdd, or ppooppdd, or inherited by the shell at invocation. - +o The file creation mode mask as set by uummaasskk or inherited from + +o The file creation mode mask as set by uummaasskk or inherited from the shell's parent. +o Current traps set by ttrraapp. @@ -3083,135 +3083,135 @@ CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENN +o Shell parameters that are set by variable assignment or with sseett or inherited from the shell's parent in the environment. - +o Shell functions defined during execution or inherited from the + +o Shell functions defined during execution or inherited from the shell's parent in the environment. - +o Options enabled at invocation (either by default or with com- + +o Options enabled at invocation (either by default or with com- mand-line arguments) or by sseett. +o Options enabled by sshhoopptt. +o Shell aliases defined with aalliiaass. - +o Various process IDs, including those of background jobs, the + +o Various process IDs, including those of background jobs, the value of $$$$, and the value of PPPPIIDD. - When a simple command other than a builtin or shell function is to be - executed, it is invoked in a separate execution environment that con- - sists of the following. Unless otherwise noted, the values are inher- + When a simple command other than a builtin or shell function is to be + executed, it is invoked in a separate execution environment that con- + sists of the following. Unless otherwise noted, the values are inher- ited from the shell. - +o The shell's open files, plus any modifications and additions + +o The shell's open files, plus any modifications and additions specified by redirections to the command. +o The current working directory. +o The file creation mode mask. - +o Shell variables and functions marked for export, along with + +o Shell variables and functions marked for export, along with variables exported for the command, passed in the environment. +o Traps caught by the shell are reset to the values inherited from the shell's parent, and traps ignored by the shell are ignored. - A command invoked in this separate environment cannot affect the + A command invoked in this separate environment cannot affect the shell's execution environment. A _s_u_b_s_h_e_l_l is a copy of the shell process. - Command substitution, commands grouped with parentheses, and asynchro- + Command substitution, commands grouped with parentheses, and asynchro- nous commands are invoked in a subshell environment that is a duplicate of the shell environment, except that traps caught by the shell are re- - set to the values that the shell inherited from its parent at invoca- - tion. Builtin commands that are invoked as part of a pipeline, except - possibly in the last element depending on the value of the llaassttppiippee - shell option, are also executed in a subshell environment. Changes - made to the subshell environment cannot affect the shell's execution + set to the values that the shell inherited from its parent at invoca- + tion. Builtin commands that are invoked as part of a pipeline, except + possibly in the last element depending on the value of the llaassttppiippee + shell option, are also executed in a subshell environment. Changes + made to the subshell environment cannot affect the shell's execution environment. - When the shell is in _p_o_s_i_x _m_o_d_e, subshells spawned to execute command - substitutions inherit the value of the --ee option from their parent - shell. When not in _p_o_s_i_x _m_o_d_e, bbaasshh clears the --ee option in such sub- - shells. See the description of the iinnhheerriitt__eerrrreexxiitt shell option below + When the shell is in posix mode, subshells spawned to execute command + substitutions inherit the value of the --ee option from their parent + shell. When not in posix mode, bbaasshh clears the --ee option in such sub- + shells. See the description of the iinnhheerriitt__eerrrreexxiitt shell option below for how to control this behavior when not in posix mode. - If a command is followed by a && and job control is not active, the de- + If a command is followed by a && and job control is not active, the de- fault standard input for the command is the empty file _/_d_e_v_/_n_u_l_l. Oth- - erwise, the invoked command inherits the file descriptors of the call- + erwise, the invoked command inherits the file descriptors of the call- ing shell as modified by redirections. EENNVVIIRROONNMMEENNTT - When a program is invoked it is given an array of strings called the + When a program is invoked it is given an array of strings called the _e_n_v_i_r_o_n_m_e_n_t. This is a list of _n_a_m_e-_v_a_l_u_e pairs, of the form _n_a_m_e=_v_a_l_u_e. - The shell provides several ways to manipulate the environment. On in- - vocation, the shell scans its own environment and creates a parameter - for each name found, automatically marking it for _e_x_p_o_r_t to child + The shell provides several ways to manipulate the environment. On in- + vocation, the shell scans its own environment and creates a parameter + for each name found, automatically marking it for _e_x_p_o_r_t to child processes. Executed commands inherit the environment. The eexxppoorrtt, ddee-- - ccllaarree --xx, and uunnsseett commands modify the environment by adding and - deleting parameters and functions. If the value of a parameter in the - environment is modified, the new value automatically becomes part of - the environment, replacing the old. The environment inherited by any - executed command consists of the shell's initial environment, whose - values may be modified in the shell, less any pairs removed by the uunn-- - sseett or eexxppoorrtt --nn commands, plus any additions via the eexxppoorrtt and ddee-- + ccllaarree --xx, and uunnsseett commands modify the environment by adding and + deleting parameters and functions. If the value of a parameter in the + environment is modified, the new value automatically becomes part of + the environment, replacing the old. The environment inherited by any + executed command consists of the shell's initial environment, whose + values may be modified in the shell, less any pairs removed by the uunn-- + sseett or eexxppoorrtt --nn commands, plus any additions via the eexxppoorrtt and ddee-- ccllaarree --xx commands. - If any parameter assignments, as described above in PPAARRAAMMEETTEERRSS, appear + If any parameter assignments, as described above in PPAARRAAMMEETTEERRSS, appear before a _s_i_m_p_l_e _c_o_m_m_a_n_d, the variable assignments are part of that com- mand's environment for as long as it executes. These assignment state- - ments affect only the environment seen by that command. If these as- - signments precede a call to a shell function, the variables are local + ments affect only the environment seen by that command. If these as- + signments precede a call to a shell function, the variables are local to the function and exported to that function's children. - If the --kk option is set (see the sseett builtin command below), then _a_l_l - parameter assignments are placed in the environment for a command, not + If the --kk option is set (see the sseett builtin command below), then _a_l_l + parameter assignments are placed in the environment for a command, not just those that precede the command name. - When bbaasshh invokes an external command, the variable __ is set to the + When bbaasshh invokes an external command, the variable __ is set to the full pathname of the command and passed to that command in its environ- ment. EEXXIITT SSTTAATTUUSS - The exit status of an executed command is the value returned by the + The exit status of an executed command is the value returned by the _w_a_i_t_p_i_d system call or equivalent function. Exit statuses fall between - 0 and 255, though, as explained below, the shell may use values above + 0 and 255, though, as explained below, the shell may use values above 125 specially. Exit statuses from shell builtins and compound commands are also limited to this range. Under certain circumstances, the shell will use special values to indicate specific failure modes. For the shell's purposes, a command which exits with a zero exit status - has succeeded. So while an exit status of zero indicates success, a + has succeeded. So while an exit status of zero indicates success, a non-zero exit status indicates failure. - When a command terminates on a fatal signal _N, bbaasshh uses the value of + When a command terminates on a fatal signal _N, bbaasshh uses the value of 128+_N as the exit status. - If a command is not found, the child process created to execute it re- - turns a status of 127. If a command is found but is not executable, + If a command is not found, the child process created to execute it re- + turns a status of 127. If a command is found but is not executable, the return status is 126. If a command fails because of an error during expansion or redirection, the exit status is greater than zero. - Shell builtin commands return a status of 0 (_t_r_u_e) if successful, and - non-zero (_f_a_l_s_e) if an error occurs while they execute. All builtins - return an exit status of 2 to indicate incorrect usage, generally in- + Shell builtin commands return a status of 0 (_t_r_u_e) if successful, and + non-zero (_f_a_l_s_e) if an error occurs while they execute. All builtins + return an exit status of 2 to indicate incorrect usage, generally in- valid options or missing arguments. The exit status of the last command is available in the special parame- ter $?. - BBaasshh itself returns the exit status of the last command executed, un- - less a syntax error occurs, in which case it exits with a non-zero + BBaasshh itself returns the exit status of the last command executed, un- + less a syntax error occurs, in which case it exits with a non-zero value. See also the eexxiitt builtin command below. SSIIGGNNAALLSS - When bbaasshh is interactive, in the absence of any traps, it ignores - SSIIGGTTEERRMM (so that kkiillll 00 does not kill an interactive shell), and + When bbaasshh is interactive, in the absence of any traps, it ignores + SSIIGGTTEERRMM (so that kkiillll 00 does not kill an interactive shell), and catches and handles SSIIGGIINNTT (so that the wwaaiitt builtin is interruptible). - When bbaasshh receives SSIIGGIINNTT, it breaks out of any executing loops. In + When bbaasshh receives SSIIGGIINNTT, it breaks out of any executing loops. In all cases, bbaasshh ignores SSIIGGQQUUIITT. If job control is in effect, bbaasshh ig- nores SSIIGGTTTTIINN, SSIIGGTTTTOOUU, and SSIIGGTTSSTTPP. @@ -3220,140 +3220,140 @@ SSIIGGNNAALLSS Non-builtin commands bbaasshh executes have signal handlers set to the val- ues inherited by the shell from its parent, unless ttrraapp sets them to be - ignored, in which case the child process will ignore them as well. - When job control is not in effect, asynchronous commands ignore SSIIGGIINNTT + ignored, in which case the child process will ignore them as well. + When job control is not in effect, asynchronous commands ignore SSIIGGIINNTT and SSIIGGQQUUIITT in addition to these inherited handlers. Commands run as a - result of command substitution ignore the keyboard-generated job con- + result of command substitution ignore the keyboard-generated job con- trol signals SSIIGGTTTTIINN, SSIIGGTTTTOOUU, and SSIIGGTTSSTTPP. - The shell exits by default upon receipt of a SSIIGGHHUUPP. Before exiting, - an interactive shell resends the SSIIGGHHUUPP to all jobs, running or - stopped. The shell sends SSIIGGCCOONNTT to stopped jobs to ensure that they - receive the SSIIGGHHUUPP (see JJOOBB CCOONNTTRROOLL below for more information about - running and stopped jobs). To prevent the shell from sending the sig- - nal to a particular job, remove it from the jobs table with the ddiissoowwnn - builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) or mark it not to receive + The shell exits by default upon receipt of a SSIIGGHHUUPP. Before exiting, + an interactive shell resends the SSIIGGHHUUPP to all jobs, running or + stopped. The shell sends SSIIGGCCOONNTT to stopped jobs to ensure that they + receive the SSIIGGHHUUPP (see JJOOBB CCOONNTTRROOLL below for more information about + running and stopped jobs). To prevent the shell from sending the sig- + nal to a particular job, remove it from the jobs table with the ddiissoowwnn + builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) or mark it not to receive SSIIGGHHUUPP using ddiissoowwnn --hh. - If the hhuuppoonneexxiitt shell option has been set using sshhoopptt, bbaasshh sends a + If the hhuuppoonneexxiitt shell option has been set using sshhoopptt, bbaasshh sends a SSIIGGHHUUPP to all jobs when an interactive login shell exits. - If bbaasshh is waiting for a command to complete and receives a signal for + If bbaasshh is waiting for a command to complete and receives a signal for which a trap has been set, the trap will not be executed until the com- mand completes. If bbaasshh is waiting for an asynchronous command via the - wwaaiitt builtin, and it receives a signal for which a trap has been set, - the wwaaiitt builtin will return immediately with an exit status greater + wwaaiitt builtin, and it receives a signal for which a trap has been set, + the wwaaiitt builtin will return immediately with an exit status greater than 128, immediately after which the shell executes the trap. - When job control is not enabled, and bbaasshh is waiting for a foreground + When job control is not enabled, and bbaasshh is waiting for a foreground command to complete, the shell receives keyboard-generated signals such - as SSIIGGIINNTT (usually generated by ^^CC) that users commonly intend to send + as SSIIGGIINNTT (usually generated by ^^CC) 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 ^^CC sends SSIIGGIINNTT to all + the same process group as the terminal, and ^^CC sends SSIIGGIINNTT to all processes in that process group. See JJOOBB CCOONNTTRROOLL below for more infor- mation about process groups. - When bbaasshh is running without job control enabled and receives SSIIGGIINNTT - while waiting for a foreground command, it waits until that foreground + When bbaasshh is running without job control enabled and receives SSIIGGIINNTT + while waiting for a foreground command, it waits until that foreground command terminates and then decides what to do about the SSIIGGIINNTT: 1. If the command terminates due to the SSIIGGIINNTT, bbaasshh concludes that - the user meant to end the entire script, and acts on the SSIIGGIINNTT + the user meant to end the entire script, and acts on the SSIIGGIINNTT (e.g., by running a SSIIGGIINNTT trap or exiting itself); - 2. If the command does not terminate due to SSIIGGIINNTT, the program - handled the SSIIGGIINNTT itself and did not treat it as a fatal sig- - nal. In that case, bbaasshh does not treat SSIIGGIINNTT as a fatal sig- - nal, either, instead assuming that the SSIIGGIINNTT was used as part - of the program's normal operation (e.g., emacs uses it to abort + 2. If the command does not terminate due to SSIIGGIINNTT, the program + handled the SSIIGGIINNTT itself and did not treat it as a fatal sig- + nal. In that case, bbaasshh does not treat SSIIGGIINNTT as a fatal sig- + nal, either, instead assuming that the SSIIGGIINNTT was used as part + of the program's normal operation (e.g., emacs uses it to abort editing commands) or deliberately discarded. However, bbaasshh will - run any trap set on SSIIGGIINNTT, as it does with any other trapped - signal it receives while it is waiting for the foreground com- + run any trap set on SSIIGGIINNTT, as it does with any other trapped + signal it receives while it is waiting for the foreground com- mand to complete, for compatibility. JJOOBB CCOONNTTRROOLL _J_o_b _c_o_n_t_r_o_l refers to the ability to selectively stop (_s_u_s_p_e_n_d) the ex- - ecution of processes and continue (_r_e_s_u_m_e) their execution at a later - point. A user typically employs this facility via an interactive in- + ecution of processes and continue (_r_e_s_u_m_e) their execution at a later + point. A user typically employs this facility via an interactive in- terface supplied jointly by the operating system kernel's terminal dri- ver and bbaasshh. - The shell associates a _j_o_b with each pipeline. It keeps a table of - currently executing jobs, which the jjoobbss command will display. Each - job has a _j_o_b _n_u_m_b_e_r, which jjoobbss displays between brackets. Job num- - bers start at 1. When bbaasshh starts a job asynchronously (in the _b_a_c_k_- + The shell associates a _j_o_b with each pipeline. It keeps a table of + currently executing jobs, which the jjoobbss command will display. Each + job has a _j_o_b _n_u_m_b_e_r, which jjoobbss displays between brackets. Job num- + bers start at 1. When bbaasshh starts a job asynchronously (in the _b_a_c_k_- _g_r_o_u_n_d), it prints a line that looks like: [1] 25647 indicating that this job is job number 1 and that the process ID of the last process in the pipeline associated with this job is 25647. All of - the processes in a single pipeline are members of the same job. BBaasshh + the processes in a single pipeline are members of the same job. BBaasshh uses the _j_o_b abstraction as the basis for job control. - To facilitate the implementation of the user interface to job control, + To facilitate the implementation of the user interface to job control, each process has a _p_r_o_c_e_s_s _g_r_o_u_p _I_D, and the operating system maintains the notion of a _c_u_r_r_e_n_t _t_e_r_m_i_n_a_l _p_r_o_c_e_s_s _g_r_o_u_p _I_D. Processes that have - the same process group ID are said to be part of the same _p_r_o_c_e_s_s - _g_r_o_u_p. Members of the _f_o_r_e_g_r_o_u_n_d process group (processes whose + the same process group ID are said to be part of the same _p_r_o_c_e_s_s + _g_r_o_u_p. Members of the _f_o_r_e_g_r_o_u_n_d process group (processes whose process group ID is equal to the current terminal process group ID) re- - ceive keyboard-generated signals such as SSIIGGIINNTT. Processes in the - foreground process group are said to be _f_o_r_e_g_r_o_u_n_d processes. _B_a_c_k_- + ceive keyboard-generated signals such as SSIIGGIINNTT. Processes in the + foreground process group are said to be _f_o_r_e_g_r_o_u_n_d processes. _B_a_c_k_- _g_r_o_u_n_d processes are those whose process group ID differs from the ter- minal's; such processes are immune to keyboard-generated signals. Only foreground processes are allowed to read from or, if the user so speci- - fies with "stty tostop", write to the terminal. Background processes - which attempt to read from (write to when "tostop" is in effect) the - terminal are sent a SSIIGGTTTTIINN ((SSIIGGTTTTOOUU)) signal by the kernel's terminal + fies with "stty tostop", write to the terminal. Background processes + which attempt to read from (write to when "tostop" is in effect) the + terminal are sent a SSIIGGTTTTIINN ((SSIIGGTTTTOOUU)) signal by the kernel's terminal driver, which, unless caught, suspends the process. - If the operating system on which bbaasshh is running supports job control, + If the operating system on which bbaasshh is running supports job control, bbaasshh contains facilities to use it. Typing the _s_u_s_p_e_n_d character (typ- ically ^^ZZ, Control-Z) while a process is running stops that process and - returns control to bbaasshh. Typing the _d_e_l_a_y_e_d _s_u_s_p_e_n_d character (typi- - cally ^^YY, Control-Y) causes the process stop when it attempts to read - input from the terminal, and returns control to bbaasshh. The user then - manipulates the state of this job, using the bbgg command to continue it - in the background, the ffgg command to continue it in the foreground, or - the kkiillll command to kill it. The suspend character takes effect imme- - diately, and has the additional side effect of discarding any pending + returns control to bbaasshh. Typing the _d_e_l_a_y_e_d _s_u_s_p_e_n_d character (typi- + cally ^^YY, Control-Y) causes the process stop when it attempts to read + input from the terminal, and returns control to bbaasshh. The user then + manipulates the state of this job, using the bbgg command to continue it + in the background, the ffgg command to continue it in the foreground, or + the kkiillll command to kill it. The suspend character takes effect imme- + diately, and has the additional side effect of discarding any pending output and typeahead. To force a background process to stop, or stop a - process that's not associated with the current terminal session, send + process that's not associated with the current terminal session, send it the SSIIGGSSTTOOPP signal using kkiillll. There are a number of ways to refer to a job in the shell. The %% char- acter introduces a job specification (jobspec). - Job number _n may be referred to as %%nn. A job may also be referred to - using a prefix of the name used to start it, or using a substring that - appears in its command line. For example, %%ccee refers to a job whose - command name begins with ccee. Using %%??ccee, on the other hand, refers to + Job number _n may be referred to as %%nn. A job may also be referred to + using a prefix of the name used to start it, or using a substring that + appears in its command line. For example, %%ccee refers to a job whose + command name begins with ccee. Using %%??ccee, on the other hand, refers to any job containing the string ccee in its command line. If the prefix or substring matches more than one job, bbaasshh reports an error. - The symbols %%%% and %%++ refer to the shell's notion of the _c_u_r_r_e_n_t _j_o_b. - A single % (with no accompanying job specification) also refers to the - current job. %%-- refers to the _p_r_e_v_i_o_u_s _j_o_b. When a job starts in the + The symbols %%%% and %%++ refer to the shell's notion of the _c_u_r_r_e_n_t _j_o_b. + A single % (with no accompanying job specification) also refers to the + current job. %%-- refers to the _p_r_e_v_i_o_u_s _j_o_b. When a job starts in the background, a job stops while in the foreground, or a job is resumed in - the background, it becomes the current job. The job that was the cur- - rent job becomes the previous job. When the current job terminates, - the previous job becomes the current job. If there is only a single - job, %%++ and %%-- can both be used to refer to that job. In output per- + the background, it becomes the current job. The job that was the cur- + rent job becomes the previous job. When the current job terminates, + the previous job becomes the current job. If there is only a single + job, %%++ and %%-- can both be used to refer to that job. In output per- taining to jobs (e.g., the output of the jjoobbss command), the current job is always marked with a ++, and the previous job with a --. - Simply naming a job can be used to bring it into the foreground: %%11 is - a synonym for "fg %1", bringing job 1 from the background into the + Simply naming a job can be used to bring it into the foreground: %%11 is + a synonym for "fg %1", bringing job 1 from the background into the foreground. Similarly, "%1 &" resumes job 1 in the background, equiva- lent to "bg %1". - The shell learns immediately whenever a job changes state. Normally, - bbaasshh waits until it is about to print a prompt before notifying the - user about changes in a job's status so as to not interrupt any other - output, though it will notify of changes in a job's status after a - foreground command in a list completes, before executing the next com- - mand in the list. If the --bb option to the sseett builtin command is en- - abled, bbaasshh reports such changes immediately. BBaasshh executes any trap + The shell learns immediately whenever a job changes state. Normally, + bbaasshh waits until it is about to print a prompt before notifying the + user about changes in a job's status so as to not interrupt any other + output, though it will notify of changes in a job's status after a + foreground command in a list completes, before executing the next com- + mand in the list. If the --bb option to the sseett builtin command is en- + abled, bbaasshh reports status changes immediately. BBaasshh executes any trap on SSIIGGCCHHLLDD for each child that terminates. When a job terminates and bbaasshh notifies the user about it, bbaasshh removes @@ -3457,33 +3457,43 @@ RREEAADDLLIINNEE to the sseett builtin. RReeaaddlliinnee NNoottaattiioonn - This section uses an emacs-style notation to denote keystrokes. Con- - trol keys are denoted by C-_k_e_y, e.g., C-n means Control-N. Similarly, - _m_e_t_a keys are denoted by M-_k_e_y, so M-x means Meta-X. - - On keyboards without a _M_e_t_a key, M-_x means ESC _x, i.e., press the Es- - cape key then the _x key. This makes ESC the _m_e_t_a _p_r_e_f_i_x. The combina- - tion M-C-_x means ESC-Control-_x, or press the Escape key then hold the - Control key while pressing the _x key. - - On some keyboards, the Meta key modifier produces meta characters with - the eighth bit (0200) set (you can use the eennaabbllee--mmeettaa--kkeeyy variable to - control whether or not it does this, if the keyboard allows it). On - many others, the terminal or terminal emulator converts the metafied - key to a key sequence beginning with ESC as described in the preceding + This section uses Emacs-style editing concepts and uses its notation + for keystrokes. Control keys are denoted by C-_k_e_y, e.g., C-n means + Control-N. Similarly, _m_e_t_a keys are denoted by M-_k_e_y, so M-x means + Meta-X. The Meta key is often labeled "Alt" or "Option". + + On keyboards without a _M_e_t_a key, M-_x means ESC _x, i.e., press and re- + lease the Escape key, then press and release the _x key, in sequence. + This makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x means ESC-Con- + trol-_x: press and release the Escape key, then press and hold the Con- + trol key while pressing the _x key, then release both. + + On some keyboards, the Meta key modifier produces characters with the + eighth bit (0200) set. You can use the eennaabbllee--mmeettaa--kkeeyy variable to + control whether or not it does this, if the keyboard allows it. On + many others, the terminal or terminal emulator converts the metafied + key to a key sequence beginning with ESC as described in the preceding paragraph. - If your _M_e_t_a key produces a key sequence with the ESC meta prefix, you - can make M-_k_e_y key bindings you specify (see RReeaaddlliinnee KKeeyy BBiinnddiinnggss be- + If your _M_e_t_a key produces a key sequence with the ESC meta prefix, you + can make M-_k_e_y key bindings you specify (see RReeaaddlliinnee KKeeyy BBiinnddiinnggss be- low) do the same thing by setting the ffoorrccee--mmeettaa--pprreeffiixx variable. - Readline commands may be given numeric _a_r_g_u_m_e_n_t_s, which normally act as - a repeat count. Sometimes, however, it is the sign of the argument - that is significant. Passing a negative argument to a command that - acts in the forward direction (e.g., kkiillll--lliinnee) makes that command act - in a backward direction. Commands whose behavior with arguments devi- + RReeaaddlliinnee commands may be given numeric _a_r_g_u_m_e_n_t_s, which normally act as + a repeat count. Sometimes, however, it is the sign of the argument + that is significant. Passing a negative argument to a command that + acts in the forward direction (e.g., kkiillll--lliinnee) makes that command act + in a backward direction. Commands whose behavior with arguments devi- ates from this are noted below. + The _p_o_i_n_t is the current cursor position, and _m_a_r_k refers to a saved + cursor position. The text between the point and mark is referred to as + the _r_e_g_i_o_n. RReeaaddlliinnee has the concept of an _a_c_t_i_v_e _r_e_g_i_o_n: when the re- + gion is active, rreeaaddlliinnee redisplay highlights the region using the + value of the aaccttiivvee--rreeggiioonn--ssttaarrtt--ccoolloorr variable. The eennaabbllee--aaccttiivvee--rree-- + ggiioonn variable turns this on and off. Several commands set the region + to active; those are noted below. + When a command is described as _k_i_l_l_i_n_g text, the text deleted is saved for possible future retrieval (_y_a_n_k_i_n_g). The killed text is saved in a _k_i_l_l _r_i_n_g. Consecutive kills accumulate the deleted text into one @@ -3491,11 +3501,11 @@ RREEAADDLLIINNEE separate the chunks of text on the kill ring. RReeaaddlliinnee IInniittiiaalliizzaattiioonn - Readline is customized by putting commands in an initialization file + RReeaaddlliinnee is customized by putting commands in an initialization file (the _i_n_p_u_t_r_c file). The name of this file is taken from the value of the IINNPPUUTTRRCC shell variable. If that variable is unset, the default is - _~_/_._i_n_p_u_t_r_c. If that file does not exist or cannot be read, readline - looks for _/_e_t_c_/_i_n_p_u_t_r_c. When a program which uses the readline library + _~_/_._i_n_p_u_t_r_c. If that file does not exist or cannot be read, rreeaaddlliinnee + looks for _/_e_t_c_/_i_n_p_u_t_r_c. When a program which uses the rreeaaddlliinnee library starts up, rreeaaddlliinnee reads the initialization file and sets the key bindings and variables found there, before reading any user input. @@ -3505,7 +3515,7 @@ RREEAADDLLIINNEE key bindings and variable settings. The default key-bindings in this section may be changed using key bind- - ing commands in the _i_n_p_u_t_r_c file. Programs that use the readline li- + ing commands in the _i_n_p_u_t_r_c file. Programs that use the rreeaaddlliinnee li- brary, including bbaasshh, may add their own commands and bindings. For example, placing @@ -3514,14 +3524,14 @@ RREEAADDLLIINNEE or C-Meta-u: universal-argument - into the _i_n_p_u_t_r_c would make M-C-u execute the readline command _u_n_i_v_e_r_- + into the _i_n_p_u_t_r_c would make M-C-u execute the rreeaaddlliinnee command _u_n_i_v_e_r_- _s_a_l_-_a_r_g_u_m_e_n_t. Key bindings may contain the following symbolic character names: _D_E_L, _E_S_C, _E_S_C_A_P_E, _L_F_D, _N_E_W_L_I_N_E, _R_E_T, _R_E_T_U_R_N, _R_U_B_O_U_T(a_d_e_s_t_r_u_c_t_i_v_ebackspace), _S_P_A_C_E, _S_P_C, and _T_A_B. - In addition to command names, readline allows keys to be bound to a + In addition to command names, rreeaaddlliinnee allows keys to be bound to a string that is inserted when the key is pressed (a _m_a_c_r_o). The differ- ence between a macro and a command is that a macro is enclosed in sin- gle or double quotes. @@ -3594,26 +3604,26 @@ RREEAADDLLIINNEE macro body. Backslash will quote any other character in the macro text, including " and '. - BBaasshh will display or modify the current readline key bindings with the + BBaasshh will display or modify the current rreeaaddlliinnee key bindings with the bbiinndd builtin command. The --oo eemmaaccss or --oo vvii options to the sseett builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) will change the editing mode during interactive use. RReeaaddlliinnee VVaarriiaabblleess - Readline has variables that can be used to further customize its behav- + RReeaaddlliinnee has variables that can be used to further customize its behav- ior. A variable may be set in the _i_n_p_u_t_r_c file with a statement of the form sseett _v_a_r_i_a_b_l_e_-_n_a_m_e _v_a_l_u_e or using the bbiinndd builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - Except where noted, readline variables can take the values OOnn or OOffff + Except where noted, rreeaaddlliinnee variables can take the values OOnn or OOffff (without regard to case). Unrecognized variable names are ignored. - When readline reads a variable value, empty or null values, "on" (case- + When rreeaaddlliinnee reads a variable value, empty or null values, "on" (case- insensitive), and "1" are equivalent to OOnn. All other values are equivalent to OOffff. - The bbiinndd --VV command lists the current readline variable names and val- + The bbiinndd --VV command lists the current rreeaaddlliinnee variable names and val- ues (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The variables and their default values are: @@ -3642,324 +3652,321 @@ RREEAADDLLIINNEE tained from the terminal's terminfo description. A sample value might be "\e[0m". bbeellll--ssttyyllee ((aauuddiibbllee)) - Controls what happens when readline wants to ring the terminal - bell. If set to nnoonnee, readline never rings the bell. If set to - vviissiibbllee, readline uses a visible bell if one is available. If - set to aauuddiibbllee, readline attempts to ring the terminal's bell. + Controls what happens when rreeaaddlliinnee wants to ring the terminal + bell. If set to nnoonnee, rreeaaddlliinnee never rings the bell. If set to + vviissiibbllee, rreeaaddlliinnee uses a visible bell if one is available. If + set to aauuddiibbllee, rreeaaddlliinnee attempts to ring the terminal's bell. bbiinndd--ttttyy--ssppeecciiaall--cchhaarrss ((OOnn)) - If set to OOnn, readline attempts to bind the control characters + If set to OOnn, rreeaaddlliinnee attempts to bind the control characters that are treated specially by the kernel's terminal driver to - their readline equivalents. These override the default readline + their rreeaaddlliinnee equivalents. These override the default rreeaaddlliinnee bindings described here. Type "stty -a" at a bbaasshh prompt to see your current terminal settings, including the special control characters (usually cccchhaarrss). bblliinnkk--mmaattcchhiinngg--ppaarreenn ((OOffff)) - If set to OOnn, readline attempts to briefly move the cursor to an + If set to OOnn, rreeaaddlliinnee attempts to briefly move the cursor to an opening parenthesis when a closing parenthesis is inserted. ccoolloorreedd--ccoommpplleettiioonn--pprreeffiixx ((OOffff)) - If set to OOnn, when listing completions, readline displays the + If set to OOnn, when listing completions, rreeaaddlliinnee displays the common prefix of the set of possible completions using a differ- ent color. The color definitions are taken from the value of the LLSS__CCOOLLOORRSS environment variable. If there is a color defini- - tion in $$LLSS__CCOOLLOORRSS for the custom suffix "readline-colored-com- - pletion-prefix", readline uses this color for the common prefix + tion in $$LLSS__CCOOLLOORRSS for the custom suffix ".readline-colored-com- + pletion-prefix", rreeaaddlliinnee uses this color for the common prefix instead of its default. ccoolloorreedd--ssttaattss ((OOffff)) - If set to OOnn, readline displays possible completions using dif- - ferent colors to indicate their file type. The color defini- - tions are taken from the value of the LLSS__CCOOLLOORRSS environment + If set to OOnn, rreeaaddlliinnee displays possible completions using dif- + ferent colors to indicate their file type. The color defini- + tions are taken from the value of the LLSS__CCOOLLOORRSS environment variable. ccoommmmeenntt--bbeeggiinn (("##")) - The string that the readline iinnsseerrtt--ccoommmmeenntt command inserts. - This command is bound to MM--## in emacs mode and to ## in vi com- + The string that the rreeaaddlliinnee iinnsseerrtt--ccoommmmeenntt command inserts. + This command is bound to MM--## in emacs mode and to ## in vi com- mand mode. ccoommpplleettiioonn--ddiissppllaayy--wwiiddtthh ((--11)) - The number of screen columns used to display possible matches - when performing completion. The value is ignored if it is less - than 0 or greater than the terminal screen width. A value of 0 - will cause matches to be displayed one per line. The default + The number of screen columns used to display possible matches + when performing completion. The value is ignored if it is less + than 0 or greater than the terminal screen width. A value of 0 + will cause matches to be displayed one per line. The default value is -1. ccoommpplleettiioonn--iiggnnoorree--ccaassee ((OOffff)) - If set to OOnn, readline performs filename matching and completion + If set to OOnn, rreeaaddlliinnee performs filename matching and completion in a case-insensitive fashion. ccoommpplleettiioonn--mmaapp--ccaassee ((OOffff)) - If set to OOnn, and ccoommpplleettiioonn--iiggnnoorree--ccaassee is enabled, readline - treats hyphens (_-) and underscores (__) as equivalent when per- + If set to OOnn, and ccoommpplleettiioonn--iiggnnoorree--ccaassee is enabled, rreeaaddlliinnee + treats hyphens (_-) and underscores (__) as equivalent when per- forming case-insensitive filename matching and completion. ccoommpplleettiioonn--pprreeffiixx--ddiissppllaayy--lleennggtthh ((00)) - The maximum length in characters of the common prefix of a list - of possible completions that is displayed without modification. - When set to a value greater than zero, readline replaces common + The maximum length in characters of the common prefix of a list + of possible completions that is displayed without modification. + When set to a value greater than zero, rreeaaddlliinnee replaces common prefixes longer than this value with an ellipsis when displaying possible completions. ccoommpplleettiioonn--qquueerryy--iitteemmss ((110000)) - This determines when the user is queried about viewing the num- - ber of possible completions generated by the ppoossssiibbllee--ccoommppllee-- - ttiioonnss command. It may be set to any integer value greater than - or equal to zero. If the number of possible completions is - greater than or equal to the value of this variable, readline - will ask whether or not the user wishes to view them; otherwise - readline simply lists them on the terminal. A zero value means - readline should never ask; negative values are treated as zero. + This determines when the user is queried about viewing the num- + ber of possible completions generated by the ppoossssiibbllee--ccoommppllee-- + ttiioonnss command. It may be set to any integer value greater than + or equal to zero. If the number of possible completions is + greater than or equal to the value of this variable, rreeaaddlliinnee + will ask whether or not the user wishes to view them; otherwise + rreeaaddlliinnee simply lists them on the terminal. A zero value means + rreeaaddlliinnee should never ask; negative values are treated as zero. ccoonnvveerrtt--mmeettaa ((OOnn)) - If set to OOnn, readline will convert characters it reads that + If set to OOnn, rreeaaddlliinnee will convert characters it reads that have the eighth bit set to an ASCII key sequence by clearing the eighth bit and prefixing it with an escape character (converting - the character to have the _m_e_t_a _p_r_e_f_i_x). The default is _O_n, but - readline will set it to _O_f_f if the locale contains characters + the character to have the meta prefix). The default is _O_n, but + rreeaaddlliinnee will set it to _O_f_f if the locale contains characters whose encodings may include bytes with the eighth bit set. This - variable is dependent on the LLCC__CCTTYYPPEE locale category, and may - change if the locale changes. This variable also affects key + variable is dependent on the LLCC__CCTTYYPPEE locale category, and may + change if the locale changes. This variable also affects key bindings; see the description of ffoorrccee--mmeettaa--pprreeffiixx below. ddiissaabbllee--ccoommpplleettiioonn ((OOffff)) - If set to OOnn, readline will inhibit word completion. Completion - characters will be inserted into the line as if they had been + If set to OOnn, rreeaaddlliinnee will inhibit word completion. Completion + characters will be inserted into the line as if they had been mapped to sseellff--iinnsseerrtt. eecchhoo--ccoonnttrrooll--cchhaarraacctteerrss ((OOnn)) - When set to OOnn, on operating systems that indicate they support - it, readline echoes a character corresponding to a signal gener- + When set to OOnn, on operating systems that indicate they support + it, rreeaaddlliinnee echoes a character corresponding to a signal gener- ated from the keyboard. eeddiittiinngg--mmooddee ((eemmaaccss)) - Controls whether readline uses a set of key bindings similar to + Controls whether rreeaaddlliinnee uses a set of key bindings similar to _E_m_a_c_s or _v_i. eeddiittiinngg--mmooddee can be set to either eemmaaccss or vvii. eemmaaccss--mmooddee--ssttrriinngg ((@@)) - If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is + If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is displayed immediately before the last line of the primary prompt when emacs editing mode is active. The value is expanded like a - key binding, so the standard set of meta- and control- prefixes - and backslash escape sequences is available. The \1 and \2 es- - capes begin and end sequences of non-printing characters, which - can be used to embed a terminal control sequence into the mode + key binding, so the standard set of meta- and control- prefixes + and backslash escape sequences is available. The \1 and \2 es- + capes begin and end sequences of non-printing characters, which + can be used to embed a terminal control sequence into the mode string. eennaabbllee--aaccttiivvee--rreeggiioonn ((OOnn)) - The _p_o_i_n_t is the current cursor position, and _m_a_r_k refers to a - saved cursor position. The text between the point and mark is - referred to as the _r_e_g_i_o_n. When this variable is set to _O_n, - readline allows certain commands to designate the region as _a_c_- - _t_i_v_e. When the region is active, readline highlights the text - in the region using the value of the aaccttiivvee--rreeggiioonn--ssttaarrtt--ccoolloorr, - which defaults to the string that enables the terminal's stand- - out mode. The active region shows the text inserted by brack- - eted-paste and any matching text found by incremental and non- - incremental history searches. + When this variable is set to _O_n, rreeaaddlliinnee allows certain com- + mands to designate the region as _a_c_t_i_v_e. When the region is ac- + tive, rreeaaddlliinnee highlights the text in the region using the value + of the aaccttiivvee--rreeggiioonn--ssttaarrtt--ccoolloorr, which defaults to the string + that enables the terminal's standout mode. The active region + shows the text inserted by bracketed-paste and any matching text + found by incremental and non-incremental history searches. eennaabbllee--bbrraacckkeetteedd--ppaassttee ((OOnn)) - When set to OOnn, readline configures the terminal to insert each - paste into the editing buffer as a single string of characters, - instead of treating each character as if it had been read from - the keyboard. This is called _b_r_a_c_k_e_t_e_d_-_p_a_s_t_e _m_o_d_e; it prevents - readline from executing any editing commands bound to key se- + When set to OOnn, rreeaaddlliinnee configures the terminal to insert each + paste into the editing buffer as a single string of characters, + instead of treating each character as if it had been read from + the keyboard. This is called _b_r_a_c_k_e_t_e_d_-_p_a_s_t_e _m_o_d_e; it prevents + rreeaaddlliinnee from executing any editing commands bound to key se- quences appearing in the pasted text. eennaabbllee--kkeeyyppaadd ((OOffff)) - When set to OOnn, readline will try to enable the application key- + When set to OOnn, rreeaaddlliinnee will try to enable the application key- pad when it is called. Some systems need this to enable the ar- row keys. eennaabbllee--mmeettaa--kkeeyy ((OOnn)) - When set to OOnn, readline will try to enable any meta modifier + When set to OOnn, rreeaaddlliinnee will try to enable any meta modifier key the terminal claims to support. On many terminals, the Meta - key is used to send eight-bit characters; this variable checks - for the terminal capability that indicates the terminal can en- - able and disable a mode that sets the eighth bit of a character - (0200) if the Meta key is held down when the character is typed + key is used to send eight-bit characters; this variable checks + for the terminal capability that indicates the terminal can en- + able and disable a mode that sets the eighth bit of a character + (0200) if the Meta key is held down when the character is typed (a meta character). eexxppaanndd--ttiillddee ((OOffff)) - If set to OOnn, readline performs tilde expansion when it attempts + If set to OOnn, rreeaaddlliinnee performs tilde expansion when it attempts word completion. ffoorrccee--mmeettaa--pprreeffiixx ((OOffff)) - If set to OOnn, readline modifies its behavior when binding key - sequences containing \M- or Meta- (see KKeeyy BBiinnddiinnggss above) by + If set to OOnn, rreeaaddlliinnee modifies its behavior when binding key + sequences containing \M- or Meta- (see KKeeyy BBiinnddiinnggss above) by converting a key sequence of the form \M-_C or Meta-_C to the two- - character sequence EESSCC_C (adding the _m_e_t_a _p_r_e_f_i_x). If - ffoorrccee--mmeettaa--pprreeffiixx is set to OOffff (the default), readline uses the - value of the ccoonnvveerrtt--mmeettaa variable to determine whether to per- - form this conversion: if ccoonnvveerrtt--mmeettaa is OOnn, readline performs - the conversion described above; if it is OOffff, readline converts + character sequence EESSCC _C (adding the meta prefix). If + ffoorrccee--mmeettaa--pprreeffiixx is set to OOffff (the default), rreeaaddlliinnee uses the + value of the ccoonnvveerrtt--mmeettaa variable to determine whether to per- + form this conversion: if ccoonnvveerrtt--mmeettaa is OOnn, rreeaaddlliinnee performs + the conversion described above; if it is OOffff, rreeaaddlliinnee converts _C to a meta character by setting the eighth bit (0200). hhiissttoorryy--pprreesseerrvvee--ppooiinntt ((OOffff)) - If set to OOnn, the history code attempts to place point at the - same location on each history line retrieved with pprreevviioouuss--hhiiss-- + If set to OOnn, the history code attempts to place point at the + same location on each history line retrieved with pprreevviioouuss--hhiiss-- ttoorryy or nneexxtt--hhiissttoorryy. hhiissttoorryy--ssiizzee ((uunnsseett)) - Set the maximum number of history entries saved in the history - list. If set to zero, any existing history entries are deleted + Set the maximum number of history entries saved in the history + list. If set to zero, any existing history entries are deleted and no new entries are saved. If set to a value less than zero, - the number of history entries is not limited. By default, bbaasshh - sets the the maximum number of history entries to the value of - the HHIISSTTSSIIZZEE shell variable. Setting _h_i_s_t_o_r_y_-_s_i_z_e to a non-nu- - meric value will set the maximum number of history entries to + the number of history entries is not limited. By default, bbaasshh + sets the the maximum number of history entries to the value of + the HHIISSTTSSIIZZEE shell variable. Setting _h_i_s_t_o_r_y_-_s_i_z_e to a non-nu- + meric value will set the maximum number of history entries to 500. hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff)) - Setting this variable to OOnn makes readline use a single line for - display, scrolling the input horizontally on a single screen - line when it becomes longer than the screen width rather than - wrapping to a new line. This setting is automatically enabled + Setting this variable to OOnn makes rreeaaddlliinnee use a single line for + display, scrolling the input horizontally on a single screen + line when it becomes longer than the screen width rather than + wrapping to a new line. This setting is automatically enabled for terminals of height 1. iinnppuutt--mmeettaa ((OOffff)) - If set to OOnn, readline will enable eight-bit input (that is, it - will not clear the eighth bit in the characters it reads), re- - gardless of what the terminal claims it can support. The de- - fault is _O_f_f, but readline will set it to _O_n if the locale con- - tains characters whose encodings may include bytes with the - eighth bit set. This variable is dependent on the LLCC__CCTTYYPPEE lo- - cale category, and its value may change if the locale changes. + If set to OOnn, rreeaaddlliinnee will enable eight-bit input (that is, it + will not clear the eighth bit in the characters it reads), re- + gardless of what the terminal claims it can support. The de- + fault is _O_f_f, but rreeaaddlliinnee will set it to _O_n if the locale con- + tains characters whose encodings may include bytes with the + eighth bit set. This variable is dependent on the LLCC__CCTTYYPPEE lo- + cale category, and its value may change if the locale changes. The name mmeettaa--ffllaagg is a synonym for iinnppuutt--mmeettaa. iisseeaarrcchh--tteerrmmiinnaattoorrss (("CC--[[CC--JJ")) - The string of characters that should terminate an incremental - search without subsequently executing the character as a com- - mand. If this variable has not been given a value, the charac- + The string of characters that should terminate an incremental + search without subsequently executing the character as a com- + mand. If this variable has not been given a value, the charac- ters _E_S_C and _C_-_J will terminate an incremental search. kkeeyymmaapp ((eemmaaccss)) - Set the current readline keymap. The set of valid keymap names - is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_c_o_m_- - _m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is - equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the + Set the current rreeaaddlliinnee keymap. The set of valid keymap names + is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_c_o_m_- + _m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is + equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the value of eeddiittiinngg--mmooddee also affects the default keymap. kkeeyysseeqq--ttiimmeeoouutt ((550000)) - Specifies the duration _r_e_a_d_l_i_n_e will wait for a character when - reading an ambiguous key sequence (one that can form a complete + Specifies the duration rreeaaddlliinnee will wait for a character when + reading an ambiguous key sequence (one that can form a complete key sequence using the input read so far, or can take additional - input to complete a longer key sequence). If readline does not - receive any input within the timeout, it will use the shorter - but complete key sequence. The value is specified in millisec- - onds, so a value of 1000 means that readline will wait one sec- - ond for additional input. If this variable is set to a value - less than or equal to zero, or to a non-numeric value, readline - will wait until another key is pressed to decide which key se- + input to complete a longer key sequence). If rreeaaddlliinnee does not + receive any input within the timeout, it will use the shorter + but complete key sequence. The value is specified in millisec- + onds, so a value of 1000 means that rreeaaddlliinnee will wait one sec- + ond for additional input. If this variable is set to a value + less than or equal to zero, or to a non-numeric value, rreeaaddlliinnee + will wait until another key is pressed to decide which key se- quence to complete. mmaarrkk--ddiirreeccttoorriieess ((OOnn)) If set to OOnn, completed directory names have a slash appended. mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff)) - If set to OOnn, readline displays history lines that have been + If set to OOnn, rreeaaddlliinnee displays history lines that have been modified with a preceding asterisk (**). mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess ((OOffff)) If set to OOnn, completed names which are symbolic links to direc- - tories have a slash appended, subject to the value of mmaarrkk--ddii-- + tories have a slash appended, subject to the value of mmaarrkk--ddii-- rreeccttoorriieess. mmaattcchh--hhiiddddeenn--ffiilleess ((OOnn)) - This variable, when set to OOnn, forces readline to match files - whose names begin with a "." (hidden files) when performing - filename completion. If set to OOffff, the user must include the + This variable, when set to OOnn, forces rreeaaddlliinnee to match files + whose names begin with a "." (hidden files) when performing + filename completion. If set to OOffff, the user must include the leading "." in the filename to be completed. mmeennuu--ccoommpplleettee--ddiissppllaayy--pprreeffiixx ((OOffff)) - If set to OOnn, menu completion displays the common prefix of the + If set to OOnn, menu completion displays the common prefix of the list of possible completions (which may be empty) before cycling through the list. oouuttppuutt--mmeettaa ((OOffff)) - If set to OOnn, readline will display characters with the eighth + If set to OOnn, rreeaaddlliinnee will display characters with the eighth bit set directly rather than as a meta-prefixed escape sequence. - The default is _O_f_f, but readline will set it to _O_n if the locale - contains characters whose encodings may include bytes with the - eighth bit set. This variable is dependent on the LLCC__CCTTYYPPEE lo- + The default is _O_f_f, but rreeaaddlliinnee will set it to _O_n if the locale + contains characters whose encodings may include bytes with the + eighth bit set. This variable is dependent on the LLCC__CCTTYYPPEE lo- cale category, and its value may change if the locale changes. ppaaggee--ccoommpplleettiioonnss ((OOnn)) - If set to OOnn, readline uses an internal _m_o_r_e-like pager to dis- + If set to OOnn, rreeaaddlliinnee uses an internal _m_o_r_e-like pager to dis- play a screenful of possible completions at a time. pprreeffeerr--vviissiibbllee--bbeellll See bbeellll--ssttyyllee. pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff)) - If set to OOnn, readline will display completions with matches - sorted horizontally in alphabetical order, rather than down the + If set to OOnn, rreeaaddlliinnee will display completions with matches + sorted horizontally in alphabetical order, rather than down the screen. rreevveerrtt--aallll--aatt--nneewwlliinnee ((OOffff)) - If set to OOnn, readline will undo all changes to history lines - before returning when executing aacccceepptt--lliinnee. By default, his- - tory lines may be modified and retain individual undo lists + If set to OOnn, rreeaaddlliinnee will undo all changes to history lines + before returning when executing aacccceepptt--lliinnee. By default, his- + tory lines may be modified and retain individual undo lists across calls to rreeaaddlliinnee. sseeaarrcchh--iiggnnoorree--ccaassee ((OOffff)) - If set to OOnn, readline performs incremental and non-incremental + If set to OOnn, rreeaaddlliinnee performs incremental and non-incremental history list searches in a case-insensitive fashion. sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff)) - This alters the default behavior of the completion functions. + This alters the default behavior of the completion functions. If set to OOnn, words which have more than one possible completion - cause the matches to be listed immediately instead of ringing + cause the matches to be listed immediately instead of ringing the bell. sshhooww--aallll--iiff--uunnmmooddiiffiieedd ((OOffff)) - This alters the default behavior of the completion functions in + This alters the default behavior of the completion functions in a fashion similar to sshhooww--aallll--iiff--aammbbiigguuoouuss. If set to OOnn, words - which have more than one possible completion without any possi- - ble partial completion (the possible completions don't share a - common prefix) cause the matches to be listed immediately in- + which have more than one possible completion without any possi- + ble partial completion (the possible completions don't share a + common prefix) cause the matches to be listed immediately in- stead of ringing the bell. sshhooww--mmooddee--iinn--pprroommpptt ((OOffff)) - If set to OOnn, add a string to the beginning of the prompt indi- - cating the editing mode: emacs, vi command, or vi insertion. + If set to OOnn, add a string to the beginning of the prompt indi- + cating the editing mode: emacs, vi command, or vi insertion. The mode strings are user-settable (e.g., _e_m_a_c_s_-_m_o_d_e_-_s_t_r_i_n_g). sskkiipp--ccoommpplleetteedd--tteexxtt ((OOffff)) - If set to OOnn, this alters the default completion behavior when - inserting a single match into the line. It's only active when - performing completion in the middle of a word. If enabled, - readline does not insert characters from the completion that - match characters after point in the word being completed, so + If set to OOnn, this alters the default completion behavior when + inserting a single match into the line. It's only active when + performing completion in the middle of a word. If enabled, + rreeaaddlliinnee does not insert characters from the completion that + match characters after point in the word being completed, so portions of the word following the cursor are not duplicated. vvii--ccmmdd--mmooddee--ssttrriinngg ((((ccmmdd)))) - If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is + If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is displayed immediately before the last line of the primary prompt - when vi editing mode is active and in command mode. The value + when vi editing mode is active and in command mode. The value is expanded like a key binding, so the standard set of meta- and - control- prefixes and backslash escape sequences is available. - The \1 and \2 escapes begin and end sequences of non-printing - characters, which can be used to embed a terminal control se- + control- prefixes and backslash escape sequences is available. + The \1 and \2 escapes begin and end sequences of non-printing + characters, which can be used to embed a terminal control se- quence into the mode string. vvii--iinnss--mmooddee--ssttrriinngg ((((iinnss)))) - If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is + If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is displayed immediately before the last line of the primary prompt when vi editing mode is active and in insertion mode. The value is expanded like a key binding, so the standard set of meta- and - control- prefixes and backslash escape sequences is available. - The \1 and \2 escapes begin and end sequences of non-printing - characters, which can be used to embed a terminal control se- + control- prefixes and backslash escape sequences is available. + The \1 and \2 escapes begin and end sequences of non-printing + characters, which can be used to embed a terminal control se- quence into the mode string. vviissiibbllee--ssttaattss ((OOffff)) - If set to OOnn, a character denoting a file's type as reported by - _s_t_a_t(2) is appended to the filename when listing possible com- + If set to OOnn, a character denoting a file's type as reported by + _s_t_a_t(2) is appended to the filename when listing possible com- pletions. RReeaaddlliinnee CCoonnddiittiioonnaall CCoonnssttrruuccttss - Readline implements a facility similar in spirit to the conditional - compilation features of the C preprocessor which allows key bindings - and variable settings to be performed as the result of tests. There + RReeaaddlliinnee implements a facility similar in spirit to the conditional + compilation features of the C preprocessor which allows key bindings + and variable settings to be performed as the result of tests. There are four parser directives available. - $$iiff The $$iiff construct allows bindings to be made based on the edit- - ing mode, the terminal being used, or the application using - readline. The text of the test, after any comparison operator, + $$iiff The $$iiff construct allows bindings to be made based on the edit- + ing mode, the terminal being used, or the application using + rreeaaddlliinnee. The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no char- acters are required to isolate it. - mmooddee The mmooddee== form of the $$iiff directive is used to test - whether readline is in emacs or vi mode. This may be - used in conjunction with the sseett kkeeyymmaapp command, for in- - stance, to set bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and - _e_m_a_c_s_-_c_t_l_x keymaps only if readline is starting out in + mmooddee The mmooddee== form of the $$iiff directive is used to test + whether rreeaaddlliinnee is in emacs or vi mode. This may be + used in conjunction with the sseett kkeeyymmaapp command, for in- + stance, to set bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and + _e_m_a_c_s_-_c_t_l_x keymaps only if rreeaaddlliinnee is starting out in emacs mode. - tteerrmm The tteerrmm== form may be used to include terminal-specific + tteerrmm The tteerrmm== form may be used to include terminal-specific key bindings, perhaps to bind the key sequences output by the terminal's function keys. The word on the right side of the == is tested against both the full name of the ter- - minal and the portion of the terminal name before the - first --. This allows _x_t_e_r_m to match both _x_t_e_r_m and + minal and the portion of the terminal name before the + first --. This allows _x_t_e_r_m to match both _x_t_e_r_m and _x_t_e_r_m_-_2_5_6_c_o_l_o_r, for instance. vveerrssiioonn - The vveerrssiioonn test may be used to perform comparisons - against specific readline versions. The vveerrssiioonn expands - to the current readline version. The set of comparison - operators includes ==, (and ====), !!==, <<==, >>==, <<, and >>. - The version number supplied on the right side of the op- - erator consists of a major version number, an optional + The vveerrssiioonn test may be used to perform comparisons + against specific rreeaaddlliinnee versions. The vveerrssiioonn expands + to the current rreeaaddlliinnee version. The set of comparison + operators includes ==, (and ====), !!==, <<==, >>==, <<, and >>. + The version number supplied on the right side of the op- + erator consists of a major version number, an optional decimal point, and an optional minor version (e.g., 77..11). - If the minor version is omitted, it defaults to 00. The - operator may be separated from the string vveerrssiioonn and + If the minor version is omitted, it defaults to 00. The + operator may be separated from the string vveerrssiioonn and from the version number argument by whitespace. _a_p_p_l_i_c_a_t_i_o_n The _a_p_p_l_i_c_a_t_i_o_n construct is used to include application- - specific settings. Each program using the readline li- - brary sets the _a_p_p_l_i_c_a_t_i_o_n _n_a_m_e, and an initialization + specific settings. Each program using the rreeaaddlliinnee li- + brary sets the _a_p_p_l_i_c_a_t_i_o_n _n_a_m_e, and an initialization file can test for a particular value. This could be used - to bind key sequences to functions useful for a specific - program. For instance, the following command adds a key - sequence that quotes the current or previous word in + to bind key sequences to functions useful for a specific + program. For instance, the following command adds a key + sequence that quotes the current or previous word in bbaasshh: $$iiff Bash @@ -3969,12 +3976,12 @@ RREEAADDLLIINNEE _v_a_r_i_a_b_l_e The _v_a_r_i_a_b_l_e construct provides simple equality tests for - readline variables and values. The permitted comparison - operators are _=, _=_=, and _!_=. The variable name must be + rreeaaddlliinnee variables and values. The permitted comparison + operators are _=, _=_=, and _!_=. The variable name must be separated from the comparison operator by whitespace; the - operator may be separated from the value on the right - hand side by whitespace. String and boolean variables - may be tested. Boolean variables must be tested against + operator may be separated from the value on the right + hand side by whitespace. String and boolean variables + may be tested. Boolean variables must be tested against the values _o_n and _o_f_f. $$eellssee Commands in this branch of the $$iiff directive are executed if the @@ -3984,67 +3991,67 @@ RREEAADDLLIINNEE command. $$iinncclluuddee - This directive takes a single filename as an argument and reads + This directive takes a single filename as an argument and reads commands and key bindings from that file. For example, the fol- lowing directive would read _/_e_t_c_/_i_n_p_u_t_r_c: $$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c SSeeaarrcchhiinngg - Readline provides commands for searching through the command history + RReeaaddlliinnee provides commands for searching through the command history (see HHIISSTTOORRYY below) for lines containing a specified string. There are two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-_i_n_c_r_e_m_e_n_t_a_l. - Incremental searches begin before the user has finished typing the - search string. As each character of the search string is typed, read- - line displays the next entry from the history matching the string typed - so far. An incremental search requires only as many characters as - needed to find the desired history entry. When using emacs editing - mode, type CC--rr to search backward in the history for a particular - string. Typing CC--ss searches forward through the history. The charac- - ters present in the value of the iisseeaarrcchh--tteerrmmiinnaattoorrss variable are used - to terminate an incremental search. If that variable has not been as- - signed a value, _E_S_C and _C_-_J will terminate an incremental search. _C_-_g - will abort an incremental search and restore the original line. When - the search is terminated, the history entry containing the search + Incremental searches begin before the user has finished typing the + search string. As each character of the search string is typed, rreeaadd-- + lliinnee displays the next entry from the history matching the string typed + so far. An incremental search requires only as many characters as + needed to find the desired history entry. When using emacs editing + mode, type CC--rr to search backward in the history for a particular + string. Typing CC--ss searches forward through the history. The charac- + ters present in the value of the iisseeaarrcchh--tteerrmmiinnaattoorrss variable are used + to terminate an incremental search. If that variable has not been as- + signed a value, _E_S_C and _C_-_J will terminate an incremental search. _C_-_g + will abort an incremental search and restore the original line. When + the search is terminated, the history entry containing the search string becomes the current line. - To find other matching entries in the history list, type CC--rr or CC--ss as - appropriate. This will search backward or forward in the history for - the next entry matching the search string typed so far. Any other key - sequence bound to a readline command will terminate the search and exe- - cute that command. For instance, a newline will terminate the search - and accept the line, thereby executing the command from the history + To find other matching entries in the history list, type CC--rr or CC--ss as + appropriate. This will search backward or forward in the history for + the next entry matching the search string typed so far. Any other key + sequence bound to a rreeaaddlliinnee command will terminate the search and exe- + cute that command. For instance, a newline will terminate the search + and accept the line, thereby executing the command from the history list. A movement command will terminate the search, make the last line found the current line, and begin editing. - Readline remembers the last incremental search string. If two CC--rrs are - typed without any intervening characters defining a new search string, - readline uses any remembered search string. + RReeaaddlliinnee remembers the last incremental search string. If two CC--rrs are + typed without any intervening characters defining a new search string, + rreeaaddlliinnee uses any remembered search string. - Non-incremental searches read the entire search string before starting + Non-incremental searches read the entire search string before starting to search for matching history entries. The search string may be typed by the user or be part of the contents of the current line. RReeaaddlliinnee CCoommmmaanndd NNaammeess - The following is a list of the names of the commands and the default + The following is a list of the names of the commands and the default key sequences to which they are bound. Command names without an accom- panying key sequence are unbound by default. In the following descriptions, _p_o_i_n_t refers to the current cursor posi- - tion, and _m_a_r_k refers to a cursor position saved by the sseett--mmaarrkk com- - mand. The text between the point and mark is referred to as the _r_e_- - _g_i_o_n. Readline has the concept of an _a_c_t_i_v_e _r_e_g_i_o_n: when the region is - active, readline redisplay uses the value of the aaccttiivvee--rree-- - ggiioonn--ssttaarrtt--ccoolloorr vvaarriiaabbllee ttoo ddeennoottee tthhee rreeggiioonn.. SSeevveerraall ccoommmmaannddss sseett + tion, and _m_a_r_k refers to a cursor position saved by the sseett--mmaarrkk com- + mand. The text between the point and mark is referred to as the _r_e_- + _g_i_o_n. RReeaaddlliinnee has the concept of an _a_c_t_i_v_e _r_e_g_i_o_n: when the region is + active, rreeaaddlliinnee redisplay uses the value of the aaccttiivvee--rree-- + ggiioonn--ssttaarrtt--ccoolloorr vvaarriiaabbllee ttoo ddeennoottee tthhee rreeggiioonn.. SSeevveerraall ccoommmmaannddss sseett tthhee rreeggiioonn ttoo aaccttiivvee;; tthhoossee aarree nnootteedd bbeellooww.. CCoommmmaannddss ffoorr MMoovviinngg bbeeggiinnnniinngg--ooff--lliinnee ((CC--aa)) - Move to the start of the current line. This may also be bound + Move to the start of the current line. This may also be bound to the Home key on some keyboards. eenndd--ooff--lliinnee ((CC--ee)) - Move to the end of the line. This may also be bound to the End + Move to the end of the line. This may also be bound to the End key on some keyboards. ffoorrwwaarrdd--cchhaarr ((CC--ff)) Move forward a character. @@ -4054,33 +4061,33 @@ RREEAADDLLIINNEE Move forward to the end of the next word. Words are composed of alphanumeric characters (letters and digits). bbaacckkwwaarrdd--wwoorrdd ((MM--bb)) - Move back to the start of the current or previous word. Words + Move back to the start of the current or previous word. Words are composed of alphanumeric characters (letters and digits). sshheellll--ffoorrwwaarrdd--wwoorrdd - Move forward to the end of the next word. Words are delimited + Move forward to the end of the next word. Words are delimited by non-quoted shell metacharacters. sshheellll--bbaacckkwwaarrdd--wwoorrdd - Move back to the start of the current or previous word. Words + Move back to the start of the current or previous word. Words are delimited by non-quoted shell metacharacters. pprreevviioouuss--ssccrreeeenn--lliinnee - Attempt to move point to the same physical screen column on the - previous physical screen line. This will not have the desired - effect if the current readline line does not take up more than - one physical line or if point is not greater than the length of + Attempt to move point to the same physical screen column on the + previous physical screen line. This will not have the desired + effect if the current rreeaaddlliinnee line does not take up more than + one physical line or if point is not greater than the length of the prompt plus the screen width. nneexxtt--ssccrreeeenn--lliinnee - Attempt to move point to the same physical screen column on the - next physical screen line. This will not have the desired ef- - fect if the current readline line does not take up more than one - physical line or if the length of the current readline line is + Attempt to move point to the same physical screen column on the + next physical screen line. This will not have the desired ef- + fect if the current rreeaaddlliinnee line does not take up more than one + physical line or if the length of the current rreeaaddlliinnee line is not greater than the length of the prompt plus the screen width. cclleeaarr--ddiissppllaayy ((MM--CC--ll)) - Clear the screen and, if possible, the terminal's scrollback - buffer, then redraw the current line, leaving the current line + Clear the screen and, if possible, the terminal's scrollback + buffer, then redraw the current line, leaving the current line at the top of the screen. cclleeaarr--ssccrreeeenn ((CC--ll)) Clear the screen, then redraw the current line, leaving the cur- - rent line at the top of the screen. With an argument, refresh + rent line at the top of the screen. With an argument, refresh the current line without clearing the screen. rreeddrraaww--ccuurrrreenntt--lliinnee Refresh the current line. @@ -4088,46 +4095,46 @@ RREEAADDLLIINNEE CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn)) Accept the line regardless of where the cursor is. If this line - is non-empty, add it to the history list according to the state - of the HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables. If the line is a - modified history line, restore the history line to its original + is non-empty, add it to the history list according to the state + of the HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables. If the line is a + modified history line, restore the history line to its original state. pprreevviioouuss--hhiissttoorryy ((CC--pp)) Fetch the previous command from the history list, moving back in the list. nneexxtt--hhiissttoorryy ((CC--nn)) - Fetch the next command from the history list, moving forward in + Fetch the next command from the history list, moving forward in the list. bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<)) Move to the first line in the history. eenndd--ooff--hhiissttoorryy ((MM-->>)) - Move to the end of the input history, i.e., the line currently + Move to the end of the input history, i.e., the line currently being entered. ooppeerraattee--aanndd--ggeett--nneexxtt ((CC--oo)) - Accept the current line for execution as if a newline had been - entered, and fetch the next line relative to the current line - from the history for editing. A numeric argument, if supplied, + Accept the current line for execution as if a newline had been + entered, and fetch the next line relative to the current line + from the history for editing. A numeric argument, if supplied, specifies the history entry to use instead of the current line. ffeettcchh--hhiissttoorryy - With a numeric argument, fetch that entry from the history list + With a numeric argument, fetch that entry from the history list and make it the current line. Without an argument, move back to the first entry in the history list. rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr)) - Search backward starting at the current line and moving "up" - through the history as necessary. This is an incremental - search. This command sets the region to the matched text and - activates the region. - ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss)) - Search forward starting at the current line and moving "down" + Search backward starting at the current line and moving "up" through the history as necessary. This is an incremental search. This command sets the region to the matched text and activates the region. + ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss)) + Search forward starting at the current line and moving "down" + through the history as necessary. This is an incremental + search. This command sets the region to the matched text and + activates the region. nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp)) Search backward through the history starting at the current line - using a non-incremental search for a string supplied by the + using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line. nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn)) - Search forward through the history using a non-incremental + Search forward through the history using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line. hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd @@ -4137,74 +4144,74 @@ RREEAADDLLIINNEE non-incremental search. This may be bound to the Page Up key on some keyboards. hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd - Search forward through the history for the string of characters + Search forward through the history for the string of characters between the start of the current line and the point. The search string must match at the beginning of a history line. This is a - non-incremental search. This may be bound to the Page Down key + non-incremental search. This may be bound to the Page Down key on some keyboards. hhiissttoorryy--ssuubbssttrriinngg--sseeaarrcchh--bbaacckkwwaarrdd Search backward through the history for the string of characters between the start of the current line and the point. The search - string may match anywhere in a history line. This is a non-in- + string may match anywhere in a history line. This is a non-in- cremental search. hhiissttoorryy--ssuubbssttrriinngg--sseeaarrcchh--ffoorrwwaarrdd - Search forward through the history for the string of characters + Search forward through the history for the string of characters between the start of the current line and the point. The search - string may match anywhere in a history line. This is a non-in- + string may match anywhere in a history line. This is a non-in- cremental search. yyaannkk--nntthh--aarrgg ((MM--CC--yy)) - Insert the first argument to the previous command (usually the + Insert the first argument to the previous command (usually the second word on the previous line) at point. With an argument _n, - insert the _nth word from the previous command (the words in the - previous command begin with word 0). A negative argument in- - serts the _nth word from the end of the previous command. Once - the argument _n is computed, this uses the history expansion fa- - cilities to extract the _nth word, as if the "!_n" history expan- + insert the _nth word from the previous command (the words in the + previous command begin with word 0). A negative argument in- + serts the _nth word from the end of the previous command. Once + the argument _n is computed, this uses the history expansion fa- + cilities to extract the _nth word, as if the "!_n" history expan- sion had been specified. yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__)) - Insert the last argument to the previous command (the last word + Insert the last argument to the previous command (the last word of the previous history entry). With a numeric argument, behave - exactly like yyaannkk--nntthh--aarrgg. Successive calls to yyaannkk--llaasstt--aarrgg - move back through the history list, inserting the last word (or - the word specified by the argument to the first call) of each + exactly like yyaannkk--nntthh--aarrgg. Successive calls to yyaannkk--llaasstt--aarrgg + move back through the history list, inserting the last word (or + the word specified by the argument to the first call) of each line in turn. Any numeric argument supplied to these successive - calls determines the direction to move through the history. A - negative argument switches the direction through the history - (back or forward). This uses the history expansion facilities - to extract the last word, as if the "!$" history expansion had + calls determines the direction to move through the history. A + negative argument switches the direction through the history + (back or forward). This uses the history expansion facilities + to extract the last word, as if the "!$" history expansion had been specified. sshheellll--eexxppaanndd--lliinnee ((MM--CC--ee)) - Expand the line by performing shell word expansions. This per- + Expand the line by performing shell word expansions. This per- forms alias and history expansion, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quot- - ing, tilde expansion, parameter and variable expansion, arith- - metic expansion, command and process substitution, word split- - ting, and quote removal. An explicit argument suppresses com- - mand and process substitution. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for + ing, tilde expansion, parameter and variable expansion, arith- + metic expansion, command and process substitution, word split- + ting, and quote removal. An explicit argument suppresses com- + mand and process substitution. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history expansion. hhiissttoorryy--eexxppaanndd--lliinnee ((MM--^^)) - Perform history expansion on the current line. See HHIISSTTOORRYY EEXX-- + Perform history expansion on the current line. See HHIISSTTOORRYY EEXX-- PPAANNSSIIOONN below for a description of history expansion. mmaaggiicc--ssppaaccee - Perform history expansion on the current line and insert a + Perform history expansion on the current line and insert a space. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history expansion. aalliiaass--eexxppaanndd--lliinnee - Perform alias expansion on the current line. See AALLIIAASSEESS above + Perform alias expansion on the current line. See AALLIIAASSEESS above for a description of alias expansion. hhiissttoorryy--aanndd--aalliiaass--eexxppaanndd--lliinnee Perform history and alias expansion on the current line. iinnsseerrtt--llaasstt--aarrgguummeenntt ((MM--..,, MM--__)) A synonym for yyaannkk--llaasstt--aarrgg. eeddiitt--aanndd--eexxeeccuuttee--ccoommmmaanndd ((CC--xx CC--ee)) - Invoke an editor on the current command line, and execute the + Invoke an editor on the current command line, and execute the result as shell commands. BBaasshh attempts to invoke $$VVIISSUUAALL, $$EEDD-- IITTOORR, and _e_m_a_c_s as the editor, in that order. CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt _e_n_d_-_o_f_-_f_i_l_e ((uussuuaallllyy CC--dd)) - The character indicating end-of-file as set, for example, by + The character indicating end-of-file as set, for example, by _s_t_t_y(1). If this character is read when there are no characters - on the line, and point is at the beginning of the line, readline + on the line, and point is at the beginning of the line, rreeaaddlliinnee interprets it as the end of input and returns EEOOFF. ddeelleettee--cchhaarr ((CC--dd)) Delete the character at point. If this function is bound to the @@ -4212,173 +4219,173 @@ RREEAADDLLIINNEE above for the effects. This may also be bound to the Delete key on some keyboards. bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt)) - Delete the character behind the cursor. When given a numeric + Delete the character behind the cursor. When given a numeric argument, save the deleted text on the kill ring. ffoorrwwaarrdd--bbaacckkwwaarrdd--ddeelleettee--cchhaarr - Delete the character under the cursor, unless the cursor is at + Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cur- sor is deleted. qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv)) - Add the next character typed to the line verbatim. This is how + Add the next character typed to the line verbatim. This is how to insert characters like CC--qq, for example. ttaabb--iinnsseerrtt ((CC--vv TTAABB)) Insert a tab character. sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ...)) Insert the character typed. bbrraacckkeetteedd--ppaassttee--bbeeggiinn - This function is intended to be bound to the "bracketed paste" - escape sequence sent by some terminals, and such a binding is - assigned by default. It allows readline to insert the pasted - text as a single unit without treating each character as if it - had been read from the keyboard. The pasted characters are in- - serted as if each one was bound to sseellff--iinnsseerrtt instead of exe- + This function is intended to be bound to the "bracketed paste" + escape sequence sent by some terminals, and such a binding is + assigned by default. It allows rreeaaddlliinnee to insert the pasted + text as a single unit without treating each character as if it + had been read from the keyboard. The pasted characters are in- + serted as if each one was bound to sseellff--iinnsseerrtt instead of exe- cuting any editing commands. - Bracketed paste sets the region to the inserted text and acti- + Bracketed paste sets the region to the inserted text and acti- vates the region. ttrraannssppoossee--cchhaarrss ((CC--tt)) - Drag the character before point forward over the character at - point, moving point forward as well. If point is at the end of - the line, then this transposes the two characters before point. + Drag the character before point forward over the character at + point, moving point forward as well. If point is at the end of + the line, then this transposes the two characters before point. Negative arguments have no effect. ttrraannssppoossee--wwoorrddss ((MM--tt)) - Drag the word before point past the word after point, moving - point over that word as well. If point is at the end of the + Drag the word before point past the word after point, moving + point over that word as well. If point is at the end of the line, this transposes the last two words on the line. sshheellll--ttrraannssppoossee--wwoorrddss ((MM--CC--tt)) - Drag the word before point past the word after point, moving - point past that word as well. If the insertion point is at the + Drag the word before point past the word after point, moving + point past that word as well. If the insertion point is at the end of the line, this transposes the last two words on the line. - Word boundaries are the same as sshheellll--ffoorrwwaarrdd--wwoorrdd and + Word boundaries are the same as sshheellll--ffoorrwwaarrdd--wwoorrdd and sshheellll--bbaacckkwwaarrdd--wwoorrdd. uuppccaassee--wwoorrdd ((MM--uu)) - Uppercase the current (or following) word. With a negative ar- + Uppercase the current (or following) word. With a negative ar- gument, uppercase the previous word, but do not move point. ddoowwnnccaassee--wwoorrdd ((MM--ll)) - Lowercase the current (or following) word. With a negative ar- + Lowercase the current (or following) word. With a negative ar- gument, lowercase the previous word, but do not move point. ccaappiittaalliizzee--wwoorrdd ((MM--cc)) Capitalize the current (or following) word. With a negative ar- gument, capitalize the previous word, but do not move point. oovveerrwwrriittee--mmooddee - Toggle overwrite mode. With an explicit positive numeric argu- + Toggle overwrite mode. With an explicit positive numeric argu- ment, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects - only eemmaaccss mode; vvii mode does overwrite differently. Each call + only eemmaaccss mode; vvii mode does overwrite differently. Each call to _r_e_a_d_l_i_n_e_(_) starts in insert mode. - In overwrite mode, characters bound to sseellff--iinnsseerrtt replace the - text at point rather than pushing the text to the right. Char- - acters bound to bbaacckkwwaarrdd--ddeelleettee--cchhaarr replace the character be- - fore point with a space. By default, this command is unbound, + In overwrite mode, characters bound to sseellff--iinnsseerrtt replace the + text at point rather than pushing the text to the right. Char- + acters bound to bbaacckkwwaarrdd--ddeelleettee--cchhaarr replace the character be- + fore point with a space. By default, this command is unbound, but may be bound to the Insert key on some keyboards. KKiilllliinngg aanndd YYaannkkiinngg kkiillll--lliinnee ((CC--kk)) Kill the text from point to the end of the current line. With a - negative numeric argument, kill backward from the cursor to the + negative numeric argument, kill backward from the cursor to the beginning of the line. bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt)) Kill backward to the beginning of the current line. With a neg- - ative numeric argument, kill forward from the cursor to the end + ative numeric argument, kill forward from the cursor to the end of the line. uunniixx--lliinnee--ddiissccaarrdd ((CC--uu)) - Kill backward from point to the beginning of the line, saving + Kill backward from point to the beginning of the line, saving the killed text on the kill-ring. kkiillll--wwhhoollee--lliinnee - Kill all characters on the current line, no matter where point + Kill all characters on the current line, no matter where point is. kkiillll--wwoorrdd ((MM--dd)) - Kill from point to the end of the current word, or if between - words, to the end of the next word. Word boundaries are the + Kill from point to the end of the current word, or if between + words, to the end of the next word. Word boundaries are the same as those used by ffoorrwwaarrdd--wwoorrdd. bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt)) - Kill the word behind point. Word boundaries are the same as + Kill the word behind point. Word boundaries are the same as those used by bbaacckkwwaarrdd--wwoorrdd. sshheellll--kkiillll--wwoorrdd ((MM--CC--dd)) - Kill from point to the end of the current word, or if between - words, to the end of the next word. Word boundaries are the + Kill from point to the end of the current word, or if between + words, to the end of the next word. Word boundaries are the same as those used by sshheellll--ffoorrwwaarrdd--wwoorrdd. sshheellll--bbaacckkwwaarrdd--kkiillll--wwoorrdd - Kill the word behind point. Word boundaries are the same as + Kill the word behind point. Word boundaries are the same as those used by sshheellll--bbaacckkwwaarrdd--wwoorrdd. uunniixx--wwoorrdd--rruubboouutt ((CC--ww)) - Kill the word behind point, using white space as a word bound- + Kill the word behind point, using white space as a word bound- ary, saving the killed text on the kill-ring. uunniixx--ffiilleennaammee--rruubboouutt - Kill the word behind point, using white space and the slash - character as the word boundaries, saving the killed text on the + Kill the word behind point, using white space and the slash + character as the word boundaries, saving the killed text on the kill-ring. ddeelleettee--hhoorriizzoonnttaall--ssppaaccee ((MM--\\)) Delete all spaces and tabs around point. kkiillll--rreeggiioonn Kill the text in the current region. ccooppyy--rreeggiioonn--aass--kkiillll - Copy the text in the region to the kill buffer, so it can be + Copy the text in the region to the kill buffer, so it can be yanked immediately. ccooppyy--bbaacckkwwaarrdd--wwoorrdd - Copy the word before point to the kill buffer. The word bound- + Copy the word before point to the kill buffer. The word bound- aries are the same as bbaacckkwwaarrdd--wwoorrdd. ccooppyy--ffoorrwwaarrdd--wwoorrdd - Copy the word following point to the kill buffer. The word + Copy the word following point to the kill buffer. The word boundaries are the same as ffoorrwwaarrdd--wwoorrdd. yyaannkk ((CC--yy)) Yank the top of the kill ring into the buffer at point. yyaannkk--ppoopp ((MM--yy)) - Rotate the kill ring, and yank the new top. Only works follow- + Rotate the kill ring, and yank the new top. Only works follow- ing yyaannkk or yyaannkk--ppoopp. NNuummeerriicc AArrgguummeennttss ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ...,, MM----)) - Add this digit to the argument already accumulating, or start a + Add this digit to the argument already accumulating, or start a new argument. M-- starts a negative argument. uunniivveerrssaall--aarrgguummeenntt - This is another way to specify an argument. If this command is - followed by one or more digits, optionally with a leading minus - sign, those digits define the argument. If the command is fol- + This is another way to specify an argument. If this command is + followed by one or more digits, optionally with a leading minus + sign, those digits define the argument. If the command is fol- lowed by digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the nu- meric argument, but is otherwise ignored. As a special case, if this command is immediately followed by a character that is nei- - ther a digit nor minus sign, the argument count for the next - command is multiplied by four. The argument count is initially - one, so executing this function the first time makes the argu- + ther a digit nor minus sign, the argument count for the next + command is multiplied by four. The argument count is initially + one, so executing this function the first time makes the argu- ment count four, a second time makes the argument count sixteen, and so on. CCoommpplleettiinngg ccoommpplleettee ((TTAABB)) - Attempt to perform completion on the text before point. BBaasshh - attempts completion by first checking for any programmable com- - pletions for the command word (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn be- + Attempt to perform completion on the text before point. BBaasshh + attempts completion by first checking for any programmable com- + pletions for the command word (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn be- low), otherwise treating the text as a variable (if the text be- gins with $$), username (if the text begins with ~~), hostname (if - the text begins with @@), or command (including aliases, func- - tions, and builtins) in turn. If none of these produces a + the text begins with @@), or command (including aliases, func- + tions, and builtins) in turn. If none of these produces a match, it falls back to filename completion. ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??)) - List the possible completions of the text before point. When - displaying completions, readline sets the number of columns used - for display to the value of ccoommpplleettiioonn--ddiissppllaayy--wwiiddtthh, the value - of the shell variable CCOOLLUUMMNNSS, or the screen width, in that or- + List the possible completions of the text before point. When + displaying completions, rreeaaddlliinnee sets the number of columns used + for display to the value of ccoommpplleettiioonn--ddiissppllaayy--wwiiddtthh, the value + of the shell variable CCOOLLUUMMNNSS, or the screen width, in that or- der. iinnsseerrtt--ccoommpplleettiioonnss ((MM--**)) - Insert all completions of the text before point that would have + Insert all completions of the text before point that would have been generated by ppoossssiibbllee--ccoommpplleettiioonnss, separated by a space. mmeennuu--ccoommpplleettee - Similar to ccoommpplleettee, but replaces the word to be completed with - a single match from the list of possible completions. Repeat- - edly executing mmeennuu--ccoommpplleettee steps through the list of possible - completions, inserting each match in turn. At the end of the - list of completions, mmeennuu--ccoommpplleettee rings the bell (subject to - the setting of bbeellll--ssttyyllee) and restores the original text. An - argument of _n moves _n positions forward in the list of matches; - a negative argument moves backward through the list. This com- + Similar to ccoommpplleettee, but replaces the word to be completed with + a single match from the list of possible completions. Repeat- + edly executing mmeennuu--ccoommpplleettee steps through the list of possible + completions, inserting each match in turn. At the end of the + list of completions, mmeennuu--ccoommpplleettee rings the bell (subject to + the setting of bbeellll--ssttyyllee) and restores the original text. An + argument of _n moves _n positions forward in the list of matches; + a negative argument moves backward through the list. This com- mand is intended to be bound to TTAABB, but is unbound by default. mmeennuu--ccoommpplleettee--bbaacckkwwaarrdd - Identical to mmeennuu--ccoommpplleettee, but moves backward through the list - of possible completions, as if mmeennuu--ccoommpplleettee had been given a + Identical to mmeennuu--ccoommpplleettee, but moves backward through the list + of possible completions, as if mmeennuu--ccoommpplleettee had been given a negative argument. This command is unbound by default. ddeelleettee--cchhaarr--oorr--lliisstt - Deletes the character under the cursor if not at the beginning - or end of the line (like ddeelleettee--cchhaarr). At the end of the line, + Deletes the character under the cursor if not at the beginning + or end of the line (like ddeelleettee--cchhaarr). At the end of the line, it behaves identically to ppoossssiibbllee--ccoommpplleettiioonnss. This command is unbound by default. ccoommpplleettee--ffiilleennaammee ((MM--//)) @@ -4387,66 +4394,66 @@ RREEAADDLLIINNEE List the possible completions of the text before point, treating it as a filename. ccoommpplleettee--uusseerrnnaammee ((MM--~~)) - Attempt completion on the text before point, treating it as a + Attempt completion on the text before point, treating it as a username. ppoossssiibbllee--uusseerrnnaammee--ccoommpplleettiioonnss ((CC--xx ~~)) List the possible completions of the text before point, treating it as a username. ccoommpplleettee--vvaarriiaabbllee ((MM--$$)) - Attempt completion on the text before point, treating it as a + Attempt completion on the text before point, treating it as a shell variable. ppoossssiibbllee--vvaarriiaabbllee--ccoommpplleettiioonnss ((CC--xx $$)) List the possible completions of the text before point, treating it as a shell variable. ccoommpplleettee--hhoossttnnaammee ((MM--@@)) - Attempt completion on the text before point, treating it as a + Attempt completion on the text before point, treating it as a hostname. ppoossssiibbllee--hhoossttnnaammee--ccoommpplleettiioonnss ((CC--xx @@)) List the possible completions of the text before point, treating it as a hostname. ccoommpplleettee--ccoommmmaanndd ((MM--!!)) - Attempt completion on the text before point, treating it as a - command name. Command completion attempts to match the text - against aliases, reserved words, shell functions, shell + Attempt completion on the text before point, treating it as a + command name. Command completion attempts to match the text + against aliases, reserved words, shell functions, shell builtins, and finally executable filenames, in that order. ppoossssiibbllee--ccoommmmaanndd--ccoommpplleettiioonnss ((CC--xx !!)) List the possible completions of the text before point, treating it as a command name. ddyynnaammiicc--ccoommpplleettee--hhiissttoorryy ((MM--TTAABB)) - Attempt completion on the text before point, comparing the text + Attempt completion on the text before point, comparing the text against history list entries for possible completion matches. ddaabbbbrreevv--eexxppaanndd - Attempt menu completion on the text before point, comparing the + Attempt menu completion on the text before point, comparing the text against lines from the history list for possible completion matches. ccoommpplleettee--iinnttoo--bbrraacceess ((MM--{{)) Perform filename completion and insert the list of possible com- - pletions enclosed within braces so the list is available to the + pletions enclosed within braces so the list is available to the shell (see BBrraaccee EExxppaannssiioonn above). KKeeyybbooaarrdd MMaaccrrooss ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (()) - Begin saving the characters typed into the current keyboard + Begin saving the characters typed into the current keyboard macro. eenndd--kkbbdd--mmaaccrroo ((CC--xx )))) Stop saving the characters typed into the current keyboard macro and store the definition. ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee)) - Re-execute the last keyboard macro defined, by making the char- + Re-execute the last keyboard macro defined, by making the char- acters in the macro appear as if typed at the keyboard. pprriinntt--llaasstt--kkbbdd--mmaaccrroo (()) - Print the last keyboard macro defined in a format suitable for + Print the last keyboard macro defined in a format suitable for the _i_n_p_u_t_r_c file. MMiisscceellllaanneeoouuss rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr)) - Read in the contents of the _i_n_p_u_t_r_c file, and incorporate any + Read in the contents of the _i_n_p_u_t_r_c file, and incorporate any bindings or variable assignments found there. aabboorrtt ((CC--gg)) - Abort the current editing command and ring the terminal's bell + Abort the current editing command and ring the terminal's bell (subject to the setting of bbeellll--ssttyyllee). ddoo--lloowweerrccaassee--vveerrssiioonn ((MM--AA,, MM--BB,, MM--_x,, ...)) - If the metafied character _x is uppercase, run the command that + If the metafied character _x is uppercase, run the command that is bound to the corresponding metafied lowercase character. The behavior is undefined if _x is already lowercase. pprreeffiixx--mmeettaa ((EESSCC)) @@ -4454,210 +4461,210 @@ RREEAADDLLIINNEE uunnddoo ((CC--__,, CC--xx CC--uu)) Incremental undo, separately remembered for each line. rreevveerrtt--lliinnee ((MM--rr)) - Undo all changes made to this line. This is like executing the - uunnddoo command enough times to return the line to its initial + Undo all changes made to this line. This is like executing the + uunnddoo command enough times to return the line to its initial state. ttiillddee--eexxppaanndd ((MM--&&)) Perform tilde expansion on the current word. sseett--mmaarrkk ((CC--@@,, MM--<>)) - Set the mark to the point. If a numeric argument is supplied, + Set the mark to the point. If a numeric argument is supplied, set the mark to that position. eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk ((CC--xx CC--xx)) - Swap the point with the mark. Set the current cursor position + Swap the point with the mark. Set the current cursor position to the saved position, then set the mark to the old cursor posi- tion. cchhaarraacctteerr--sseeaarrcchh ((CC--]])) - Read a character and move point to the next occurrence of that - character. A negative argument searches for previous occur- + Read a character and move point to the next occurrence of that + character. A negative argument searches for previous occur- rences. cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]])) - Read a character and move point to the previous occurrence of + Read a character and move point to the previous occurrence of that character. A negative argument searches for subsequent oc- currences. sskkiipp--ccssii--sseeqquueennccee - Read enough characters to consume a multi-key sequence such as - those defined for keys like Home and End. CSI sequences begin + Read enough characters to consume a multi-key sequence such as + those defined for keys like Home and End. CSI sequences begin with a Control Sequence Indicator (CSI), usually ESC-[. If this - sequence is bound to "\e[", keys producing CSI sequences will - have no effect unless explicitly bound to a readline command, - instead of inserting stray characters into the editing buffer. + sequence is bound to "\e[", keys producing CSI sequences will + have no effect unless explicitly bound to a rreeaaddlliinnee command, + instead of inserting stray characters into the editing buffer. This is unbound by default, but usually bound to ESC-[. iinnsseerrtt--ccoommmmeenntt ((MM--##)) - Without a numeric argument, insert the value of the readline + Without a numeric argument, insert the value of the rreeaaddlliinnee ccoommmmeenntt--bbeeggiinn variable at the beginning of the current line. If - a numeric argument is supplied, this command acts as a toggle: - if the characters at the beginning of the line do not match the - value of ccoommmmeenntt--bbeeggiinn, insert the value; otherwise delete the - characters in ccoommmmeenntt--bbeeggiinn from the beginning of the line. In - either case, the line is accepted as if a newline had been - typed. The default value of ccoommmmeenntt--bbeeggiinn causes this command + a numeric argument is supplied, this command acts as a toggle: + if the characters at the beginning of the line do not match the + value of ccoommmmeenntt--bbeeggiinn, insert the value; otherwise delete the + characters in ccoommmmeenntt--bbeeggiinn from the beginning of the line. In + either case, the line is accepted as if a newline had been + typed. The default value of ccoommmmeenntt--bbeeggiinn causes this command to make the current line a shell comment. If a numeric argument causes the comment character to be removed, the line will be ex- ecuted by the shell. ssppeellll--ccoorrrreecctt--wwoorrdd ((CC--xx ss)) - Perform spelling correction on the current word, treating it as - a directory or filename, in the same way as the ccddssppeellll shell - option. Word boundaries are the same as those used by + Perform spelling correction on the current word, treating it as + a directory or filename, in the same way as the ccddssppeellll shell + option. Word boundaries are the same as those used by sshheellll--ffoorrwwaarrdd--wwoorrdd. gglloobb--ccoommpplleettee--wwoorrdd ((MM--gg)) Treat the word before point as a pattern for pathname expansion, - with an asterisk implicitly appended, then use the pattern to + with an asterisk implicitly appended, then use the pattern to generate a list of matching file names for possible completions. gglloobb--eexxppaanndd--wwoorrdd ((CC--xx **)) Treat the word before point as a pattern for pathname expansion, - and insert the list of matching file names, replacing the word. - If a numeric argument is supplied, append a ** before pathname + and insert the list of matching file names, replacing the word. + If a numeric argument is supplied, append a ** before pathname expansion. gglloobb--lliisstt--eexxppaannssiioonnss ((CC--xx gg)) Display the list of expansions that would have been generated by - gglloobb--eexxppaanndd--wwoorrdd and redisplay the line. If a numeric argument + gglloobb--eexxppaanndd--wwoorrdd and redisplay the line. If a numeric argument is supplied, append a ** before pathname expansion. dduummpp--ffuunnccttiioonnss - Print all of the functions and their key bindings to the read- - line output stream. If a numeric argument is supplied, the out- - put is formatted in such a way that it can be made part of an + Print all of the functions and their key bindings to the rreeaadd-- + lliinnee output stream. If a numeric argument is supplied, the out- + put is formatted in such a way that it can be made part of an _i_n_p_u_t_r_c file. dduummpp--vvaarriiaabblleess - Print all of the settable readline variables and their values to - the readline output stream. If a numeric argument is supplied, - the output is formatted in such a way that it can be made part + Print all of the settable rreeaaddlliinnee variables and their values to + the rreeaaddlliinnee output stream. If a numeric argument is supplied, + the output is formatted in such a way that it can be made part of an _i_n_p_u_t_r_c file. dduummpp--mmaaccrrooss - Print all of the readline key sequences bound to macros and the - strings they output to the readline output stream. If a numeric + Print all of the rreeaaddlliinnee key sequences bound to macros and the + strings they output to the rreeaaddlliinnee output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an _i_n_p_u_t_r_c file. eexxeeccuuttee--nnaammeedd--ccoommmmaanndd ((MM--xx)) - Read a bindable readline command name from the input and execute - the function to which it's bound, as if the key sequence to - which it was bound appeared in the input. If this function is + Read a bindable rreeaaddlliinnee command name from the input and execute + the function to which it's bound, as if the key sequence to + which it was bound appeared in the input. If this function is supplied with a numeric argument, it passes that argument to the function it executes. ddiissppllaayy--sshheellll--vveerrssiioonn ((CC--xx CC--vv)) Display version information about the current instance of bbaasshh. PPrrooggrraammmmaabbllee CCoommpplleettiioonn - When a user attempts word completion for an argument to a command for - which a completion specification (a _c_o_m_p_s_p_e_c) has been defined using - the ccoommpplleettee builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), rreeaaddlliinnee in- + When a user attempts word completion for an argument to a command for + which a completion specification (a _c_o_m_p_s_p_e_c) has been defined using + the ccoommpplleettee builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), rreeaaddlliinnee in- vokes the programmable completion facilities. - First, bbaasshh identifies the command name. If a compspec has been de- - fined for that command, the compspec is used to generate the list of - possible completions for the word. If the command word is the empty - string (completion attempted at the beginning of an empty line), bbaasshh - uses any compspec defined with the --EE option to ccoommpplleettee. If the com- + First, bbaasshh identifies the command name. If a compspec has been de- + fined for that command, the compspec is used to generate the list of + possible completions for the word. If the command word is the empty + string (completion attempted at the beginning of an empty line), bbaasshh + uses any compspec defined with the --EE option to ccoommpplleettee. If the com- mand word is a full pathname, bbaasshh searches for a compspec for the full - pathname first. If there is no compspec for the full pathname, bbaasshh - attempts to find a compspec for the portion following the final slash. - If those searches do not result in a compspec, any compspec defined - with the --DD option to ccoommpplleettee is used as the default. If there is no - default compspec, bbaasshh attempts alias expansion on the command word as - a final resort, and attempts to find a compspec for the command word + pathname first. If there is no compspec for the full pathname, bbaasshh + attempts to find a compspec for the portion following the final slash. + If those searches do not result in a compspec, any compspec defined + with the --DD option to ccoommpplleettee is used as the default. If there is no + default compspec, bbaasshh attempts alias expansion on the command word as + a final resort, and attempts to find a compspec for the command word from any successful expansion. If a compspec is not found, bbaasshh performs its default completion as de- - scribed above under CCoommpplleettiinngg. Otherwise, once a compspec has been + scribed above under CCoommpplleettiinngg. Otherwise, once a compspec has been found, bbaasshh uses it to generate the list of matching words. - First, bbaasshh performs the _a_c_t_i_o_n_s specified by the compspec. Only - matches which are prefixed by the word being completed are returned. + First, bbaasshh performs the _a_c_t_i_o_n_s specified by the compspec. Only + matches which are prefixed by the word being completed are returned. When the --ff or --dd option is used for filename or directory name comple- tion, bbaasshh uses the shell variable FFIIGGNNOORREE to filter the matches. Any completions specified by a pathname expansion pattern to the --GG op- - tion are generated next. The words generated by the pattern need not + tion are generated next. The words generated by the pattern need not match the word being completed. BBaasshh uses the FFIIGGNNOORREE variable to fil- ter the matches, but does not use the GGLLOOBBIIGGNNOORREE shell variable. - Next, completion considers the string specified as the argument to the - --WW option. The string is first split using the characters in the IIFFSS - special variable as delimiters. Shell quoting is honored. Each word - is then expanded using brace expansion, tilde expansion, parameter and - variable expansion, command substitution, and arithmetic expansion, as + Next, completion considers the string specified as the argument to the + --WW option. The string is first split using the characters in the IIFFSS + special variable as delimiters. Shell quoting is honored. Each word + is then expanded using brace expansion, tilde expansion, parameter and + variable expansion, command substitution, and arithmetic expansion, as described above under EEXXPPAANNSSIIOONN. The results are split using the rules described above under WWoorrdd SSpplliittttiinngg. The results of the expansion are prefix-matched against the word being completed, and the matching words become possible completions. - After these matches have been generated, bbaasshh executes any shell func- + After these matches have been generated, bbaasshh executes any shell func- tion or command specified with the --FF and --CC options. When the command - or function is invoked, the CCOOMMPP__LLIINNEE, CCOOMMPP__PPOOIINNTT, CCOOMMPP__KKEEYY, and - CCOOMMPP__TTYYPPEE variables are assigned values as described above under SShheellll - VVaarriiaabblleess. If a shell function is being invoked, the CCOOMMPP__WWOORRDDSS and + or function is invoked, the CCOOMMPP__LLIINNEE, CCOOMMPP__PPOOIINNTT, CCOOMMPP__KKEEYY, and + CCOOMMPP__TTYYPPEE variables are assigned values as described above under SShheellll + VVaarriiaabblleess. If a shell function is being invoked, the CCOOMMPP__WWOORRDDSS and CCOOMMPP__CCWWOORRDD variables are also set. When the function or command is in- - voked, the first argument ($$11) is the name of the command whose argu- - ments are being completed, the second argument ($$22) is the word being - completed, and the third argument ($$33) is the word preceding the word - being completed on the current command line. There is no filtering of - the generated completions against the word being completed; the func- + voked, the first argument ($$11) is the name of the command whose argu- + ments are being completed, the second argument ($$22) is the word being + completed, and the third argument ($$33) is the word preceding the word + being completed on the current command line. There is no filtering of + the generated completions against the word being completed; the func- tion or command has complete freedom in generating the matches. - Any function specified with --FF is invoked first. The function may use + Any function specified with --FF is invoked first. The function may use any of the shell facilities, including the ccoommppggeenn and ccoommppoopptt builtins - described below, to generate the matches. It must put the possible + described below, to generate the matches. It must put the possible completions in the CCOOMMPPRREEPPLLYY array variable, one per array element. - Next, any command specified with the --CC option is invoked in an envi- - ronment equivalent to command substitution. It should print a list of - completions, one per line, to the standard output. Backslash may be - used to escape a newline, if necessary. These are added to the set of + Next, any command specified with the --CC option is invoked in an envi- + ronment equivalent to command substitution. It should print a list of + completions, one per line, to the standard output. Backslash may be + used to escape a newline, if necessary. These are added to the set of possible completions. - After all of the possible completions are generated, any filter speci- - fied with the --XX option is applied to the list. The filter is a pat- - tern as used for pathname expansion; a && in the pattern is replaced - with the text of the word being completed. A literal && may be escaped - with a backslash; the backslash is removed before attempting a match. - Any completion that matches the pattern will be removed from the list. + After all of the possible completions are generated, any filter speci- + fied with the --XX option is applied to the list. The filter is a pat- + tern as used for pathname expansion; a && in the pattern is replaced + with the text of the word being completed. A literal && may be escaped + with a backslash; the backslash is removed before attempting a match. + Any completion that matches the pattern will be removed from the list. A leading !! negates the pattern; in this case any completion not match- - ing the pattern will be removed. If the nnooccaasseemmaattcchh shell option is - enabled, the match is performed without regard to the case of alpha- + ing the pattern will be removed. If the nnooccaasseemmaattcchh shell option is + enabled, the match is performed without regard to the case of alpha- betic characters. Finally, any prefix and suffix specified with the --PP and --SS options are added to each member of the completion list, and the result is returned to rreeaaddlliinnee as the list of possible completions. - If the previously-applied actions do not generate any matches, and the - --oo ddiirrnnaammeess option was supplied to ccoommpplleettee when the compspec was de- + If the previously-applied actions do not generate any matches, and the + --oo ddiirrnnaammeess option was supplied to ccoommpplleettee when the compspec was de- fined, bbaasshh attempts directory name completion. - If the --oo pplluussddiirrss option was supplied to ccoommpplleettee when the compspec - was defined, bbaasshh attempts directory name completion and adds any + If the --oo pplluussddiirrss option was supplied to ccoommpplleettee when the compspec + was defined, bbaasshh attempts directory name completion and adds any matches to the set of possible completions. - By default, if a compspec is found, whatever it generates is returned - to the completion code as the full set of possible completions. The - default bbaasshh completions and the rreeaaddlliinnee default of filename comple- - tion are disabled. If the --oo bbaasshhddeeffaauulltt option was supplied to ccoomm-- - pplleettee when the compspec was defined, if the compspec generates no - matches, bbaasshh attempts its default completions. If the --oo ddeeffaauulltt op- + By default, if a compspec is found, whatever it generates is returned + to the completion code as the full set of possible completions. The + default bbaasshh completions and the rreeaaddlliinnee default of filename comple- + tion are disabled. If the --oo bbaasshhddeeffaauulltt option was supplied to ccoomm-- + pplleettee when the compspec was defined, if the compspec generates no + matches, bbaasshh attempts its default completions. If the --oo ddeeffaauulltt op- tion was supplied to ccoommpplleettee when the compspec was defined, programma- - ble completion will perform readline's default completion if the comp- - spec (and, if attempted, the default bbaasshh completions) generate no + ble completion will perform rreeaaddlliinnee's default completion if the comp- + spec (and, if attempted, the default bbaasshh completions) generate no matches. - When a compspec indicates that directory name completion is desired, - the programmable completion functions force readline to append a slash - to completed names which are symbolic links to directories, subject to - the value of the mmaarrkk--ddiirreeccttoorriieess readline variable, regardless of the - setting of the mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess readline variable. - - There is some support for dynamically modifying completions. This is - most useful when used in combination with a default completion speci- - fied with ccoommpplleettee --DD. It's possible for shell functions executed as - completion functions to indicate that completion should be retried by - returning an exit status of 124. If a shell function returns 124, and + When a compspec indicates that directory name completion is desired, + the programmable completion functions force rreeaaddlliinnee to append a slash + to completed names which are symbolic links to directories, subject to + the value of the mmaarrkk--ddiirreeccttoorriieess rreeaaddlliinnee variable, regardless of the + setting of the mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess rreeaaddlliinnee variable. + + There is some support for dynamically modifying completions. This is + most useful when used in combination with a default completion speci- + fied with ccoommpplleettee --DD. It's possible for shell functions executed as + completion functions to indicate that completion should be retried by + returning an exit status of 124. If a shell function returns 124, and changes the compspec associated with the command on which completion is - being attempted (supplied as the first argument when the function is + being attempted (supplied as the first argument when the function is executed), programmable completion restarts from the beginning, with an - attempt to find a new compspec for that command. This allows a set of - completions to be built dynamically as completion is attempted, rather + attempt to find a new compspec for that command. This allows a set of + completions to be built dynamically as completion is attempted, rather than being loaded all at once. - For instance, assuming that there is a library of compspecs, each kept - in a file corresponding to the name of the command, the following de- + For instance, assuming that there is a library of compspecs, each kept + in a file corresponding to the name of the command, the following de- fault completion function would load completions dynamically: _completion_loader() { @@ -4668,162 +4675,162 @@ RREEAADDLLIINNEE -o bashdefault -o default HHIISSTTOORRYY - When the --oo hhiissttoorryy option to the sseett builtin is enabled, the shell + When the --oo hhiissttoorryy option to the sseett builtin is enabled, the shell provides access to the _c_o_m_m_a_n_d _h_i_s_t_o_r_y, the list of commands previously - typed. The value of the HHIISSTTSSIIZZEE variable is used as the number of - commands to save in a history list: the shell saves the text of the + typed. The value of the HHIISSTTSSIIZZEE variable is used as the number of + commands to save in a history list: the shell saves the text of the last HHIISSTTSSIIZZEE commands (default 500). The shell stores each command in - the history list prior to parameter and variable expansion (see EEXXPPAANN-- - SSIIOONN above) but after history expansion is performed, subject to the + the history list prior to parameter and variable expansion (see EEXXPPAANN-- + SSIIOONN above) but after history expansion is performed, subject to the values of the shell variables HHIISSTTIIGGNNOORREE and HHIISSTTCCOONNTTRROOLL. - On startup, bbaasshh initializes the history list by reading history en- - tries from the the file named by the HHIISSTTFFIILLEE variable (default - _~_/_._b_a_s_h___h_i_s_t_o_r_y). That file is referred to as the _h_i_s_t_o_r_y _f_i_l_e. The - history file is truncated, if necessary, to contain no more than the - number of history entries specified by the value of the HHIISSTTFFIILLEESSIIZZEE - variable. If HHIISSTTFFIILLEESSIIZZEE is unset, or set to null, a non-numeric + On startup, bbaasshh initializes the history list by reading history en- + tries from the the file named by the HHIISSTTFFIILLEE variable (default + _~_/_._b_a_s_h___h_i_s_t_o_r_y). That file is referred to as the _h_i_s_t_o_r_y _f_i_l_e. The + history file is truncated, if necessary, to contain no more than the + number of history entries specified by the value of the HHIISSTTFFIILLEESSIIZZEE + variable. If HHIISSTTFFIILLEESSIIZZEE is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not trun- cated. When the history file is read, lines beginning with the history comment character followed immediately by a digit are interpreted as timestamps - for the following history line. These timestamps are optionally dis- - played depending on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When - present, history timestamps delimit history entries, making multi-line + for the following history line. These timestamps are optionally dis- + played depending on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When + present, history timestamps delimit history entries, making multi-line entries possible. When a shell with history enabled exits, bbaasshh copies the last $$HHIISSTTSSIIZZEE - entries from the history list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell - option is enabled (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN - CCOOMMMMAANNDDSS below), bbaasshh appends the entries to the history file, other- - wise it overwrites the history file. If HHIISSTTFFIILLEE is unset or null, or - if the history file is unwritable, the history is not saved. After - saving the history, bbaasshh truncates the history file to contain no more + entries from the history list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell + option is enabled (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN + CCOOMMMMAANNDDSS below), bbaasshh appends the entries to the history file, other- + wise it overwrites the history file. If HHIISSTTFFIILLEE is unset or null, or + if the history file is unwritable, the history is not saved. After + saving the history, bbaasshh truncates the history file to contain no more than HHIISSTTFFIILLEESSIIZZEE lines as described above. - If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the shell writes the timestamp - information associated with each history entry to the history file, - marked with the history comment character, so timestamps are preserved + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the shell writes the timestamp + information associated with each history entry to the history file, + marked with the history comment character, so timestamps are preserved across shell sessions. This uses the history comment character to dis- - tinguish timestamps from other history lines. As above, when using + tinguish timestamps from other history lines. As above, when using HHIISSTTTTIIMMEEFFOORRMMAATT, the timestamps delimit multi-line history entries. - The ffcc builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) will list or + The ffcc builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) will list or edit and re-execute a portion of the history list. The hhiissttoorryy builtin can display or modify the history list and manipulate the history file. - When using command-line editing, search commands are available in each + When using command-line editing, search commands are available in each editing mode that provide access to the history list. - The shell allows control over which commands are saved on the history + The shell allows control over which commands are saved on the history list. The HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables are used to save only a - subset of the commands entered. If the ccmmddhhiisstt shell option is en- - abled, the shell attempts to save each line of a multi-line command in - the same history entry, adding semicolons where necessary to preserve - syntactic correctness. The lliitthhiisstt shell option modifies ccmmddhhiisstt by - saving the command with embedded newlines instead of semicolons. See + subset of the commands entered. If the ccmmddhhiisstt shell option is en- + abled, the shell attempts to save each line of a multi-line command in + the same history entry, adding semicolons where necessary to preserve + syntactic correctness. The lliitthhiisstt shell option modifies ccmmddhhiisstt by + saving the command with embedded newlines instead of semicolons. See the description of the sshhoopptt builtin below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS for information on setting and unsetting shell options. HHIISSTTOORRYY EEXXPPAANNSSIIOONN - The shell supports a history expansion feature that is similar to the - history expansion in ccsshh. This section describes what syntax features + The shell supports a history expansion feature that is similar to the + history expansion in ccsshh. This section describes what syntax features are available. History expansion is enabled by default for interactive shells, and can - be disabled using the ++HH option to the sseett builtin command (see SSHHEELLLL + be disabled using the ++HH option to the sseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). Non-interactive shells do not perform history expansion by default, but it can be enabled with "set -H". History expansions introduce words from the history list into the input - stream, making it easy to repeat commands, insert the arguments to a + stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly. - History expansion is performed immediately after a complete line is - read, before the shell breaks it into words, and is performed on each - line individually. The shell attempts to inform the history expansion + History expansion is performed immediately after a complete line is + read, before the shell breaks it into words, and is performed on each + line individually. The shell attempts to inform the history expansion functions about quoting still in effect from previous lines. - It takes place in two parts. The first is to determine which history - list entry to use during substitution. The second is to select por- + It takes place in two parts. The first is to determine which history + list entry to use during substitution. The second is to select por- tions of that entry to include into the current one. - The entry selected from the history is the _e_v_e_n_t, and the portions of + The entry selected from the history is the _e_v_e_n_t, and the portions of that entry that are acted upon are _w_o_r_d_s. Various _m_o_d_i_f_i_e_r_s are avail- - able to manipulate the selected words. The entry is split into words - in the same fashion as when reading input, so that several _m_e_t_a_c_h_a_r_a_c_- - _t_e_r-separated words surrounded by quotes are considered one word. The - _e_v_e_n_t _d_e_s_i_g_n_a_t_o_r selects the event, the optional _w_o_r_d _d_e_s_i_g_n_a_t_o_r se- - lects words from the event, and various optional _m_o_d_i_f_i_e_r_s are avail- + able to manipulate the selected words. The entry is split into words + in the same fashion as when reading input, so that several _m_e_t_a_c_h_a_r_a_c_- + _t_e_r-separated words surrounded by quotes are considered one word. The + _e_v_e_n_t _d_e_s_i_g_n_a_t_o_r selects the event, the optional _w_o_r_d _d_e_s_i_g_n_a_t_o_r se- + lects words from the event, and various optional _m_o_d_i_f_i_e_r_s are avail- able to manipulate the selected words. - History expansions are introduced by the appearance of the history ex- - pansion character, which is !! by default. History expansions may ap- + History expansions are introduced by the appearance of the history ex- + pansion character, which is !! by default. History expansions may ap- pear anywhere in the input, but do not nest. - Only backslash (\\) and single quotes can quote the history expansion - character, but the history expansion character is also treated as + Only backslash (\\) and single quotes can quote the history expansion + character, but the history expansion character is also treated as quoted if it immediately precedes the closing double quote in a double- quoted string. - Several characters inhibit history expansion if found immediately fol- - lowing the history expansion character, even if it is unquoted: space, - tab, newline, carriage return, ==, and the other shell metacharacters + Several characters inhibit history expansion if found immediately fol- + lowing the history expansion character, even if it is unquoted: space, + tab, newline, carriage return, ==, and the other shell metacharacters defined above. There is a special abbreviation for substitution, active when the _q_u_i_c_k - _s_u_b_s_t_i_t_u_t_i_o_n character (described above under hhiissttcchhaarrss) is the first + _s_u_b_s_t_i_t_u_t_i_o_n character (described above under hhiissttcchhaarrss) is the first character on the line. It selects the previous history list entry, us- - ing an event designator equivalent to !!!!, and substitutes one string - for another in that entry. It is described below under EEvveenntt DDeessiiggnnaa-- - ttoorrss. This is the only history expansion that does not begin with the + ing an event designator equivalent to !!!!, and substitutes one string + for another in that entry. It is described below under EEvveenntt DDeessiiggnnaa-- + ttoorrss. This is the only history expansion that does not begin with the history expansion character. - Several shell options settable with the sshhoopptt builtin will modify his- - tory expansion behavior (see the description of the sshhoopptt builtin be- + Several shell options settable with the sshhoopptt builtin will modify his- + tory expansion behavior (see the description of the sshhoopptt builtin be- low).and If the hhiissttvveerriiffyy shell option is enabled, and rreeaaddlliinnee is be- ing used, history substitutions are not immediately passed to the shell parser. Instead, the expanded line is reloaded into the rreeaaddlliinnee edit- - ing buffer for further modification. If rreeaaddlliinnee is being used, and - the hhiissttrreeeeddiitt shell option is enabled, a failed history substitution + ing buffer for further modification. If rreeaaddlliinnee is being used, and + the hhiissttrreeeeddiitt shell option is enabled, a failed history substitution is reloaded into the rreeaaddlliinnee editing buffer for correction. - The --pp option to the hhiissttoorryy builtin command shows what a history ex- - pansion will do before using it. The --ss option to the hhiissttoorryy builtin - will add commands to the end of the history list without actually exe- + The --pp option to the hhiissttoorryy builtin command shows what a history ex- + pansion will do before using it. The --ss option to the hhiissttoorryy builtin + will add commands to the end of the history list without actually exe- cuting them, so that they are available for subsequent recall. - The shell allows control of the various characters used by the history + The shell allows control of the various characters used by the history expansion mechanism (see the description of hhiissttcchhaarrss above under SShheellll - VVaarriiaabblleess). The shell uses the history comment character to mark his- + VVaarriiaabblleess). The shell uses the history comment character to mark his- tory timestamps when writing the history file. EEvveenntt DDeessiiggnnaattoorrss - An event designator is a reference to an entry in the history list. + An event designator is a reference to an entry in the history list. The event designator consists of the portion of the word beginning with - the history expansion character and ending with the word designator if - present, or the end of the word. Unless the reference is absolute, + the history expansion character and ending with the word designator if + present, or the end of the word. Unless the reference is absolute, events are relative to the current position in the history list. - !! Start a history substitution, except when followed by a bbllaannkk, - newline, carriage return, =, or, when the eexxttgglloobb shell option + !! Start a history substitution, except when followed by a bbllaannkk, + newline, carriage return, =, or, when the eexxttgglloobb shell option is enabled using the sshhoopptt builtin, (. !!_n Refer to history list entry _n. !!--_n Refer to the current entry minus _n. !!!! Refer to the previous entry. This is a synonym for "!-1". !!_s_t_r_i_n_g - Refer to the most recent command preceding the current position + Refer to the most recent command preceding the current position in the history list starting with _s_t_r_i_n_g. !!??_s_t_r_i_n_g[[??]] - Refer to the most recent command preceding the current position - in the history list containing _s_t_r_i_n_g. The trailing ?? may be - omitted if _s_t_r_i_n_g is followed immediately by a newline. If - _s_t_r_i_n_g is missing, this uses the string from the most recent + Refer to the most recent command preceding the current position + in the history list containing _s_t_r_i_n_g. The trailing ?? may be + omitted if _s_t_r_i_n_g is followed immediately by a newline. If + _s_t_r_i_n_g is missing, this uses the string from the most recent search; it is an error if there is no previous search string. ^^_s_t_r_i_n_g_1^^_s_t_r_i_n_g_2^^ - Quick substitution. Repeat the previous command, replacing - _s_t_r_i_n_g_1 with _s_t_r_i_n_g_2. Equivalent to "!!:s^_s_t_r_i_n_g_1^_s_t_r_i_n_g_2^" + Quick substitution. Repeat the previous command, replacing + _s_t_r_i_n_g_1 with _s_t_r_i_n_g_2. Equivalent to "!!:s^_s_t_r_i_n_g_1^_s_t_r_i_n_g_2^" (see MMooddiiffiieerrss below). !!## The entire command line typed so far. @@ -4831,37 +4838,37 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN Word designators are used to select desired words from the event. They are optional; if the word designator isn't supplied, the history expan- sion uses the entire event. A :: separates the event specification from - the word designator. It may be omitted if the word designator begins - with a ^^, $$, **, --, or %%. Words are numbered from the beginning of the - line, with the first word being denoted by 0 (zero). Words are in- + the word designator. It may be omitted if the word designator begins + with a ^^, $$, **, --, or %%. Words are numbered from the beginning of the + line, with the first word being denoted by 0 (zero). Words are in- serted into the current line separated by single spaces. 00 ((zzeerroo)) The zeroth word. For the shell, this is the command word. _n The _nth word. ^^ The first argument: word 1. - $$ The last word. This is usually the last argument, but will ex- + $$ The last word. This is usually the last argument, but will ex- pand to the zeroth word if there is only one word in the line. %% The first word matched by the most recent "?_s_t_r_i_n_g?" search, if - the search string begins with a character that is part of a - word. By default, searches begin at the end of each line and - proceed to the beginning, so the first word matched is the one + the search string begins with a character that is part of a + word. By default, searches begin at the end of each line and + proceed to the beginning, so the first word matched is the one closest to the end of the line. _x--_y A range of words; "-_y" abbreviates "0-_y". - ** All of the words but the zeroth. This is a synonym for "_1_-_$". - It is not an error to use ** if there is just one word in the + ** All of the words but the zeroth. This is a synonym for "_1_-_$". + It is not an error to use ** if there is just one word in the event; it expands to the empty string in that case. xx** Abbreviates _x_-_$. xx-- Abbreviates _x_-_$ like xx**, but omits the last word. If xx is miss- ing, it defaults to 0. - If a word designator is supplied without an event specification, the + If a word designator is supplied without an event specification, the previous command is used as the event, equivalent to !!!!. MMooddiiffiieerrss - After the optional word designator, the expansion may include a se- - quence of one or more of the following modifiers, each preceded by a - ":". These modify, or edit, the word or words selected from the his- + After the optional word designator, the expansion may include a se- + quence of one or more of the following modifiers, each preceded by a + ":". These modify, or edit, the word or words selected from the his- tory event. hh Remove a trailing pathname component, leaving only the head. @@ -4870,24 +4877,24 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN ee Remove all but the trailing suffix. pp Print the new command but do not execute it. qq Quote the substituted words, escaping further substitutions. - xx Quote the substituted words as with qq, but break into words at - bbllaannkkss and newlines. The qq and xx modifiers are mutually exclu- + xx Quote the substituted words as with qq, but break into words at + bbllaannkkss and newlines. The qq and xx modifiers are mutually exclu- sive; expansion uses the last one supplied. ss//_o_l_d//_n_e_w// - Substitute _n_e_w for the first occurrence of _o_l_d in the event + Substitute _n_e_w for the first occurrence of _o_l_d in the event line. Any character may be used as the delimiter in place of /. - The final delimiter is optional if it is the last character of - the event line. A single backslash will quote the delimiter in - _o_l_d and _n_e_w. If & appears in _n_e_w, it is replaced with _o_l_d. A + The final delimiter is optional if it is the last character of + the event line. A single backslash will quote the delimiter in + _o_l_d and _n_e_w. If & appears in _n_e_w, it is replaced with _o_l_d. A single backslash will quote the &. If _o_l_d is null, it is set to - the last _o_l_d substituted, or, if no previous history substitu- - tions took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. If + the last _o_l_d substituted, or, if no previous history substitu- + tions took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. If _n_e_w is null, each matching _o_l_d is deleted. && Repeat the previous substitution. gg Cause changes to be applied over the entire event line. This is - used in conjunction with "::ss" (e.g., "::ggss//_o_l_d//_n_e_w//") or "::&&". - If used with "::ss", any delimiter can be used in place of /, and - the final delimiter is optional if it is the last character of + used in conjunction with "::ss" (e.g., "::ggss//_o_l_d//_n_e_w//") or "::&&". + If used with "::ss", any delimiter can be used in place of /, and + the final delimiter is optional if it is the last character of the event line. An aa may be used as a synonym for gg. GG Apply the following "ss" or "&&" modifier once to each word in the event line. @@ -4896,64 +4903,64 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Unless otherwise noted, each builtin command documented in this section as accepting options preceded by -- accepts ---- to signify the end of the options. The ::, ttrruuee, ffaallssee, and tteesstt/[[ builtins do not accept options - and do not treat ---- specially. The eexxiitt, llooggoouutt, rreettuurrnn, bbrreeaakk, ccoonn-- - ttiinnuuee, lleett, and sshhiifftt builtins accept and process arguments beginning - with -- without requiring ----. Other builtins that accept arguments but - are not specified as accepting options interpret arguments beginning - with -- as invalid options and require ---- to prevent this interpreta- + and do not treat ---- specially. The eexxiitt, llooggoouutt, rreettuurrnn, bbrreeaakk, ccoonn-- + ttiinnuuee, lleett, and sshhiifftt builtins accept and process arguments beginning + with -- without requiring ----. Other builtins that accept arguments but + are not specified as accepting options interpret arguments beginning + with -- as invalid options and require ---- to prevent this interpreta- tion. :: [_a_r_g_u_m_e_n_t_s] - No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s + No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s and performing any specified redirections. The return status is zero. .. [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] ssoouurrccee [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] - The .. command (ssoouurrccee) reads and execute commands from _f_i_l_e_n_a_m_e - in the current shell environment and returns the exit status of + The .. command (ssoouurrccee) reads and execute commands from _f_i_l_e_n_a_m_e + in the current shell environment and returns the exit status of the last command executed from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, .. searches for it. If the - --pp option is supplied, .. treats _p_a_t_h as a colon-separated list - of directories in which to find _f_i_l_e_n_a_m_e; otherwise, .. uses the - entries in PPAATTHH to find the directory containing _f_i_l_e_n_a_m_e. - _f_i_l_e_n_a_m_e does not need to be executable. When bbaasshh is not in - _p_o_s_i_x _m_o_d_e, it searches the current directory if _f_i_l_e_n_a_m_e is not - found in PPAATTHH, but does not search the current directory if --pp + --pp option is supplied, .. treats _p_a_t_h as a colon-separated list + of directories in which to find _f_i_l_e_n_a_m_e; otherwise, .. uses the + entries in PPAATTHH to find the directory containing _f_i_l_e_n_a_m_e. + _f_i_l_e_n_a_m_e does not need to be executable. When bbaasshh is not in + posix mode, it searches the current directory if _f_i_l_e_n_a_m_e is not + found in PPAATTHH, but does not search the current directory if --pp is supplied. If the ssoouurrcceeppaatthh option to the sshhoopptt builtin com- mand is turned off, .. does not search PPAATTHH. - If any _a_r_g_u_m_e_n_t_s are supplied, they become the positional para- - meters when _f_i_l_e_n_a_m_e is executed. Otherwise the positional pa- + If any _a_r_g_u_m_e_n_t_s are supplied, they become the positional para- + meters when _f_i_l_e_n_a_m_e is executed. Otherwise the positional pa- rameters are unchanged. If the --TT option is enabled, .. inherits any trap on DDEEBBUUGG; if it - is not, any DDEEBBUUGG trap string is saved and restored around the + is not, any DDEEBBUUGG trap string is saved and restored around the call to .., and .. unsets the DDEEBBUUGG trap while it executes. If --TT is not set, and the sourced file changes the DDEEBBUUGG trap, the new value persists after .. completes. The return status is the sta- tus of the last command executed from _f_i_l_e_n_a_m_e (0 if no commands - are executed), and non-zero if _f_i_l_e_n_a_m_e is not found or cannot + are executed), and non-zero if _f_i_l_e_n_a_m_e is not found or cannot be read. aalliiaass [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] - With no arguments or with the --pp option,aalliiaass prints the list of - aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When - arguments are supplied, define an alias for each _n_a_m_e whose - _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word - to be checked for alias substitution when the alias is expanded - during command parsing. For each _n_a_m_e in the argument list for - which no _v_a_l_u_e is supplied, print the name and value of the - alias _n_a_m_e. aalliiaass returns true unless a _n_a_m_e is given (without + With no arguments or with the --pp option, aalliiaass prints the list + of aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. + When arguments are supplied, define an alias for each _n_a_m_e whose + _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word + to be checked for alias substitution when the alias is expanded + during command parsing. For each _n_a_m_e in the argument list for + which no _v_a_l_u_e is supplied, print the name and value of the + alias _n_a_m_e. aalliiaass returns true unless a _n_a_m_e is given (without a corresponding =_v_a_l_u_e) for which no alias has been defined. bbgg [_j_o_b_s_p_e_c ...] - Resume each suspended job _j_o_b_s_p_e_c in the background, as if it - had been started with &&. If _j_o_b_s_p_e_c is not present, the shell + Resume each suspended job _j_o_b_s_p_e_c in the background, as if it + had been started with &&. If _j_o_b_s_p_e_c is not present, the shell uses its notion of the _c_u_r_r_e_n_t _j_o_b. bbgg _j_o_b_s_p_e_c returns 0 unless - run when job control is disabled or, when run with job control - enabled, any specified _j_o_b_s_p_e_c was not found or was started + run when job control is disabled or, when run with job control + enabled, any specified _j_o_b_s_p_e_c was not found or was started without job control. bbiinndd [--mm _k_e_y_m_a_p] [--llssvvSSVVXX] @@ -4964,140 +4971,144 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS bbiinndd [--mm _k_e_y_m_a_p] --pp|--PP [_r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d] bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d bbiinndd _r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d_-_l_i_n_e - Display current rreeaaddlliinnee key and function bindings, bind a key - sequence to a rreeaaddlliinnee function or macro or to a shell command, - or set a rreeaaddlliinnee variable. Each non-option argument is a key - binding or command as it would appear in a rreeaaddlliinnee initializa- - tion file such as _._i_n_p_u_t_r_c, but each binding or command must be - passed as a separate argument; e.g., '"\C-x\C-r": - re-read-init-file'. In the following descriptions, output - available to be re-read is formatted as commands that would ap- + Display current rreeaaddlliinnee key and function bindings, bind a key + sequence to a rreeaaddlliinnee function or macro or to a shell command, + or set a rreeaaddlliinnee variable. Each non-option argument is a key + binding or command as it would appear in a rreeaaddlliinnee initializa- + tion file such as _._i_n_p_u_t_r_c, but each binding or command must be + passed as a separate argument; e.g., '"\C-x\C-r": + re-read-init-file'. In the following descriptions, output + available to be re-read is formatted as commands that would ap- pear in a rreeaaddlliinnee initialization file or that would be supplied - as individual arguments to a bbiinndd command. Options, if sup- + as individual arguments to a bbiinndd command. Options, if sup- plied, have the following meanings: --mm _k_e_y_m_a_p Use _k_e_y_m_a_p as the keymap to be affected by the subsequent bindings. Acceptable _k_e_y_m_a_p names are _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_- - _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, - and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d (_v_i_-_m_o_v_e - is also a synonym); _e_m_a_c_s is equivalent to _e_m_a_c_s_-_s_t_a_n_- + _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, + and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d (_v_i_-_m_o_v_e + is also a synonym); _e_m_a_c_s is equivalent to _e_m_a_c_s_-_s_t_a_n_- _d_a_r_d. --ll List the names of all rreeaaddlliinnee functions. - --pp Display rreeaaddlliinnee function names and bindings in such a - way that they can be used as an argument to a subsequent - bbiinndd command or in a rreeaaddlliinnee initialization file. If - arguments remain after option processing, bbiinndd treats - them as readline command names and restricts output to - those names. - --PP List current rreeaaddlliinnee function names and bindings. If + --pp Display rreeaaddlliinnee function names and bindings in such a + way that they can be used as an argument to a subsequent + bbiinndd command or in a rreeaaddlliinnee initialization file. If arguments remain after option processing, bbiinndd treats - them as readline command names and restricts output to + them as rreeaaddlliinnee command names and restricts output to + those names. + --PP List current rreeaaddlliinnee function names and bindings. If + arguments remain after option processing, bbiinndd treats + them as rreeaaddlliinnee command names and restricts output to those names. - --ss Display rreeaaddlliinnee key sequences bound to macros and the - strings they output in such a way that they can be used + --ss Display rreeaaddlliinnee key sequences bound to macros and the + strings they output in such a way that they can be used as an argument to a subsequent bbiinndd command or in a rreeaadd-- lliinnee initialization file. - --SS Display rreeaaddlliinnee key sequences bound to macros and the + --SS Display rreeaaddlliinnee key sequences bound to macros and the strings they output. - --vv Display rreeaaddlliinnee variable names and values in such a way + --vv Display rreeaaddlliinnee variable names and values in such a way that they can be used as an argument to a subsequent bbiinndd command or in a rreeaaddlliinnee initialization file. --VV List current rreeaaddlliinnee variable names and values. --ff _f_i_l_e_n_a_m_e Read key bindings from _f_i_l_e_n_a_m_e. --qq _f_u_n_c_t_i_o_n - Display key sequences that invoke the named rreeaaddlliinnee + Display key sequences that invoke the named rreeaaddlliinnee _f_u_n_c_t_i_o_n. --uu _f_u_n_c_t_i_o_n - Unbind all key sequences bound to the named rreeaaddlliinnee + Unbind all key sequences bound to the named rreeaaddlliinnee _f_u_n_c_t_i_o_n. --rr _k_e_y_s_e_q Remove any current binding for _k_e_y_s_e_q. --xx _k_e_y_s_e_q[[:: ]]_s_h_e_l_l_-_c_o_m_m_a_n_d Cause _s_h_e_l_l_-_c_o_m_m_a_n_d to be executed whenever _k_e_y_s_e_q is en- tered. The separator between _k_e_y_s_e_q and _s_h_e_l_l_-_c_o_m_m_a_n_d is - either whitespace or a colon optionally followed by - whitespace. If the separator is whitespace, _s_h_e_l_l_-_c_o_m_- - _m_a_n_d must be enclosed in double quotes and rreeaaddlliinnee ex- - pands any of its special backslash-escapes in _s_h_e_l_l_-_c_o_m_- - _m_a_n_d before saving it. If the separator is a colon, any - enclosing double quotes are optional, and rreeaaddlliinnee does - not expand the command string before saving it. Since - the entire key binding expression must be a single argu- - ment, it should be enclosed in single quotes. When - _s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets the RREEAADD-- - LLIINNEE__LLIINNEE variable to the contents of the rreeaaddlliinnee line + either whitespace or a colon optionally followed by + whitespace. If the separator is whitespace, _s_h_e_l_l_-_c_o_m_- + _m_a_n_d must be enclosed in double quotes and rreeaaddlliinnee ex- + pands any of its special backslash-escapes in _s_h_e_l_l_-_c_o_m_- + _m_a_n_d before saving it. If the separator is a colon, any + enclosing double quotes are optional, and rreeaaddlliinnee does + not expand the command string before saving it. Since + the entire key binding expression must be a single argu- + ment, it should be enclosed in single quotes. When + _s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets the RREEAADD-- + LLIINNEE__LLIINNEE variable to the contents of the rreeaaddlliinnee line buffer and the RREEAADDLLIINNEE__PPOOIINNTT and RREEAADDLLIINNEE__MMAARRKK variables - to the current location of the insertion point and the - saved insertion point (the mark), respectively. The - shell assigns any numeric argument the user supplied to - the RREEAADDLLIINNEE__AARRGGUUMMEENNTT variable. If there was no argu- - ment, that variable is not set. If the executed command - changes the value of any of RREEAADDLLIINNEE__LLIINNEE, RREEAADD-- - LLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, those new values will be + to the current location of the insertion point and the + saved insertion point (the mark), respectively. The + shell assigns any numeric argument the user supplied to + the RREEAADDLLIINNEE__AARRGGUUMMEENNTT variable. If there was no argu- + ment, that variable is not set. If the executed command + changes the value of any of RREEAADDLLIINNEE__LLIINNEE, RREEAADD-- + LLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, those new values will be reflected in the editing state. - --XX List all key sequences bound to shell commands and the - associated commands in a format that can be reused as an - argument to a subsequent @code{bind} command. + --XX List all key sequences bound to shell commands and the + associated commands in a format that can be reused as an + argument to a subsequent bbiinndd command. - The return value is 0 unless an unrecognized option is supplied + The return value is 0 unless an unrecognized option is supplied or an error occurred. bbrreeaakk [_n] - Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is specified, bbrreeaakk exits _n enclosing loops. _n must be >= 1. If _n - is greater than the number of enclosing loops, all enclosing + is greater than the number of enclosing loops, all enclosing loops are exited. The return value is 0 unless _n is not greater than or equal to 1. bbuuiillttiinn _s_h_e_l_l_-_b_u_i_l_t_i_n [_a_r_g_u_m_e_n_t_s] - Execute the specified shell builtin _s_h_e_l_l_-_b_u_i_l_t_i_n, passing it - _a_r_g_u_m_e_n_t_s, and return its exit status. This is useful when - defining a function whose name is the same as a shell builtin, - retaining the functionality of the builtin within the function. - The ccdd builtin is commonly redefined this way. The return sta- + Execute the specified shell builtin _s_h_e_l_l_-_b_u_i_l_t_i_n, passing it + _a_r_g_u_m_e_n_t_s, and return its exit status. This is useful when + defining a function whose name is the same as a shell builtin, + retaining the functionality of the builtin within the function. + The ccdd builtin is commonly redefined this way. The return sta- tus is false if _s_h_e_l_l_-_b_u_i_l_t_i_n is not a shell builtin command. ccaalllleerr [_e_x_p_r] Returns the context of any active subroutine call (a shell func- tion or a script executed with the .. or ssoouurrccee builtins). - Without _e_x_p_r, ccaalllleerr displays the line number and source file- - name of the current subroutine call. If a non-negative integer + Without _e_x_p_r, ccaalllleerr displays the line number and source file- + name of the current subroutine call. If a non-negative integer is supplied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name, and source file corresponding to that position in the cur- - rent execution call stack. This extra information may be used, + rent execution call stack. This extra information may be used, for example, to print a stack trace. The current frame is frame 0. - The return value is 0 unless the shell is not executing a sub- - routine call or _e_x_p_r does not correspond to a valid position in + The return value is 0 unless the shell is not executing a sub- + routine call or _e_x_p_r does not correspond to a valid position in the call stack. - ccdd [--LL|[--PP [--ee]]] [-@] [_d_i_r] - Change the current directory to _d_i_r. if _d_i_r is not supplied, - the value of the HHOOMMEE shell variable is used as _d_i_r. The vari- - able CCDDPPAATTHH exists, ccdd uses it as a search path: the shell - searches each directory name in CCDDPPAATTHH for _d_i_r. Alternative di- - rectory names in CCDDPPAATTHH are separated by a colon (:). A null - directory name in CCDDPPAATTHH is the same as the current directory, - i.e., ".". If _d_i_r begins with a slash (/), then CCDDPPAATTHH is not - used. + ccdd [--LL] [-@] [_d_i_r] + ccdd --PP [--ee] [-@] [_d_i_r] + Change the current directory to _d_i_r. if _d_i_r is not supplied, + the value of the HHOOMMEE shell variable is used as _d_i_r. The vari- + able CCDDPPAATTHH exists, and _d_i_r does not begin with a slash (/), ccdd + uses it as a search path: the shell searches each directory name + in CCDDPPAATTHH for _d_i_r. Alternative directory names in CCDDPPAATTHH are + separated by a colon (:). A null directory name in CCDDPPAATTHH is + the same as the current directory, i.e., ".". The --PP option causes ccdd to use the physical directory structure by resolving symbolic links while traversing _d_i_r and before pro- cessing instances of _._. in _d_i_r (see also the --PP option to the sseett builtin command). - The --LL option forces symbolic links to be followed by resolving + The --LL option forces ccdd to follow symbolic links by resolving the link after processing instances of _._. in _d_i_r. If _._. appears - in _d_i_r, it is processed by removing the immediately previous + in _d_i_r, ccdd processes it by removing the immediately previous pathname component from _d_i_r, back to a slash or the beginning of - _d_i_r. + _d_i_r, and verifying that the portion of _d_i_r it has processed to + that point is still a valid directory name after removing the + pathname component. If it is not a valid directory name, ccdd re- + turns a non-zero status. If neither --LL nor --PP is supplied, ccdd + behaves as if --LL had been supplied. - If the --ee option is supplied with --PP, and the current working - directory cannot be successfully determined after a successful - directory change, ccdd will return a non-zero status. + If the --ee option is supplied with --PP, and ccdd cannot successfully + determine the current working directory after a successful di- + rectory change, it will return a non-zero status. On systems that support it, the --@@ option presents the extended attributes associated with a file as a directory. @@ -6086,12 +6097,12 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS will terminate a line when it reads a NUL character. --ee If the standard input is coming from a terminal, rreeaadd uses rreeaaddlliinnee (see RREEAADDLLIINNEE above) to obtain the line. - Readline uses the current (or default, if line editing + RReeaaddlliinnee uses the current (or default, if line editing was not previously active) editing settings, but uses - readline's default filename completion. + rreeaaddlliinnee's default filename completion. --EE If the standard input is coming from a terminal, rreeaadd uses rreeaaddlliinnee (see RREEAADDLLIINNEE above) to obtain the line. - Readline uses the current (or default, if line editing + RReeaaddlliinnee uses the current (or default, if line editing was not previously active) editing settings, but uses bash's default completion, including programmable comple- tion. @@ -6205,7 +6216,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS sseett ++oo Without options, display the name and value of each shell vari- able in a format that can be reused as input for setting or re- setting the currently-set variables. Read-only variables cannot - be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed. The + be reset. In posix mode, only shell variables are listed. The output is sorted according to the current locale. When options are specified, they set or unset shell attributes. Any argu- ments remaining after option processing are treated as values @@ -6288,7 +6299,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS iiggnnoorreeeeooff The effect is as if the shell command "IGNOREEOF=10" had been executed (see SShheellll - VVaarriiaabblleess << above). + VVaarriiaabblleess above). kkeeyywwoorrdd Same as --kk. mmoonniittoorr Same as --mm. nnoocclloobbbbeerr @@ -6508,7 +6519,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ddiirreexxppaanndd If set, bbaasshh replaces directory names with the results of word expansion when performing filename completion. - This changes the contents of the readline editing + This changes the contents of the rreeaaddlliinnee editing buffer. If not set, bbaasshh attempts to preserve what the user typed. ddiirrssppeellll @@ -6516,9 +6527,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS names during word completion if the directory name ini- tially supplied does not exist. ddoottgglloobb If set, bbaasshh includes filenames beginning with a "." in - the results of pathname expansion. The filenames "." - and ".." must always be matched explicitly, even if ddoott-- - gglloobb is set. + the results of pathname expansion. The filenames _. and + _._. must always be matched explicitly, even if ddoottgglloobb is + set. eexxeeccffaaiill If set, a non-interactive shell will not exit if it can- not execute the file specified as an argument to the @@ -6566,7 +6577,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS If set, the suffixes specified by the FFIIGGNNOORREE shell variable cause words to be ignored when performing word completion even if the ignored words are the only possi- - ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS above for a de- + ble completions. See SShheellll VVaarriiaabblleess above for a de- scription of FFIIGGNNOORREE. This option is enabled by de- fault. gglloobbaasscciiiirraannggeess @@ -6579,8 +6590,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS lower-case ASCII characters will collate together. gglloobbsskkiippddoottss If set, pathname expansion will never match the file- - names "." and "..", even if the pattern begins with a - ".". This option is enabled by default. + names _. and _._., even if the pattern begins with a ".". + This option is enabled by default. gglloobbssttaarr If set, the pattern **** used in a pathname expansion con- text will match all files and zero or more directories @@ -6614,7 +6625,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS iinnhheerriitt__eerrrreexxiitt If set, command substitution inherits the value of the eerrrreexxiitt option, instead of unsetting it in the subshell - environment. This option is enabled when _p_o_s_i_x _m_o_d_e is + environment. This option is enabled when posix mode is enabled. iinntteerraaccttiivvee__ccoommmmeennttss In an interactive shell, a word beginning with ## causes @@ -6787,9 +6798,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS The expression is parsed and evaluated according to precedence using the rules listed above. - When the shell is in _p_o_s_i_x _m_o_d_e, or if the expression is part of + When the shell is in posix mode, or if the expression is part of the [[[[ command, the << and >> operators sort using the current lo- - cale. If the shell is not in _p_o_s_i_x _m_o_d_e, the tteesstt and [[ com- + cale. If the shell is not in posix mode, the tteesstt and [[ com- mands sort lexicographically using ASCII ordering. The historical operator-precedence parsing with 4 or more argu- @@ -7252,7 +7263,7 @@ SSEEEE AALLSSOO _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_- _t_i_e_s, IEEE -- - http://pubs.opengroup.org/onlinepubs/9699919799/ + http://pubs.opengroup.org/onlinepubs/9799919799/ http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode _s_h(1), _k_s_h(1), _c_s_h(1) _e_m_a_c_s(1), _v_i(1) @@ -7330,4 +7341,4 @@ BBUUGGSS Array variables may not (yet) be exported. -GNU Bash 5.3 2024 October 14 _B_A_S_H(1) +GNU Bash 5.3 2024 October 15 _B_A_S_H(1) diff --git a/doc/bash.1 b/doc/bash.1 index a6ab2c80..f34a06e7 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -5,14 +5,14 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Mon Oct 14 11:41:21 EDT 2024 +.\" Last Change: Tue Oct 15 16:53:49 EDT 2024 .\" .\" bash_builtins, strip all but Built-Ins section .\" avoid a warning about an undefined register .\" .if !rzY .nr zY 0 .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH BASH 1 "2024 October 14" "GNU Bash 5.3" +.TH BASH 1 "2024 October 15" "GNU Bash 5.3" .\" .ie \n(.g \{\ .ds ' \(aq @@ -33,7 +33,7 @@ .\" \% at the beginning of the string protects the filename from hyphenation. .\" .de FN -\%\fI\|\\$1\|\fP +\%\fI\|\\$1\|\fP\\$2 .. .\" .\" Quotation macro: generate consistent quoted strings that don't rely @@ -185,7 +185,8 @@ builtin below). .TP .B \-\-dump\-po\-strings Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP -\fBpo\fP (portable object) file format. +.Q po +(portable object) file format. .TP .B \-\-dump\-strings Equivalent to \fB\-D\fP. @@ -201,7 +202,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 +.FN \*~/.bashrc if the shell is interactive (see .SM .B INVOCATION @@ -219,10 +220,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 , +.FN \*~/.bash_profile , +.FN \*~/.bash_login , or -.IR \*~/.profile . +.FN \*~/.profile . By default, .B bash reads these files when it is invoked as a login shell (see @@ -232,7 +233,7 @@ below). .TP .B \-\-norc Do not read and execute the personal initialization file -.I \*~/.bashrc +.FN \*~/.bashrc if the shell is interactive. This option is on by default if the shell is invoked as .BR sh . @@ -244,7 +245,7 @@ See .SM .B "SEE ALSO" below for a reference to a document that details how posix mode affects -bash's behavior. +\fBBash\fP's behavior. .TP .B \-\-restricted The shell becomes restricted (see @@ -328,10 +329,15 @@ When .B bash 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 +executes commands from the file +.FN /etc/profile , +if that file exists. +After reading that file, it looks for +.FN \*~/.bash_profile , +.FN \*~/.bash_login , +and +.FN \*~/.profile , +in that order, and reads and executes commands from the first one that exists and is readable. The .B \-\-noprofile @@ -340,18 +346,22 @@ 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 -exists. +reads and executes commands from the file +.FN \*~/.bash_logout , +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 +.FN \*~/.bashrc , +if that file exists. This may be inhibited by using the .B \-\-norc option. The \fB\-\-rcfile\fP \fIfile\fP option causes .B bash -to use \fIfile\fP instead of \fI\*~/.bashrc\fP. +to use \fIfile\fP instead of +.FN \*~/.bashrc . .PP When .B bash @@ -386,13 +396,13 @@ while conforming to the POSIX standard as well. When invoked as an interactive login shell, or a non-interactive shell with the \fB\-\-login\fP option, it first attempts to read and execute commands from -.I /etc/profile +.FN /etc/profile and -.IR \*~/.profile , +.FN \*~/.profile , in that order. The .B \-\-noprofile -option may be used to inhibit this behavior. +option will inhibit this behavior. When invoked as an interactive shell with the name .BR sh , .B bash @@ -413,15 +423,11 @@ does not attempt to read any other startup files. When invoked as .BR sh , .B bash -enters -.I posix -mode after the startup files are read. +enters posix mode after reading the startup files. .PP When .B bash -is started in -.I posix -mode, as with the +is started in posix mode, as with the .B \-\-posix command line option, it follows the POSIX standard for startup files. In this mode, interactive shells expand the @@ -439,15 +445,17 @@ 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 +.FN \*~/.bashrc , if that file exists and is readable. It will not do this if invoked as \fBsh\fP. The .B \-\-norc -option may be used to inhibit this behavior, and the +option will inhibit this behavior, and the .B \-\-rcfile option will make \fBbash\fP use a different file instead of -\fI\*~/.bashrc\fP, but neither +.FN \*~/.bashrc , +but neither \fIrshd\fP nor \fIsshd\fP generally invoke the shell with those options or allow them to be specified. .PP @@ -588,7 +596,7 @@ reserved word precedes a pipeline, the shell reports the elapsed as well as user and system time consumed by its execution when the pipeline terminates. The \fB\-p\fP option changes the output format to that specified by POSIX. -When the shell is in \fIposix mode\fP, it does not recognize +When the shell is in posix mode, it does not recognize \fBtime\fP as a reserved word if the next token begins with a .Q \- . The value of the @@ -601,7 +609,7 @@ information should be displayed; see the description of below under .BR "Shell Variables" . .PP -When the shell is in \fIposix mode\fP, \fBtime\fP +When the shell is in posix mode, \fBtime\fP may appear by itself as the only word in a simple command. In this case, the shell displays the total user and system time consumed by the shell and its children. @@ -1084,7 +1092,7 @@ If the \fBfunction\fP reserved word is used, but the parentheses are not supplied, the braces are recommended. \fIcompound\-command\fP is executed whenever \fIfname\fP is specified as the name of a simple command. -When in \fIposix mode\fP, \fIfname\fP must be a valid shell \fIname\fP +When in posix mode, \fIfname\fP must be a valid shell \fIname\fP and may not be the name of one of the POSIX \fIspecial builtins\fP. In default mode, a function name can be any unquoted shell word that does not contain \fB$\fP. @@ -1171,7 +1179,7 @@ of all characters within the quotes, with the exception of .BR \e , and, when history expansion is enabled, .BR ! . -When the shell is in \fIposix mode\fP, +When the shell is in posix mode, the \fB!\fP has no special meaning within double quotes, even when history expansion is enabled. The characters @@ -1367,7 +1375,7 @@ Assignment statements may also appear as arguments to the and .B local builtin commands (\fIdeclaration\fP commands). -When in \fIposix mode\fP, these builtins may appear in a command after +When in posix mode, these builtins may appear in a command after one or more instances of the \fBcommand\fP builtin and retain these assignment statement properties. .PP @@ -1563,7 +1571,7 @@ Otherwise, it is set to the filename used to invoke .BR bash , as given by argument zero. .PD -.SS Shell Variables +.SS "Shell Variables" The shell sets following variables: .PP .PD 0 @@ -1921,7 +1929,7 @@ subsequently reset. Each time this parameter is referenced, it expands to the number of seconds since the Unix Epoch (see .IR time (3)) -as a floating point value with micro-second granularity. +as a floating-point value with micro-second granularity. Assignments to .SM .B EPOCHREALTIME @@ -2102,7 +2110,7 @@ is unset, it loses its special properties, even if it is subsequently reset. .TP .B READLINE_ARGUMENT -Any numeric argument given to a readline command that was defined using +Any numeric argument given to a \fBreadline\fP command that was defined using .Q "bind \-x" (see .SM @@ -2324,7 +2332,7 @@ Expanded and executed similarly to .SM .B BASH_ENV (see \fBINVOCATION\fP above) -when an interactive shell is invoked in \fIposix mode\fP. +when an interactive shell is invoked in posix mode. .TP .B EXECIGNORE A colon-separated list of shell patterns (see \fBPattern Matching\fP) @@ -2382,14 +2390,17 @@ Controls how the results of pathname expansion are sorted. The value of this variable specifies the sort criteria and sort order for the results of pathname expansion. If this variable is unset or set to the null string, pathname expansion -uses the historical behavior of sorting by name. +uses the historical behavior of sorting by name, +in ascending lexicographic order as determined by the +.B \%LC_COLLATE +shell variable. .IP If set, a valid value begins with an optional \fI+\fP, which is ignored, or \fI\-\fP, which reverses the sort order from ascending to descending, followed by a sort specifier. The valid sort specifiers are .IR name , -.IR numeric , +.IR \%numeric , .IR size , .IR mtime , .IR atime , @@ -2407,14 +2418,19 @@ For example, a value of \fI\-mtime\fP sorts the results in descending order by modification time (newest first). .IP The \fInumeric\fP specifier treats names consisting solely of digits as -numbers and sorts them using the numeric value (so "2" will sort before -"10", for example). +numbers and sorts them using their numeric value (so +.Q 2 +will sort before +.Q 10 , +for example). When using \fInumeric\fP, names containing non-digits sort after all the all-digit names and are sorted by name using the traditional behavior. .IP -A sort specifier of \fInosort\fP disables sorting completely; the results -are returned in the order they are read from the file system, -and any leading \fI+\fP or \fI\-\fP is ignored. +A sort specifier of \fInosort\fP disables sorting completely; +.B bash +returns the results +in the order they are read from the file system, +ignoring any leading \fI\-\fP. .IP If the sort specifier is missing, it defaults to \fIname\fP, so a value of \fI+\fP is equivalent to the null string, @@ -2462,7 +2478,8 @@ The name of the file in which command history is saved (see .SM .B HISTORY below). -\fBBash\fP assigns a default value of \fI\*~/.bash_history\fP. +\fBBash\fP assigns a default value of +.FN \*~/.bash_history . If \fBHISTFILE\fP is unset or null, the shell does not save the command history when it exits. .TP @@ -2728,13 +2745,13 @@ A common value is .TP .B POSIXLY_CORRECT If this variable is in the environment when \fBbash\fP starts, the shell -enters \fIposix mode\fP before reading the startup files, as if the +enters posix mode before reading the startup files, as if the .B \-\-posix invocation option had been supplied. If it is set while the shell is -running, \fBbash\fP enables \fIposix mode\fP, as if the command +running, \fBbash\fP enables posix mode, as if the command .Q "set \-o posix" had been executed. -When the shell enters \fIposix mode\fP, it sets this variable if it was +When the shell enters posix mode, it sets this variable if it was not already set. .TP .B PROMPT_COMMAND @@ -2914,20 +2931,18 @@ and tokenization (see .B "HISTORY EXPANSION" below). The first character is the \fIhistory expansion\fP character, -the character which signals the start of a history -expansion, normally +the character which begins a history expansion, normally .Q \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, -when it appears as the first character on the line. -The default is +The second character is the \fIquick substitution\fP character, normally .Q \fB\*^\fP . +When it appears as the first character on the line, +history substitution repeats the previous command, +replacing one string with another. 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 .Q \fB#\fP . -The history comment character causes history substitution to be skipped +The history comment character disables history substitution for the remaining words on the line. It does not necessarily cause the shell parser to treat the rest of the line as a comment. @@ -3361,7 +3376,7 @@ of variable assignments (as described above under .BR PARAMETERS ) when they appear as arguments to simple commands. \fBBash\fP does not do this, except for the \fIdeclaration\fP commands listed -above, when in \fIposix mode\fP. +above, when in posix mode. .SS Parameter Expansion The .Q \fB$\fP @@ -3401,7 +3416,8 @@ and \fIparameter\fP is not a \fInameref\fP, it introduces a level of indirection. \fBBash\fP uses the value formed by expanding the rest of \fIparameter\fP as the new \fIparameter\fP; -this new parameter is then expanded and that value is used in the rest of the expansion, rather +this new parameter is then expanded and that value is used +in the rest of the expansion, rather than the expansion of the original \fIparameter\fP. This is known as \fIindirect expansion\fP. The value is subject to tilde expansion, @@ -4130,9 +4146,9 @@ must be matched explicitly, unless the shell option .B dotglob is set. In order to match the filenames -.Q .\& +.FN .\& and -.Q ..\& , +.FN ..\& , the pattern must begin with .Q .\& (for example, @@ -4143,9 +4159,9 @@ is set. If the .B globskipdots shell option is enabled, the filenames -.Q .\& +.FN .\& and -.Q ..\& +.FN ..\& never match, even if the pattern begins with a .Q .\& . When not matching pathnames, the @@ -4190,9 +4206,9 @@ If the \fBnocaseglob\fP option is set, the matching against the patterns in .B GLOBIGNORE is performed without regard to case. The filenames -.Q .\& +.FN .\& and -.Q ..\& +.FN ..\& are always ignored when .SM .B GLOBIGNORE @@ -4377,9 +4393,9 @@ when \fBdotglob\fP is enabled, the set of filenames includes all files beginning with .Q .\& , but -.Q .\& +.FN .\& and -.Q ..\& +.FN ..\& must be matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not include any filenames beginning with @@ -4389,9 +4405,9 @@ unless the pattern or sub-pattern begins with a If the .B globskipdots shell option is enabled, the filenames -.Q .\& +.FN .\& and -.Q ..\& +.FN ..\& never appear in the set. As above, .Q .\& @@ -5199,19 +5215,23 @@ If the operating system on which \fBbash\fP is running provides these special files, bash will use them; otherwise it will emulate them internally with this behavior: If any \fIfile\fP argument to one of the primaries is of the form -\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +.FN /dev/fd/n , +then \fBbash\fP checks file descriptor \fIn\fP. If the \fIfile\fP argument to one of the primaries is one of -\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file -descriptor 0, 1, or 2, respectively, is checked. +.FN \*/dev/stdin , +.FN \*/dev/stdout , +or +.FN \*/dev/stderr , +\fBbash\fP checks file descriptor 0, 1, or 2, respectively. .PP Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself. .PP When used with \fB[[\fP, -or when the shell is in \fIposix mode\fP, +or when the shell is in posix mode, the \fB<\fP and \fB>\fP operators sort lexicographically using the current locale. -When the shell is not in \fIposix mode\fP, +When the shell is not in posix mode, the \fBtest\fP command sorts using ASCII ordering. .PP .PD 0 @@ -5572,18 +5592,18 @@ are also executed in a subshell environment. Changes made to the subshell environment cannot affect the shell's execution environment. .PP -When the shell is in -\fIposix mode\fP, +When the shell is in posix mode, subshells spawned to execute command substitutions inherit the value of the \fB\-e\fP option from their parent shell. -When not in \fIposix mode\fP, +When not in posix mode, \fBbash\fP clears the \fB\-e\fP option in such subshells. See the description of the \fBinherit_errexit\fP shell option below for how to control this behavior when not in posix mode. .PP If a command is followed by a \fB&\fP and job control is not active, the -default standard input for the command is the empty file \fI/dev/null\fP. +default standard input for the command is the empty file +.FN /dev/null . Otherwise, the invoked command inherits the file descriptors of the calling shell as modified by redirections. .SH ENVIRONMENT @@ -6031,7 +6051,7 @@ option to the builtin command is enabled, .B bash -reports such changes immediately. +reports status changes immediately. \fBBash\fP executes any trap on .SM .B SIGCHLD @@ -6260,28 +6280,35 @@ options to the .B set builtin. .SS "Readline Notation" -This section uses an emacs-style notation to denote keystrokes. +This section uses Emacs-style editing concepts and uses its +notation for keystrokes. Control keys are denoted by C\-\fIkey\fP, e.g., C\-n means Control\-N. Similarly, .I meta keys are denoted by M\-\fIkey\fP, so M\-x means Meta\-X. +The Meta key is often labeled +.Q Alt +or +.Q Option . .PP On keyboards without a .I Meta -key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key -then the +key, M\-\fIx\fP means ESC \fIx\fP, +i.e., press and release the Escape key, +then press and release the .I x -key. +key, in sequence. This makes ESC the \fImeta prefix\fP. -The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, -or press the Escape key -then hold the Control key while pressing the +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP: +press and release the Escape key, +then press and hold the Control key while pressing the .I x -key. +key, then release both. .PP -On some keyboards, the Meta key modifier produces meta characters with -the eighth bit (0200) set (you can use the \fBenable\-meta\-key\fP variable -to control whether or not it does this, if the keyboard allows it). +On some keyboards, the Meta key modifier produces characters with +the eighth bit (0200) set. +You can use the \fBenable\-meta\-key\fP variable +to control whether or not it does this, if the keyboard allows it. On many others, the terminal or terminal emulator converts the metafied key to a key sequence beginning with ESC as described in the preceding paragraph. @@ -6291,7 +6318,8 @@ you can make M-\fIkey\fP key bindings you specify (see .B "Readline Key Bindings" below) do the same thing by setting the \fBforce\-meta\-prefix\fP variable. .PP -Readline commands may be given numeric +.B Readline +commands may be given numeric .IR arguments , which normally act as a repeat count. Sometimes, however, it is the sign of the argument that is significant. @@ -6301,6 +6329,16 @@ makes that command act in a backward direction. Commands whose behavior with arguments deviates from this are noted below. .PP +The \fIpoint\fP is the current cursor position, and \fImark\fP refers +to a saved cursor position. +The text between the point and mark is referred to as the \fIregion\fP. +\fBReadline\fP has the concept of an \fIactive region\fP: +when the region is active, \fBreadline\fP redisplay +highlights the region using the +value of the \fBactive-region-start-color\fP variable. +The \fBenable\-active\-region\fP variable turns this on and off. +Several commands set the region to active; those are noted below. +.PP When a command is described as \fIkilling\fP text, the text deleted is saved for possible future retrieval (\fIyanking\fP). @@ -6310,17 +6348,18 @@ into one unit, which can be yanked all at once. Commands which do not kill text separate the chunks of text on the kill ring. .SS "Readline Initialization" -Readline is customized by putting commands in an initialization +.B Readline +is customized by putting commands in an initialization file (the \fIinputrc\fP file). The name of this file is taken from the value of the .SM .B INPUTRC shell variable. If that variable is unset, the default is -.IR \*~/.inputrc . -If that file does not exist or cannot be read, readline looks for -.IR /etc/inputrc . -When a program which uses the readline library starts up, +.FN \*~/.inputrc . +If that file does not exist or cannot be read, \fBreadline\fP looks for +.FN /etc/inputrc . +When a program which uses the \fBreadline\fP library starts up, \fBreadline\fP reads the initialization file and sets the key bindings and variables found there, before reading any user input. @@ -6335,7 +6374,7 @@ The default key-bindings in this section may be changed using key binding commands in the .I inputrc file. -Programs that use the readline library, including \fBbash\fP, +Programs that use the \fBreadline\fP library, including \fBbash\fP, may add their own commands and bindings. .PP For example, placing @@ -6350,7 +6389,7 @@ C\-Meta\-u: universal\-argument .LP into the .I inputrc -would make M\-C\-u execute the readline command +would make M\-C\-u execute the \fBreadline\fP command .IR universal\-argument . .PP Key bindings may contain the following symbolic character names: @@ -6367,7 +6406,7 @@ Key bindings may contain the following symbolic character names: and .IR TAB . .PP -In addition to command names, readline allows keys to be bound +In addition to command names, \fBreadline\fP allows keys to be bound to a string that is inserted when the key is pressed (a \fImacro\fP). The difference between a macro and a command is that a macro is enclosed in single or double quotes. @@ -6521,7 +6560,7 @@ Backslash will quote any other character in the macro text, including \*" and \*'. .PP .B Bash -will display or modify the current readline key bindings with the +will display or modify the current \fBreadline\fP key bindings with the .B bind builtin command. The @@ -6537,7 +6576,7 @@ builtin below) will change the editing mode during interactive use. .SS "Readline Variables" -Readline has variables that can be used to further customize its +\fBReadline\fP has variables that can be used to further customize its behavior. A variable may be set in the .I inputrc @@ -6551,13 +6590,13 @@ or using the \fBbind\fP builtin command (see .B "SHELL BUILTIN COMMANDS" below). .PP -Except where noted, readline variables can take the values +Except where noted, \fBreadline\fP variables can take the values .B On or .B Off (without regard to case). Unrecognized variable names are ignored. -When readline reads a variable value, empty or null values, +When \fBreadline\fP reads a variable value, empty or null values, .Q "on" (case-insensitive), and .Q 1 @@ -6565,7 +6604,7 @@ are equivalent to \fBOn\fP. All other values are equivalent to \fBOff\fP. .PP -The \fBbind \-V\fP command lists the current readline variable names +The \fBbind \-V\fP command lists the current \fBreadline\fP variable names and values (see .SM .B "SHELL BUILTIN COMMANDS" @@ -6605,37 +6644,37 @@ A sample value might be .Q \ee[0m . .TP .B bell\-style (audible) -Controls what happens when readline wants to ring the terminal bell. -If set to \fBnone\fP, readline never rings the bell. -If set to \fBvisible\fP, readline uses a visible bell if one is available. -If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +Controls what happens when \fBreadline\fP wants to ring the terminal bell. +If set to \fBnone\fP, \fBreadline\fP never rings the bell. +If set to \fBvisible\fP, \fBreadline\fP uses a visible bell if one is available. +If set to \fBaudible\fP, \fBreadline\fP attempts to ring the terminal's bell. .TP .B bind\-tty\-special\-chars (On) -If set to \fBOn\fP, readline attempts to bind +If set to \fBOn\fP, \fBreadline\fP attempts to bind the control characters that are treated specially by the kernel's -terminal driver to their readline equivalents. -These override the default readline bindings described here. +terminal driver to their \fBreadline\fP equivalents. +These override the default \fBreadline\fP bindings described here. Type .Q "stty \-a" at a \fBbash\fP prompt to see your current terminal settings, including the special control characters (usually \fBcchars\fP). .TP .B blink\-matching\-paren (Off) -If set to \fBOn\fP, readline attempts to briefly move the cursor to an +If set to \fBOn\fP, \fBreadline\fP attempts to briefly move the cursor to an opening parenthesis when a closing parenthesis is inserted. .TP .B colored\-completion\-prefix (Off) -If set to \fBOn\fP, when listing completions, readline displays the +If set to \fBOn\fP, when listing completions, \fBreadline\fP displays the common prefix of the set of possible completions using a different color. The color definitions are taken from the value of the \fBLS_COLORS\fP environment variable. If there is a color definition in \fB$LS_COLORS\fP for the custom suffix -.Q readline-colored-completion-prefix , -readline uses this color for +.Q .readline-colored-completion-prefix , +\fBreadline\fP uses this color for the common prefix instead of its default. .TP .B colored\-stats (Off) -If set to \fBOn\fP, readline displays possible completions using different +If set to \fBOn\fP, \fBreadline\fP displays possible completions using different colors to indicate their file type. The color definitions are taken from the value of the \fBLS_COLORS\fP environment variable. @@ -6645,7 +6684,7 @@ environment variable. .TP .BR comment\-begin\ ( \c .Q \fB#\fP \fB)\fP -The string that the readline +The string that the \fBreadline\fP .B insert\-comment command inserts. This command is bound to @@ -6663,11 +6702,12 @@ A value of 0 will cause matches to be displayed one per line. The default value is \-1. .TP .B completion\-ignore\-case (Off) -If set to \fBOn\fP, readline performs filename matching and completion +If set to \fBOn\fP, \fBreadline\fP performs filename matching and completion in a case\-insensitive fashion. .TP .B completion\-map\-case (Off) -If set to \fBOn\fP, and \fBcompletion\-ignore\-case\fP is enabled, readline +If set to \fBOn\fP, and \fBcompletion\-ignore\-case\fP is enabled, +.B readline treats hyphens (\fI\-\fP) and underscores (\fI_\fP) as equivalent when performing case\-insensitive filename matching and completion. .TP @@ -6675,7 +6715,7 @@ performing case\-insensitive filename matching and completion. The maximum length in characters of the common prefix of a list of possible completions that is displayed without modification. -When set to a value greater than zero, readline +When set to a value greater than zero, \fBreadline\fP replaces common prefixes longer than this value with an ellipsis when displaying possible completions. .TP @@ -6686,17 +6726,17 @@ generated by the \fBpossible\-completions\fP command. It may be set to any integer value greater than or equal to zero. If the number of possible completions is greater than or equal to the value of this variable, -readline will ask whether or not the user wishes to view them; -otherwise readline simply lists them on the terminal. -A zero value means readline should never ask; negative values are +\fBreadline\fP will ask whether or not the user wishes to view them; +otherwise \fBreadline\fP simply lists them on the terminal. +A zero value means \fBreadline\fP should never ask; negative values are treated as zero. .TP .B convert\-meta (On) -If set to \fBOn\fP, readline will convert characters it reads +If set to \fBOn\fP, \fBreadline\fP will convert characters it reads that have the eighth bit set to an ASCII key sequence by clearing the eighth bit and prefixing it with an escape character -(converting the character to have the \fImeta prefix\fP). -The default is \fIOn\fP, but readline will set it to \fIOff\fP +(converting the character to have the meta prefix). +The default is \fIOn\fP, but \fBreadline\fP will set it to \fIOff\fP if the locale contains characters whose encodings may include bytes with the eighth bit set. This variable is dependent on the \fBLC_CTYPE\fP locale category, and @@ -6705,17 +6745,17 @@ This variable also affects key bindings; see the description of \fBforce\-meta\-prefix\fP below. .TP .B disable\-completion (Off) -If set to \fBOn\fP, readline will inhibit word completion. +If set to \fBOn\fP, \fBreadline\fP will inhibit word completion. Completion characters will be inserted into the line as if they had been mapped to \fBself-insert\fP. .TP .B echo\-control\-characters (On) When set to \fBOn\fP, on operating systems that indicate they support it, -readline echoes a character corresponding to a signal generated from the +\fBreadline\fP echoes a character corresponding to a signal generated from the keyboard. .TP .B editing\-mode (emacs) -Controls whether readline uses a set of key bindings similar +Controls whether \fBreadline\fP uses a set of key bindings similar to \fIEmacs\fP or \fIvi\fP. .B editing\-mode can be set to either @@ -6735,32 +6775,30 @@ non-printing characters, which can be used to embed a terminal control sequence into the mode string. .TP .B enable\-active\-region (On) -The \fIpoint\fP is the current cursor position, and \fImark\fP refers -to a saved cursor position. -The text between the point and mark is referred to as the \fIregion\fP. -When this variable is set to \fIOn\fP, readline allows certain commands +When this variable is set to \fIOn\fP, \fBreadline\fP allows certain commands to designate the region as \fIactive\fP. -When the region is active, readline highlights the text in the region using +When the region is active, \fBreadline\fP highlights +the text in the region using the value of the \fBactive\-region\-start\-color\fP, which defaults to the string that enables the terminal's standout mode. The active region shows the text inserted by bracketed-paste and any matching text found by incremental and non-incremental history searches. .TP .B enable\-bracketed\-paste (On) -When set to \fBOn\fP, readline configures the terminal to insert each +When set to \fBOn\fP, \fBreadline\fP configures the terminal to insert each paste into the editing buffer as a single string of characters, instead of treating each character as if it had been read from the keyboard. This is called \fIbracketed\-paste mode\fP; -it prevents readline from executing any editing commands bound to key +it prevents \fBreadline\fP from executing any editing commands bound to key sequences appearing in the pasted text. .TP .B enable\-keypad (Off) -When set to \fBOn\fP, readline will try to enable the application +When set to \fBOn\fP, \fBreadline\fP will try to enable the application keypad when it is called. Some systems need this to enable the arrow keys. .TP .B enable\-meta\-key (On) -When set to \fBOn\fP, readline will try to enable any meta modifier +When set to \fBOn\fP, \fBreadline\fP will try to enable any meta modifier key the terminal claims to support. On many terminals, the Meta key is used to send eight-bit characters; this variable checks for the terminal capability that indicates the @@ -6769,24 +6807,24 @@ character (0200) if the Meta key is held down when the character is typed (a meta character). .TP .B expand\-tilde (Off) -If set to \fBOn\fP, readline performs tilde expansion when it +If set to \fBOn\fP, \fBreadline\fP performs tilde expansion when it attempts word completion. .TP .B force\-meta\-prefix (Off) -If set to \fBOn\fP, readline modifies its behavior when binding key +If set to \fBOn\fP, \fBreadline\fP modifies its behavior when binding key sequences containing \eM- or Meta- (see \fBKey Bindings\fP above) by converting a key sequence of the form \eM\-\fIC\fP or Meta\-\fIC\fP to the two-character sequence -\fBESC\fP\fIC\fP (adding the \fImeta prefix\fP). +\fBESC\fP \fIC\fP (adding the meta prefix). If .B force\-meta\-prefix is set to \fBOff\fP (the default), -readline uses the value of the +\fBreadline\fP uses the value of the .B convert\-meta variable to determine whether to perform this conversion: if \fBconvert\-meta\fP is \fBOn\fP, -readline performs the conversion described above; -if it is \fBOff\fP, readline converts \fIC\fP to a meta character by +\fBreadline\fP performs the conversion described above; +if it is \fBOff\fP, \fBreadline\fP converts \fIC\fP to a meta character by setting the eighth bit (0200). .TP .B history\-preserve\-point (Off) @@ -6806,17 +6844,17 @@ Setting \fIhistory\-size\fP to a non-numeric value will set the maximum number of history entries to 500. .TP .B horizontal\-scroll\-mode (Off) -Setting this variable to \fBOn\fP makes readline use a single line +Setting this variable to \fBOn\fP makes \fBreadline\fP use a single line for display, scrolling the input horizontally on a single screen line when it becomes longer than the screen width rather than wrapping to a new line. This setting is automatically enabled for terminals of height 1. .TP .B input\-meta (Off) -If set to \fBOn\fP, readline will enable eight-bit input (that is, it +If set to \fBOn\fP, \fBreadline\fP will enable eight-bit input (that is, it will not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. -The default is \fIOff\fP, but readline will set it to \fIOn\fP +The default is \fIOff\fP, but \fBreadline\fP will set it to \fIOn\fP if the locale contains characters whose encodings may include bytes with the eighth bit set. This variable is dependent on the \fBLC_CTYPE\fP locale category, and @@ -6831,7 +6869,7 @@ If this variable has not been given a value, the characters \fIESC\fP and \fIC\-J\fP will terminate an incremental search. .TP .B keymap (emacs) -Set the current readline keymap. +Set the current \fBreadline\fP keymap. The set of valid keymap names is \fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, vi\-command\fP, and @@ -6844,23 +6882,24 @@ the value of also affects the default keymap. .TP .B keyseq\-timeout (500) -Specifies the duration \fIreadline\fP will wait for a character when +Specifies the duration \fBreadline\fP will wait for a character when reading an ambiguous key sequence (one that can form a complete key sequence using the input read so far, or can take additional input to complete a longer key sequence). -If readline does not receive any input within the timeout, it will use the -shorter but complete key sequence. +If \fBreadline\fP does not receive any input within the timeout, +it will use the shorter but complete key sequence. The value is specified in milliseconds, so a value of 1000 means that -readline will wait one second for additional input. +\fBreadline\fP will wait one second for additional input. If this variable is set to a value less than or equal to zero, or to a -non-numeric value, readline will wait until another key is pressed to +non-numeric value, \fBreadline\fP will wait until another key is pressed to decide which key sequence to complete. .TP .B mark\-directories (On) If set to \fBOn\fP, completed directory names have a slash appended. .TP .B mark\-modified\-lines (Off) -If set to \fBOn\fP, readline displays history lines that have been modified +If set to \fBOn\fP, \fBreadline\fP displays history lines +that have been modified with a preceding asterisk (\fB*\fP). .TP .B mark\-symlinked\-directories (Off) @@ -6868,7 +6907,7 @@ If set to \fBOn\fP, completed names which are symbolic links to directories have a slash appended, subject to the value of \fBmark\-directories\fP. .TP .B match\-hidden\-files (On) -This variable, when set to \fBOn\fP, forces readline to match files whose +This variable, when set to \fBOn\fP, forces \fBreadline\fP to match files whose names begin with a .Q . (hidden files) when performing filename completion. @@ -6882,35 +6921,35 @@ list of possible completions (which may be empty) before cycling through the list. .TP .B output\-meta (Off) -If set to \fBOn\fP, readline will display characters with the +If set to \fBOn\fP, \fBreadline\fP will display characters with the eighth bit set directly rather than as a meta-prefixed escape sequence. -The default is \fIOff\fP, but readline will set it to \fIOn\fP +The default is \fIOff\fP, but \fBreadline\fP will set it to \fIOn\fP if the locale contains characters whose encodings may include bytes with the eighth bit set. This variable is dependent on the \fBLC_CTYPE\fP locale category, and its value may change if the locale changes. .TP .B page\-completions (On) -If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +If set to \fBOn\fP, \fBreadline\fP uses an internal \fImore\fP-like pager to display a screenful of possible completions at a time. .TP .B prefer\-visible\-bell See \fBbell\-style\fP. .TP .B print\-completions\-horizontally (Off) -If set to \fBOn\fP, readline will display completions with matches +If set to \fBOn\fP, \fBreadline\fP will display completions with matches sorted horizontally in alphabetical order, rather than down the screen. .TP .B revert\-all\-at\-newline (Off) -If set to \fBOn\fP, readline will undo all changes to history lines +If set to \fBOn\fP, \fBreadline\fP will undo all changes to history lines before returning when executing \fBaccept\-line\fP. By default, history lines may be modified and retain individual undo lists across calls to \fBreadline\fP. .TP .B search\-ignore\-case (Off) -If set to \fBOn\fP, readline performs incremental and non-incremental +If set to \fBOn\fP, \fBreadline\fP performs incremental and non-incremental history list searches in a case\-insensitive fashion. .TP .B show\-all\-if\-ambiguous (Off) @@ -6939,7 +6978,7 @@ The mode strings are user-settable (e.g., \fIemacs\-mode\-string\fP). If set to \fBOn\fP, this alters the default completion behavior when inserting a single match into the line. It's only active when performing completion in the middle of a word. -If enabled, readline does not insert characters from the completion +If enabled, \fBreadline\fP does not insert characters from the completion that match characters after point in the word being completed, so portions of the word following the cursor are not duplicated. .TP @@ -6969,7 +7008,8 @@ by \fIstat\fP(2) is appended to the filename when listing possible completions. .PD .SS "Readline Conditional Constructs" -Readline implements a facility similar in spirit to the conditional +.B Readline +implements a facility similar in spirit to the conditional compilation features of the C preprocessor which allows key bindings and variable settings to be performed as the result of tests. @@ -6980,7 +7020,7 @@ The .B $if construct allows bindings to be made based on the editing mode, the terminal being used, or the application using -readline. +\fBreadline\fP. The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no characters are required to isolate it. @@ -6988,11 +7028,11 @@ unless otherwise noted, no characters are required to isolate it. .TP .B mode The \fBmode=\fP form of the \fB$if\fP directive is used to test -whether readline is in emacs or vi mode. +whether \fBreadline\fP is in emacs or vi mode. This may be used in conjunction with the \fBset keymap\fP command, for instance, to set bindings in the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if -readline is starting out in emacs mode. +\fBreadline\fP is starting out in emacs mode. .TP .B term The \fBterm=\fP form may be used to include terminal-specific @@ -7012,8 +7052,8 @@ for instance. .TP .B version The \fBversion\fP test may be used to perform comparisons against -specific readline versions. -The \fBversion\fP expands to the current readline version. +specific \fBreadline\fP versions. +The \fBversion\fP expands to the current \fBreadline\fP version. The set of comparison operators includes .BR = , (and @@ -7035,7 +7075,7 @@ and from the version number argument by whitespace. .I application The \fIapplication\fP construct is used to include application-specific settings. -Each program using the readline +Each program using the \fBreadline\fP library sets the \fIapplication name\fP, and an initialization file can test for a particular value. This could be used to bind key sequences to functions useful for @@ -7055,7 +7095,7 @@ key sequence that quotes the current or previous word in \fBbash\fP: .RE .TP .I variable -The \fIvariable\fP construct provides simple equality tests for readline +The \fIvariable\fP construct provides simple equality tests for \fBreadline\fP variables and values. The permitted comparison operators are \fI=\fP, \fI==\fP, and \fI!=\fP. The variable name must be separated from the comparison operator by @@ -7077,7 +7117,8 @@ This command, as seen in the previous example, terminates an .B $include This directive takes a single filename as an argument and reads commands and key bindings from that file. -For example, the following directive would read \fI/etc/inputrc\fP: +For example, the following directive would read +.FN /etc/inputrc : .PP .RS .nf @@ -7085,8 +7126,8 @@ For example, the following directive would read \fI/etc/inputrc\fP: .fi .RE .SS Searching -Readline provides commands for searching through the command history -(see +.B Readline +provides commands for searching through the command history (see .SM .B HISTORY below) @@ -7098,7 +7139,7 @@ and .PP Incremental searches begin before the user has finished typing the search string. -As each character of the search string is typed, readline displays +As each character of the search string is typed, \fBreadline\fP displays the next entry from the history matching the string typed so far. An incremental search requires only as many characters as needed to find the desired history entry. @@ -7117,16 +7158,17 @@ To find other matching entries in the history list, type \fBC\-r\fP or \fBC\-s\fP as appropriate. This will search backward or forward in the history for the next entry matching the search string typed so far. -Any other key sequence bound to a readline command will terminate +Any other key sequence bound to a \fBreadline\fP command will terminate the search and execute that command. For instance, a newline will terminate the search and accept the line, thereby executing the command from the history list. A movement command will terminate the search, make the last line found the current line, and begin editing. .PP -Readline remembers the last incremental search string. +.B Readline +remembers the last incremental search string. If two \fBC\-r\fPs are typed without any intervening characters defining -a new search string, readline uses any remembered search string. +a new search string, \fBreadline\fP uses any remembered search string. .PP Non-incremental searches read the entire search string before starting to search for matching history entries. @@ -7141,8 +7183,9 @@ In the following descriptions, \fIpoint\fP refers to the current cursor position, and \fImark\fP refers to a cursor position saved by the \fBset\-mark\fP command. The text between the point and mark is referred to as the \fIregion\fP. -Readline has the concept of an \fIactive region\fP: -when the region is active, readline redisplay uses the +.B Readline +has the concept of an \fIactive region\fP: +when the region is active, \fBreadline\fP redisplay uses the value of the \fBactive\-region\-start\-color variable to denote the region. Several commands set the region to active; those are noted below. @@ -7183,15 +7226,16 @@ Words are delimited by non-quoted shell metacharacters. Attempt to move point to the same physical screen column on the previous physical screen line. This will not have the desired effect if the current -readline line does not take up more than one physical line or if point is not -greater than the length of the prompt plus the screen width. +\fBreadline\fP line does not take up more than one physical line or if +point is not greater than the length of the prompt plus the screen width. .TP .B next\-screen\-line Attempt to move point to the same physical screen column on the next physical screen line. This will not have the desired effect if the current -readline line does not take up more than one physical line or if the length -of the current readline line is not greater than the length of the prompt +\fBreadline\fP line does not take up more than one physical line or if +the length of the current \fBreadline\fP line is +not greater than the length of the prompt plus the screen width. .TP .B clear\-display (M\-C\-l) @@ -7392,7 +7436,7 @@ and \fIemacs\fP as the editor, in that order. The character indicating end-of-file as set, for example, by .IR stty (1). If this character is read when there are no characters -on the line, and point is at the beginning of the line, readline +on the line, and point is at the beginning of the line, \fBreadline\fP interprets it as the end of input and returns .SM .BR EOF . @@ -7429,8 +7473,8 @@ This function is intended to be bound to the .Q "bracketed paste" escape sequence sent by some terminals, and such a binding is assigned by default. -It allows readline to insert the pasted text as a single unit without treating -each character as if it had been read from the keyboard. +It allows \fBreadline\fP to insert the pasted text as a single unit +without treating each character as if it had been read from the keyboard. The pasted characters are inserted as if each one was bound to \fBself\-insert\fP instead of executing any editing commands. @@ -7603,7 +7647,7 @@ If none of these produces a match, it falls back to filename completion. .TP .B possible\-completions (M\-?) List the possible completions of the text before point. -When displaying completions, readline sets the number of columns used +When displaying completions, \fBreadline\fP sets the number of columns used for display to the value of \fBcompletion-display-width\fP, the value of the shell variable .SM @@ -7780,12 +7824,12 @@ CSI sequences begin with a Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is bound to .Q \ee[ , keys producing CSI sequences will have no effect -unless explicitly bound to a readline command, instead of inserting +unless explicitly bound to a \fBreadline\fP command, instead of inserting stray characters into the editing buffer. This is unbound by default, but usually bound to ESC\-[. .TP .B insert\-comment (M\-#) -Without a numeric argument, insert the value of the readline +Without a numeric argument, insert the value of the \fBreadline\fP .B comment\-begin variable at the beginning of the current line. If a numeric argument is supplied, this command acts as a toggle: if @@ -7824,28 +7868,28 @@ pathname expansion. .TP .B dump\-functions Print all of the functions and their key bindings -to the readline output stream. +to the \fBreadline\fP output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an \fIinputrc\fP file. .TP .B dump\-variables -Print all of the settable readline variables and their values -to the readline output stream. +Print all of the settable \fBreadline\fP variables and their values +to the \fBreadline\fP output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an \fIinputrc\fP file. .TP .B dump\-macros -Print all of the readline key sequences bound to macros and the +Print all of the \fBreadline\fP key sequences bound to macros and the strings they output -to the readline output stream. +to the \fBreadline\fP output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an \fIinputrc\fP file. .TP .B execute\-named\-command (M-x) -Read a bindable readline command name from the input and execute the +Read a bindable \fBreadline\fP command name from the input and execute the function to which it's bound, as if the key sequence to which it was bound appeared in the input. If this function is supplied with a numeric argument, it passes that @@ -8012,15 +8056,15 @@ if the compspec generates no matches, \fBbash\fP attempts its default completions. If the \fB\-o default\fP option was supplied to \fBcomplete\fP when the compspec was defined, programmable completion will perform -readline's default completion +\fBreadline\fP's default completion if the compspec (and, if attempted, the default \fBbash\fP completions) generate no matches. .PP When a compspec indicates that directory name completion is desired, -the programmable completion functions force readline to append a slash +the programmable completion functions force \fBreadline\fP to append a slash to completed names which are symbolic links to directories, subject to -the value of the \fBmark\-directories\fP readline variable, regardless -of the setting of the \fBmark-symlinked\-directories\fP readline variable. +the value of the \fBmark\-directories\fP \fBreadline\fP variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP \fBreadline\fP variable. .PP There is some support for dynamically modifying completions. This is most useful when used in combination with a default completion @@ -8096,7 +8140,8 @@ by reading history entries from the the file named by the .SM .B HISTFILE -variable (default \fI\*~/.bash_history\fP). +variable (default +.FN \*~/.bash_history ). That file is referred to as the \fIhistory file\fP. The history file is truncated, if necessary, to contain no more than the number of history entries @@ -8588,7 +8633,7 @@ otherwise, \fB\&.\&\fP uses the entries in to find the directory containing .IR filename . \fIfilename\fP does not need to be executable. -When \fBbash\fP is not in \fIposix mode\fP, it searches +When \fBbash\fP is not in posix mode, it searches the current directory if \fIfilename\fP is not found in .SM .BR PATH , @@ -8619,7 +8664,7 @@ is not found or cannot be read. \fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] .\|.\|.] With no arguments or with the .B \-p -option,\fBalias\fP prints the list of aliases in the form +option, \fBalias\fP prints the list of aliases in the form \fBalias\fP \fIname\fP=\fIvalue\fP on standard output. When arguments are supplied, define an alias for each \fIname\fP whose \fIvalue\fP is given. @@ -8709,12 +8754,12 @@ that they can be used as an argument to a subsequent \fBbind\fP command or in a \fBreadline\fP initialization file. If arguments remain after option processing, \fBbind\fP treats -them as readline command names and restricts output to those names. +them as \fBreadline\fP command names and restricts output to those names. .TP .B \-P List current \fBreadline\fP function names and bindings. If arguments remain after option processing, \fBbind\fP treats -them as readline command names and restricts output to those names. +them as \fBreadline\fP command names and restricts output to those names. .TP .B \-s Display \fBreadline\fP key sequences bound to macros and the strings @@ -8788,7 +8833,7 @@ those new values will be reflected in the editing state. .B \-X List all key sequences bound to shell commands and the associated commands in a format that can be reused as -an argument to a subsequent @code{bind} command. +an argument to a subsequent \fBbind\fP command. .PD .PP The return value is 0 unless an unrecognized option is supplied or an @@ -8839,7 +8884,11 @@ The return value is 0 unless the shell is not executing a subroutine call or \fIexpr\fP does not correspond to a valid position in the call stack. .TP -\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]]] [\-@] [\fIdir\fP] +.PD 0 +\fBcd\fP [\fB\-L\fP] [\-@] [\fIdir\fP] +.TP +\fBcd\fP \fB\-P\fP [\fB\-e\fP] [\-@] [\fIdir\fP] +.PD Change the current directory to \fIdir\fP. if \fIdir\fP is not supplied, the value of the .SM @@ -8848,7 +8897,9 @@ shell variable is used as \fIdir\fP. The variable .SM .B CDPATH -exists, \fBcd\fP uses it as a search path: +exists, +and \fIdir\fP does not begin with a slash (/), +\fBcd\fP uses it as a search path: the shell searches each directory name in .SM .B CDPATH @@ -8862,19 +8913,14 @@ A null directory name in .B CDPATH is the same as the current directory, i.e., .Q .\& . -If -.I dir -begins with a slash (/), -then -.SM -.B CDPATH -is not used. .IP The .B \-P option causes \fBcd\fP to use the physical directory structure by resolving symbolic links while traversing \fIdir\fP and -before processing instances of \fI..\fP in \fIdir\fP (see also the +before processing instances of +.FN .\|.\& +in \fIdir\fP (see also the .B \-P option to the .B set @@ -8882,19 +8928,35 @@ builtin command). .IP The .B \-L -option forces symbolic links to be followed by resolving the link -after processing instances of \fI..\fP in \fIdir\fP. -If \fI..\fP appears in \fIdir\fP, it is processed by removing the +option forces \fBcd\fP to follow symbolic links by resolving the link +after processing instances of +.FN .\|.\& +in \fIdir\fP. +If +.FN .\|.\& +appears in \fIdir\fP, \fBcd\fP processes it by removing the immediately previous pathname component from \fIdir\fP, back to a slash -or the beginning of \fIdir\fP. +or the beginning of \fIdir\fP, +and verifying that the portion of \fIdir\fP it has processed to +that point is still a valid directory name after removing the pathname +component. +If it is not a valid directory name, \fBcd\fP returns a non-zero status. +If neither +.B \-L +nor +.B \-P +is supplied, +.B cd +behaves as if +.B \-L +had been supplied. .IP If the .B \-e option is supplied with .BR \-P , -and the current working directory cannot be successfully determined -after a successful directory change, \fBcd\fP will return a non-zero -status. +and \fBcd\fP cannot successfully determine the current working directory +after a successful directory change, it will return a non-zero status. .IP On systems that support it, the \fB\-@\fP option presents the extended attributes associated with a file as a directory. @@ -10721,8 +10783,9 @@ If the standard input is coming from a terminal, .ie \n(zZ=1 in \fIbash\fP(1)) .el above) to obtain the line. -Readline uses the current (or default, if line editing was not previously -active) editing settings, but uses readline's default filename completion. +\fBReadline\fP uses the current +(or default, if line editing was not previously active) +editing settings, but uses \fBreadline\fP's default filename completion. .TP .B \-E If the standard input is coming from a terminal, @@ -10734,7 +10797,8 @@ If the standard input is coming from a terminal, .ie \n(zZ=1 in \fIbash\fP(1)) .el above) to obtain the line. -Readline uses the current (or default, if line editing was not previously +.B Readline +uses the current (or default, if line editing was not previously active) editing settings, but uses bash's default completion, including programmable completion. .TP @@ -10907,7 +10971,7 @@ Without options, display the name and value of each shell variable in a format that can be reused as input for setting or resetting the currently-set variables. Read-only variables cannot be reset. -In \fIposix mode\fP, only shell variables are listed. +In posix mode, only shell variables are listed. The output is sorted according to the current locale. When options are specified, they set or unset shell attributes. Any arguments remaining after option processing are treated @@ -11071,7 +11135,7 @@ The effect is as if the shell command .QN "IGNOREEOF=10" had been executed (see -.B "Shell Variables"< +.B "Shell Variables" .ie \n(zZ=1 in \fIbash\fP(1)). .el above). .TP 8 @@ -11515,7 +11579,7 @@ If set, .B bash replaces directory names with the results of word expansion when performing filename completion. -This changes the contents of the readline editing buffer. +This changes the contents of the \fBreadline\fP editing buffer. If not set, .B bash attempts to preserve what the user typed. @@ -11533,9 +11597,9 @@ includes filenames beginning with a .Q .\& in the results of pathname expansion. The filenames -.Q .\& +.FN .\& and -.Q ..\& +.FN ..\& must always be matched explicitly, even if .B dotglob is set. @@ -11626,8 +11690,7 @@ shell variable cause words to be ignored when performing word completion even if the ignored words are the only possible completions. See -.SM -\fBSHELL VARIABLES\fP +.B "Shell Variables" .ie \n(zZ=1 in \fIbash\fP(1) .el above for a description of @@ -11653,9 +11716,9 @@ and upper-case and lower-case ASCII characters will collate together. .TP 8 .B globskipdots If set, pathname expansion will never match the filenames -.Q .\& +.FN .\& and -.Q ..\& , +.FN ..\& , even if the pattern begins with a .Q .\& . This option is enabled by default. @@ -11713,7 +11776,7 @@ to all jobs when an interactive login shell exits. .B inherit_errexit If set, command substitution inherits the value of the \fBerrexit\fP option, instead of unsetting it in the subshell environment. -This option is enabled when \fIposix mode\fP is enabled. +This option is enabled when posix mode is enabled. .TP 8 .B interactive_comments In an interactive shell, a word beginning with \fB#\fP @@ -12004,11 +12067,11 @@ The expression is parsed and evaluated according to precedence using the rules listed above. .PD .PP -When the shell is in \fIposix mode\fP, or if the expression is part +When the shell is in posix mode, or if the expression is part of the \fB[[\fP command, the \fB<\fP and \fB>\fP operators sort using the current locale. -If the shell is not in \fIposix mode\fP, the \fBtest\fP and \fB[\fP +If the shell is not in posix mode, the \fBtest\fP and \fB[\fP commands sort lexicographically using ASCII ordering. .PP The historical operator-precedence parsing with 4 or more arguments can @@ -12914,7 +12977,7 @@ script. \fIThe Gnu History Library\fP, Brian Fox and Chet Ramey .TP \fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE \(em -http://pubs.opengroup.org/onlinepubs/9699919799/ +http://pubs.opengroup.org/onlinepubs/9799919799/ .TP http://tiswww.case.edu/\*~chet/bash/POSIX \(em a description of posix mode .TP diff --git a/doc/bash.html b/doc/bash.html index 19b315d2..9491d6b5 100644 --- a/doc/bash.html +++ b/doc/bash.html @@ -3,7 +3,7 @@ -
BASH(1)2024 October 14BASH(1) +BASH(1)2024 October 15BASH(1)

Index @@ -216,7 +216,8 @@ builtin below).
Equivalent to -D, but the output is in the GNU gettext -po (portable object) file format. + +(portable object) file format.
--dump-strings
@@ -234,6 +235,7 @@ Execute commands from file instead of the standard personal initialization file + ~/.bashrc if the shell is interactive (see @@ -260,11 +262,14 @@ Do not read either the system-wide startup file /etc/profile or any of the personal initialization files + ~/.bash_profile, + ~/.bash_login, or + ~/.profile. By default, @@ -279,6 +284,7 @@ below).
Do not read and execute the personal initialization file + ~/.bashrc if the shell is interactive. @@ -295,7 +301,7 @@ See below for a reference to a document that details how posix mode affects -bash's behavior. +Bash's behavior.
--restricted
@@ -412,10 +418,23 @@ When 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 +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 and executes commands from the first one that exists and is readable. The --noprofile @@ -427,14 +446,21 @@ 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 -exists. +reads and executes commands from the file + +~/.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 + +~/.bashrc, + +if that file exists. This may be inhibited by using the --norc @@ -442,7 +468,10 @@ option. The --rcfile file option causes bash -to use file instead of ~/.bashrc. +to use file instead of + +~/.bashrc. +

When @@ -493,16 +522,18 @@ while conforming to the POSIX standard as well. When invoked as an interactive login shell, or a non-interactive shell with the --login option, it first attempts to read and execute commands from + /etc/profile and + ~/.profile, in that order. The --noprofile -option may be used to inhibit this behavior. +option will inhibit this behavior. When invoked as an interactive shell with the name sh, @@ -531,19 +562,13 @@ When invoked as bash -enters -posix - -mode after the startup files are read. +enters posix mode after reading the startup files.

When bash -is started in -posix - -mode, as with the +is started in posix mode, as with the --posix command line option, it follows the POSIX standard for startup files. @@ -566,17 +591,23 @@ 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 + +~/.bashrc, + if that file exists and is readable. It will not do this if invoked as sh. The --norc -option may be used to inhibit this behavior, and the +option will inhibit this behavior, and the --rcfile option will make bash use a different file instead of -~/.bashrc, but neither + +~/.bashrc, + +but neither rshd nor sshd generally invoke the shell with those options or allow them to be specified.

@@ -769,7 +800,7 @@ reserved word precedes a pipeline, the shell reports the elapsed as well as user and system time consumed by its execution when the pipeline terminates. The -p option changes the output format to that specified by POSIX. -When the shell is in posix mode, it does not recognize +When the shell is in posix mode, it does not recognize time as a reserved word if the next token begins with a The value of the @@ -786,7 +817,7 @@ below under

-When the shell is in posix mode, time +When the shell is in posix mode, time may appear by itself as the only word in a simple command. In this case, the shell displays the total user and system time consumed by the shell and its children. @@ -1351,7 +1382,7 @@ If the function reserved word is used, but the parentheses are not supplied, the braces are recommended. compound-command is executed whenever fname is specified as the name of a simple command. -When in posix mode, fname must be a valid shell name +When in posix mode, fname must be a valid shell name and may not be the name of one of the POSIX special builtins. In default mode, a function name can be any unquoted shell word that does not contain $. @@ -1467,7 +1498,7 @@ of all characters within the quotes, with the exception of and, when history expansion is enabled, !. -When the shell is in posix mode, +When the shell is in posix mode, the ! has no special meaning within double quotes, even when history expansion is enabled. The characters @@ -1736,7 +1767,7 @@ and local builtin commands (declaration commands). -When in posix mode, these builtins may appear in a command after +When in posix mode, these builtins may appear in a command after one or more instances of the command builtin and retain these assignment statement properties.

@@ -2423,7 +2454,7 @@ Each time this parameter is referenced, it expands to the number of seconds since the Unix Epoch (see time(3)) -as a floating point value with micro-second granularity. +as a floating-point value with micro-second granularity. Assignments to EPOCHREALTIME @@ -2648,7 +2679,7 @@ subsequently reset.

READLINE_ARGUMENT
-Any numeric argument given to a readline command that was defined using +Any numeric argument given to a readline command that was defined using (see SHELL BUILTIN COMMANDS @@ -2926,7 +2957,7 @@ Expanded and executed similarly to (see INVOCATION above) -when an interactive shell is invoked in posix mode. +when an interactive shell is invoked in posix mode.
EXECIGNORE
@@ -2994,7 +3025,11 @@ Controls how the results of pathname expansion are sorted. The value of this variable specifies the sort criteria and sort order for the results of pathname expansion. If this variable is unset or set to the null string, pathname expansion -uses the historical behavior of sorting by name. +uses the historical behavior of sorting by name, +in ascending lexicographic order as determined by the +LC_COLLATE + +shell variable.
If set, a valid value begins with an optional +, which is ignored, or -, which reverses the sort order from ascending to descending, @@ -3026,14 +3061,20 @@ For example, a value of -mtime sorts the results in descending order by modification time (newest first).
The numeric specifier treats names consisting solely of digits as -numbers and sorts them using the numeric value (so "2" will sort before -"10", for example). +numbers and sorts them using their numeric value (so + +will sort before + +for example). When using numeric, names containing non-digits sort after all the all-digit names and are sorted by name using the traditional behavior.
-A sort specifier of nosort disables sorting completely; the results -are returned in the order they are read from the file system, -and any leading + or - is ignored. +A sort specifier of nosort disables sorting completely; +bash + +returns the results +in the order they are read from the file system, +ignoring any leading -.
If the sort specifier is missing, it defaults to name, so a value of + is equivalent to the null string, @@ -3092,7 +3133,10 @@ The name of the file in which command history is saved (see below). -Bash assigns a default value of ~/.bash_history. +Bash assigns a default value of + +~/.bash_history. + If HISTFILE is unset or null, the shell does not save the command history when it exits.
HISTFILESIZE @@ -3426,14 +3470,14 @@ A common value is
If this variable is in the environment when bash starts, the shell -enters posix mode before reading the startup files, as if the +enters posix mode before reading the startup files, as if the --posix invocation option had been supplied. If it is set while the shell is -running, bash enables posix mode, as if the command +running, bash enables posix mode, as if the command had been executed. -When the shell enters posix mode, it sets this variable if it was +When the shell enters posix mode, it sets this variable if it was not already set.
PROMPT_COMMAND @@ -3657,20 +3701,18 @@ and tokenization (see below). The first character is the history expansion character, -the character which signals the start of a history -expansion, normally +the character which begins a history 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, -when it appears as the first character on the line. -The default is +The second character is the quick substitution character, normally +When it appears as the first character on the line, +history substitution repeats the previous command, +replacing one string with another. 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 comment character causes history substitution to be skipped +The history comment character disables history substitution for the remaining words on the line. It does not necessarily cause the shell parser to treat the rest of the line as a comment. @@ -4215,7 +4257,7 @@ of variable assignments (as described above under when they appear as arguments to simple commands. Bash does not do this, except for the declaration commands listed -above, when in posix mode. +above, when in posix mode.  

Parameter Expansion

@@ -4264,7 +4306,8 @@ and parameter is not a nameref, it introduces a level of indirection. Bash uses the value formed by expanding the rest of parameter as the new parameter; -this new parameter is then expanded and that value is used in the rest of the expansion, rather +this new parameter is then expanded and that value is used +in the rest of the expansion, rather than the expansion of the original parameter. This is known as indirect expansion. The value is subject to tilde expansion, @@ -5142,8 +5185,12 @@ must be matched explicitly, unless the shell option is set. In order to match the filenames +. + and +.., + the pattern must begin with (for example, @@ -5157,8 +5204,12 @@ If the shell option is enabled, the filenames +. + and +.. + never match, even if the pattern begins with a When not matching pathnames, the @@ -5220,8 +5271,12 @@ If the nocaseglob option is set, the matching against the patterns in is performed without regard to case. The filenames +. + and +.. + are always ignored when GLOBIGNORE @@ -5445,8 +5500,12 @@ beginning with but +. + and +.. + must be matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not include any filenames beginning with @@ -5458,8 +5517,12 @@ If the shell option is enabled, the filenames +. + and +.. + never appear in the set. As above, @@ -6520,10 +6583,22 @@ If the operating system on which bash is running provides these special files, bash will use them; otherwise it will emulate them internally with this behavior: If any file argument to one of the primaries is of the form -/dev/fd/n, then file descriptor n is checked. + +/dev/fd/n, + +then bash checks file descriptor n. If the file argument to one of the primaries is one of -/dev/stdin, /dev/stdout, or /dev/stderr, file -descriptor 0, 1, or 2, respectively, is checked. + +dev/stdin, + + +dev/stdout, + +or + +dev/stderr, + +bash checks file descriptor 0, 1, or 2, respectively.

Unless otherwise specified, primaries that operate on files follow symbolic @@ -6531,10 +6606,10 @@ links and operate on the target of the link, rather than the link itself.

When used with [[, -or when the shell is in posix mode, +or when the shell is in posix mode, the < and > operators sort lexicographically using the current locale. -When the shell is not in posix mode, +When the shell is not in posix mode, the test command sorts using ASCII ordering.

@@ -6973,11 +7048,10 @@ Changes made to the subshell environment cannot affect the shell's execution environment.

-When the shell is in -posix mode, +When the shell is in posix mode, subshells spawned to execute command substitutions inherit the value of the -e option from their parent shell. -When not in posix mode, +When not in posix mode, bash clears the -e option in such subshells. See the description of the inherit_errexit shell option below @@ -6985,7 +7059,10 @@ for how to control this behavior when not in posix mode.

If a command is followed by a & and job control is not active, the -default standard input for the command is the empty file /dev/null. +default standard input for the command is the empty file + +/dev/null. + Otherwise, the invoked command inherits the file descriptors of the calling shell as modified by redirections.   @@ -7573,7 +7650,7 @@ builtin command is enabled, bash -reports such changes immediately. +reports status changes immediately. Bash executes any trap on SIGCHLD @@ -7875,34 +7952,41 @@ builtin.  

Readline Notation

-This section uses an emacs-style notation to denote keystrokes. +This section uses Emacs-style editing concepts and uses its +notation for keystrokes. Control keys are denoted by C-key, e.g., C-n means Control-N. Similarly, meta keys are denoted by M-key, so M-x means Meta-X. +The Meta key is often labeled + +or +

On keyboards without a Meta -key, M-x means ESC x, i.e., press the Escape key -then the +key, M-x means ESC x, +i.e., press and release the Escape key, +then press and release the x -key. +key, in sequence. This makes ESC the meta prefix. -The combination M-C-x means ESC-Control-x, -or press the Escape key -then hold the Control key while pressing the +The combination M-C-x means ESC-Control-x: +press and release the Escape key, +then press and hold the Control key while pressing the x -key. +key, then release both.

-On some keyboards, the Meta key modifier produces meta characters with -the eighth bit (0200) set (you can use the enable-meta-key variable -to control whether or not it does this, if the keyboard allows it). +On some keyboards, the Meta key modifier produces characters with +the eighth bit (0200) set. +You can use the enable-meta-key variable +to control whether or not it does this, if the keyboard allows it. On many others, the terminal or terminal emulator converts the metafied key to a key sequence beginning with ESC as described in the preceding paragraph. @@ -7915,7 +7999,9 @@ you can make M-key key bindings you specify (see below) do the same thing by setting the force-meta-prefix variable.

-Readline commands may be given numeric +Readline + +commands may be given numeric arguments, which normally act as a repeat count. @@ -7927,6 +8013,17 @@ Commands whose behavior with arguments deviates from this are noted below.

+The point is the current cursor position, and mark refers +to a saved cursor position. +The text between the point and mark is referred to as the region. +Readline has the concept of an active region: +when the region is active, readline redisplay +highlights the region using the +value of the active-region-start-color variable. +The enable-active-region variable turns this on and off. +Several commands set the region to active; those are noted below. +

+ When a command is described as killing text, the text deleted is saved for possible future retrieval (yanking). @@ -7938,7 +8035,9 @@ on the kill ring.  

Readline Initialization

-Readline is customized by putting commands in an initialization +Readline + +is customized by putting commands in an initialization file (the inputrc file). The name of this file is taken from the value of the INPUTRC @@ -7946,12 +8045,14 @@ The name of this file is taken from the value of the shell variable. If that variable is unset, the default is + ~/.inputrc. -If that file does not exist or cannot be read, readline looks for +If that file does not exist or cannot be read, readline looks for + /etc/inputrc. -When a program which uses the readline library starts up, +When a program which uses the readline library starts up, readline reads the initialization file and sets the key bindings and variables found there, before reading any user input. @@ -7969,7 +8070,7 @@ may be changed using key binding commands in the inputrc file. -Programs that use the readline library, including bash, +Programs that use the readline library, including bash, may add their own commands and bindings.

@@ -7990,7 +8091,7 @@ C-Meta-u: universal-argument into the inputrc -would make M-C-u execute the readline command +would make M-C-u execute the readline command universal-argument.

@@ -8021,7 +8122,7 @@ and

-In addition to command names, readline allows keys to be bound +In addition to command names, readline allows keys to be bound to a string that is inserted when the key is pressed (a macro). The difference between a macro and a command is that a macro is enclosed in single or double quotes. @@ -8240,7 +8341,7 @@ including " Bash -will display or modify the current readline key bindings with the +will display or modify the current readline key bindings with the bind builtin command. @@ -8263,7 +8364,7 @@ will change the editing mode during interactive use.  

Readline Variables

-Readline has variables that can be used to further customize its +Readline has variables that can be used to further customize its behavior. A variable may be set in the inputrc @@ -8282,7 +8383,7 @@ or using the bind builtin command (see below).

-Except where noted, readline variables can take the values +Except where noted, readline variables can take the values On or @@ -8290,7 +8391,7 @@ or (without regard to case). Unrecognized variable names are ignored. -When readline reads a variable value, empty or null values, +When readline reads a variable value, empty or null values, (case-insensitive), and @@ -8299,7 +8400,7 @@ All other values are equivalent to Off.

-The bind -V command lists the current readline variable names +The bind -V command lists the current readline variable names and values (see SHELL BUILTIN COMMANDS @@ -8346,17 +8447,17 @@ A sample value might be

bell-style (audible)
-Controls what happens when readline wants to ring the terminal bell. -If set to none, readline never rings the bell. -If set to visible, readline uses a visible bell if one is available. -If set to audible, readline attempts to ring the terminal's bell. +Controls what happens when readline wants to ring the terminal bell. +If set to none, readline never rings the bell. +If set to visible, readline uses a visible bell if one is available. +If set to audible, readline attempts to ring the terminal's bell.
bind-tty-special-chars (On)
-If set to On, readline attempts to bind +If set to On, readline attempts to bind the control characters that are treated specially by the kernel's -terminal driver to their readline equivalents. -These override the default readline bindings described here. +terminal driver to their readline equivalents. +These override the default readline bindings described here. Type at a bash prompt to see your current terminal settings, @@ -8364,23 +8465,23 @@ including the special control characters (usually cchars).
blink-matching-paren (Off)
-If set to On, readline attempts to briefly move the cursor to an +If set to On, readline attempts to briefly move the cursor to an opening parenthesis when a closing parenthesis is inserted.
colored-completion-prefix (Off)
-If set to On, when listing completions, readline displays the +If set to On, when listing completions, readline displays the common prefix of the set of possible completions using a different color. The color definitions are taken from the value of the LS_COLORS environment variable. If there is a color definition in $LS_COLORS for the custom suffix -readline uses this color for +readline uses this color for the common prefix instead of its default.
colored-stats (Off)
-If set to On, readline displays possible completions using different +If set to On, readline displays possible completions using different colors to indicate their file type. The color definitions are taken from the value of the LS_COLORS environment variable. @@ -8391,7 +8492,7 @@ environment variable.
-The string that the readline +The string that the readline insert-comment command inserts. @@ -8414,12 +8515,14 @@ The default value is -1.
completion-ignore-case (Off)
-If set to On, readline performs filename matching and completion +If set to On, readline performs filename matching and completion in a case-insensitive fashion.
completion-map-case (Off)
-If set to On, and completion-ignore-case is enabled, readline +If set to On, and completion-ignore-case is enabled, +readline + treats hyphens (-) and underscores (_) as equivalent when performing case-insensitive filename matching and completion.
completion-prefix-display-length (0) @@ -8428,7 +8531,7 @@ performing case-insensitive filename matching and completion. The maximum length in characters of the common prefix of a list of possible completions that is displayed without modification. -When set to a value greater than zero, readline +When set to a value greater than zero, readline replaces common prefixes longer than this value with an ellipsis when displaying possible completions.
completion-query-items (100) @@ -8440,18 +8543,18 @@ generated by the possible-completions command. It may be set to any integer value greater than or equal to zero. If the number of possible completions is greater than or equal to the value of this variable, -readline will ask whether or not the user wishes to view them; -otherwise readline simply lists them on the terminal. -A zero value means readline should never ask; negative values are +readline will ask whether or not the user wishes to view them; +otherwise readline simply lists them on the terminal. +A zero value means readline should never ask; negative values are treated as zero.
convert-meta (On)
-If set to On, readline will convert characters it reads +If set to On, readline will convert characters it reads that have the eighth bit set to an ASCII key sequence by clearing the eighth bit and prefixing it with an escape character -(converting the character to have the meta prefix). -The default is On, but readline will set it to Off +(converting the character to have the meta prefix). +The default is On, but readline will set it to Off if the locale contains characters whose encodings may include bytes with the eighth bit set. This variable is dependent on the LC_CTYPE locale category, and @@ -8461,19 +8564,19 @@ This variable also affects key bindings; see the description of
disable-completion (Off)
-If set to On, readline will inhibit word completion. +If set to On, readline will inhibit word completion. Completion characters will be inserted into the line as if they had been mapped to self-insert.
echo-control-characters (On)
When set to On, on operating systems that indicate they support it, -readline echoes a character corresponding to a signal generated from the +readline echoes a character corresponding to a signal generated from the keyboard.
editing-mode (emacs)
-Controls whether readline uses a set of key bindings similar +Controls whether readline uses a set of key bindings similar to Emacs or vi. editing-mode @@ -8498,12 +8601,10 @@ sequence into the mode string.
enable-active-region (On)
-The point is the current cursor position, and mark refers -to a saved cursor position. -The text between the point and mark is referred to as the region. -When this variable is set to On, readline allows certain commands +When this variable is set to On, readline allows certain commands to designate the region as active. -When the region is active, readline highlights the text in the region using +When the region is active, readline highlights +the text in the region using the value of the active-region-start-color, which defaults to the string that enables the terminal's standout mode. The active region shows the text inserted by bracketed-paste and any @@ -8511,22 +8612,22 @@ matching text found by incremental and non-incremental history searches.
enable-bracketed-paste (On)
-When set to On, readline configures the terminal to insert each +When set to On, readline configures the terminal to insert each paste into the editing buffer as a single string of characters, instead of treating each character as if it had been read from the keyboard. This is called bracketed-paste mode; -it prevents readline from executing any editing commands bound to key +it prevents readline from executing any editing commands bound to key sequences appearing in the pasted text.
enable-keypad (Off)
-When set to On, readline will try to enable the application +When set to On, readline will try to enable the application keypad when it is called. Some systems need this to enable the arrow keys.
enable-meta-key (On)
-When set to On, readline will try to enable any meta modifier +When set to On, readline will try to enable any meta modifier key the terminal claims to support. On many terminals, the Meta key is used to send eight-bit characters; this variable checks for the terminal capability that indicates the @@ -8536,27 +8637,27 @@ typed (a meta character).
expand-tilde (Off)
-If set to On, readline performs tilde expansion when it +If set to On, readline performs tilde expansion when it attempts word completion.
force-meta-prefix (Off)
-If set to On, readline modifies its behavior when binding key +If set to On, readline modifies its behavior when binding key sequences containing \M- or Meta- (see Key Bindings above) by converting a key sequence of the form \M-C or Meta-C to the two-character sequence -ESCC (adding the meta prefix). +ESC C (adding the meta prefix). If force-meta-prefix is set to Off (the default), -readline uses the value of the +readline uses the value of the convert-meta variable to determine whether to perform this conversion: if convert-meta is On, -readline performs the conversion described above; -if it is Off, readline converts C to a meta character by +readline performs the conversion described above; +if it is Off, readline converts C to a meta character by setting the eighth bit (0200).
history-preserve-point (Off) @@ -8579,7 +8680,7 @@ the maximum number of history entries to 500.
horizontal-scroll-mode (Off)
-Setting this variable to On makes readline use a single line +Setting this variable to On makes readline use a single line for display, scrolling the input horizontally on a single screen line when it becomes longer than the screen width rather than wrapping to a new line. @@ -8587,10 +8688,10 @@ This setting is automatically enabled for terminals of height 1.
input-meta (Off)
-If set to On, readline will enable eight-bit input (that is, it +If set to On, readline will enable eight-bit input (that is, it will not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. -The default is Off, but readline will set it to On +The default is Off, but readline will set it to On if the locale contains characters whose encodings may include bytes with the eighth bit set. This variable is dependent on the LC_CTYPE locale category, and @@ -8607,7 +8708,7 @@ If this variable has not been given a value, the characters
keymap (emacs)
-Set the current readline keymap. +Set the current readline keymap. The set of valid keymap names is emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-command, and @@ -8623,16 +8724,16 @@ also affects the default keymap.
keyseq-timeout (500)
-Specifies the duration readline will wait for a character when +Specifies the duration readline will wait for a character when reading an ambiguous key sequence (one that can form a complete key sequence using the input read so far, or can take additional input to complete a longer key sequence). -If readline does not receive any input within the timeout, it will use the -shorter but complete key sequence. +If readline does not receive any input within the timeout, +it will use the shorter but complete key sequence. The value is specified in milliseconds, so a value of 1000 means that -readline will wait one second for additional input. +readline will wait one second for additional input. If this variable is set to a value less than or equal to zero, or to a -non-numeric value, readline will wait until another key is pressed to +non-numeric value, readline will wait until another key is pressed to decide which key sequence to complete.
mark-directories (On) @@ -8641,7 +8742,8 @@ If set to On, completed directory names have a slash appended.
mark-modified-lines (Off)
-If set to On, readline displays history lines that have been modified +If set to On, readline displays history lines +that have been modified with a preceding asterisk (*).
mark-symlinked-directories (Off) @@ -8651,7 +8753,7 @@ have a slash appended, subject to the value of mark-directories.
match-hidden-files (On)
-This variable, when set to On, forces readline to match files whose +This variable, when set to On, forces readline to match files whose names begin with a (hidden files) when performing filename completion. @@ -8667,10 +8769,10 @@ the list.
output-meta (Off)
-If set to On, readline will display characters with the +If set to On, readline will display characters with the eighth bit set directly rather than as a meta-prefixed escape sequence. -The default is Off, but readline will set it to On +The default is Off, but readline will set it to On if the locale contains characters whose encodings may include bytes with the eighth bit set. This variable is dependent on the LC_CTYPE locale category, and @@ -8678,7 +8780,7 @@ its value may change if the locale changes.
page-completions (On)
-If set to On, readline uses an internal more-like pager +If set to On, readline uses an internal more-like pager to display a screenful of possible completions at a time.
prefer-visible-bell @@ -8687,12 +8789,12 @@ See bell-style.
print-completions-horizontally (Off)
-If set to On, readline will display completions with matches +If set to On, readline will display completions with matches sorted horizontally in alphabetical order, rather than down the screen.
revert-all-at-newline (Off)
-If set to On, readline will undo all changes to history lines +If set to On, readline will undo all changes to history lines before returning when executing accept-line. By default, history lines may be modified and retain individual undo lists across @@ -8700,7 +8802,7 @@ calls to readline.
search-ignore-case (Off)
-If set to On, readline performs incremental and non-incremental +If set to On, readline performs incremental and non-incremental history list searches in a case-insensitive fashion.
show-all-if-ambiguous (Off) @@ -8735,7 +8837,7 @@ The mode strings are user-settable (e.g., emacs-mode-string). If set to On, this alters the default completion behavior when inserting a single match into the line. It's only active when performing completion in the middle of a word. -If enabled, readline does not insert characters from the completion +If enabled, readline does not insert characters from the completion that match characters after point in the word being completed, so portions of the word following the cursor are not duplicated.
vi-cmd-mode-string ((cmd)) @@ -8771,7 +8873,9 @@ completions.  

Readline Conditional Constructs

-Readline implements a facility similar in spirit to the conditional +Readline + +implements a facility similar in spirit to the conditional compilation features of the C preprocessor which allows key bindings and variable settings to be performed as the result of tests. @@ -8785,7 +8889,7 @@ The construct allows bindings to be made based on the editing mode, the terminal being used, or the application using -readline. +readline. The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no characters are required to isolate it. @@ -8795,11 +8899,11 @@ unless otherwise noted, no characters are required to isolate it.
The mode= form of the $if directive is used to test -whether readline is in emacs or vi mode. +whether readline is in emacs or vi mode. This may be used in conjunction with the set keymap command, for instance, to set bindings in the emacs-standard and emacs-ctlx keymaps only if -readline is starting out in emacs mode. +readline is starting out in emacs mode.
term
@@ -8825,8 +8929,8 @@ for instance.
The version test may be used to perform comparisons against -specific readline versions. -The version expands to the current readline version. +specific readline versions. +The version expands to the current readline version. The set of comparison operators includes =, @@ -8856,7 +8960,7 @@ and from the version number argument by whitespace.
The application construct is used to include application-specific settings. -Each program using the readline +Each program using the readline library sets the application name, and an initialization file can test for a particular value. This could be used to bind key sequences to functions useful for @@ -8888,7 +8992,7 @@ key sequence that quotes the current or previous word in bash:
variable
-The variable construct provides simple equality tests for readline +The variable construct provides simple equality tests for readline variables and values. The permitted comparison operators are =, ==, and !=. The variable name must be separated from the comparison operator by @@ -8914,7 +9018,10 @@ This command, as seen in the previous example, terminates an
This directive takes a single filename as an argument and reads commands and key bindings from that file. -For example, the following directive would read /etc/inputrc: +For example, the following directive would read + +/etc/inputrc: +

@@ -8928,8 +9035,9 @@ For example, the following directive would read /  

Searching

-Readline provides commands for searching through the command history -(see +Readline + +provides commands for searching through the command history (see HISTORY @@ -8945,7 +9053,7 @@ and Incremental searches begin before the user has finished typing the search string. -As each character of the search string is typed, readline displays +As each character of the search string is typed, readline displays the next entry from the history matching the string typed so far. An incremental search requires only as many characters as needed to find the desired history entry. @@ -8965,7 +9073,7 @@ To find other matching entries in the history list, type C-r or C-s as appropriate. This will search backward or forward in the history for the next entry matching the search string typed so far. -Any other key sequence bound to a readline command will terminate +Any other key sequence bound to a readline command will terminate the search and execute that command. For instance, a newline will terminate the search and accept the line, thereby executing the command from the history list. @@ -8973,9 +9081,11 @@ A movement command will terminate the search, make the last line found the current line, and begin editing.

-Readline remembers the last incremental search string. +Readline + +remembers the last incremental search string. If two C-rs are typed without any intervening characters defining -a new search string, readline uses any remembered search string. +a new search string, readline uses any remembered search string.

Non-incremental searches read the entire search string before starting @@ -8994,8 +9104,10 @@ In the following descriptions, point refers to the current cursor position, and mark refers to a cursor position saved by the set-mark command. The text between the point and mark is referred to as the region. -Readline has the concept of an active region: -when the region is active, readline redisplay uses the +Readline + +has the concept of an active region: +when the region is active, readline redisplay uses the value of the active-region-start-color variable to denote the region. Several commands set the region to active; those are noted below. @@ -9048,16 +9160,17 @@ Words are delimited by non-quoted shell metacharacters. Attempt to move point to the same physical screen column on the previous physical screen line. This will not have the desired effect if the current -readline line does not take up more than one physical line or if point is not -greater than the length of the prompt plus the screen width. +readline line does not take up more than one physical line or if +point is not greater than the length of the prompt plus the screen width.

next-screen-line
Attempt to move point to the same physical screen column on the next physical screen line. This will not have the desired effect if the current -readline line does not take up more than one physical line or if the length -of the current readline line is not greater than the length of the prompt +readline line does not take up more than one physical line or if +the length of the current readline line is +not greater than the length of the prompt plus the screen width.
clear-display (M-C-l) @@ -9304,7 +9417,7 @@ The character indicating end-of-file as set, for example, by stty(1). If this character is read when there are no characters -on the line, and point is at the beginning of the line, readline +on the line, and point is at the beginning of the line, readline interprets it as the end of input and returns EOF. @@ -9349,8 +9462,8 @@ This function is intended to be bound to the escape sequence sent by some terminals, and such a binding is assigned by default. -It allows readline to insert the pasted text as a single unit without treating -each character as if it had been read from the keyboard. +It allows readline to insert the pasted text as a single unit +without treating each character as if it had been read from the keyboard. The pasted characters are inserted as if each one was bound to self-insert instead of executing any editing commands. @@ -9567,7 +9680,7 @@ If none of these produces a match, it falls back to filename completion.
List the possible completions of the text before point. -When displaying completions, readline sets the number of columns used +When displaying completions, readline sets the number of columns used for display to the value of completion-display-width, the value of the shell variable COLUMNS, @@ -9792,13 +9905,13 @@ CSI sequences begin with a Control Sequence Indicator (CSI), usually ESC-[. If this sequence is bound to keys producing CSI sequences will have no effect -unless explicitly bound to a readline command, instead of inserting +unless explicitly bound to a readline command, instead of inserting stray characters into the editing buffer. This is unbound by default, but usually bound to ESC-[.
insert-comment (M-#)
-Without a numeric argument, insert the value of the readline +Without a numeric argument, insert the value of the readline comment-begin variable at the beginning of the current line. @@ -9844,31 +9957,31 @@ pathname expansion.
Print all of the functions and their key bindings -to the readline output stream. +to the readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file.
dump-variables
-Print all of the settable readline variables and their values -to the readline output stream. +Print all of the settable readline variables and their values +to the readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file.
dump-macros
-Print all of the readline key sequences bound to macros and the +Print all of the readline key sequences bound to macros and the strings they output -to the readline output stream. +to the readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file.
execute-named-command (M-x)
-Read a bindable readline command name from the input and execute the +Read a bindable readline command name from the input and execute the function to which it's bound, as if the key sequence to which it was bound appeared in the input. If this function is supplied with a numeric argument, it passes that @@ -10069,16 +10182,16 @@ if the compspec generates no matches, bash attempts its default completions. If the -o default option was supplied to complete when the compspec was defined, programmable completion will perform -readline's default completion +readline's default completion if the compspec (and, if attempted, the default bash completions) generate no matches.

When a compspec indicates that directory name completion is desired, -the programmable completion functions force readline to append a slash +the programmable completion functions force readline to append a slash to completed names which are symbolic links to directories, subject to -the value of the mark-directories readline variable, regardless -of the setting of the mark-symlinked-directories readline variable. +the value of the mark-directories readline variable, regardless +of the setting of the mark-symlinked-directories readline variable.

There is some support for dynamically modifying completions. @@ -10171,7 +10284,10 @@ the file named by the HISTFILE -variable (default ~/.bash_history). +variable (default + +~/.bash_history). + That file is referred to as the history file. The history file is truncated, if necessary, to contain no more than the number of history entries @@ -10803,7 +10919,7 @@ to find the directory containing filename. filename does not need to be executable. -When bash is not in posix mode, it searches +When bash is not in posix mode, it searches the current directory if filename is not found in PATH, @@ -10839,7 +10955,7 @@ is not found or cannot be read. With no arguments or with the -p -option,alias prints the list of aliases in the form +option, alias prints the list of aliases in the form alias name=value on standard output. When arguments are supplied, define an alias for each name whose value is given. @@ -10940,13 +11056,13 @@ that they can be used as an argument to a subsequent bind command or in a readline initialization file. If arguments remain after option processing, bind treats -them as readline command names and restricts output to those names. +them as readline command names and restricts output to those names.

-P
List current readline function names and bindings. If arguments remain after option processing, bind treats -them as readline command names and restricts output to those names. +them as readline command names and restricts output to those names.
-s
@@ -11037,7 +11153,7 @@ those new values will be reflected in the editing state.
List all key sequences bound to shell commands and the associated commands in a format that can be reused as -an argument to a subsequent @code{bind} command. +an argument to a subsequent bind command.

@@ -11095,7 +11211,11 @@ The current frame is frame 0. The return value is 0 unless the shell is not executing a subroutine call or expr does not correspond to a valid position in the call stack. -

cd [-L|[-P [-e]]] [-@] [dir]
+
+
+cd [-L] [-@] [dir] +
cd -P [-e] [-@] [dir]
+ Change the current directory to dir. if dir is not supplied, the value of the HOME @@ -11106,7 +11226,9 @@ The variable CDPATH -exists, cd uses it as a search path: +exists, +and dir does not begin with a slash (/), +cd uses it as a search path: the shell searches each directory name in CDPATH @@ -11123,22 +11245,17 @@ A null directory name in is the same as the current directory, i.e., -If -dir - -begins with a slash (/), -then -CDPATH - - -is not used.
The -P option causes cd to use the physical directory structure by resolving symbolic links while traversing dir and -before processing instances of .. in dir (see also the +before processing instances of + +.. + +in dir (see also the -P option to the @@ -11149,11 +11266,36 @@ builtin command). The -L -option forces symbolic links to be followed by resolving the link -after processing instances of .. in dir. -If .. appears in dir, it is processed by removing the +option forces cd to follow symbolic links by resolving the link +after processing instances of + +.. + +in dir. +If + +.. + +appears in dir, cd processes it by removing the immediately previous pathname component from dir, back to a slash -or the beginning of dir. +or the beginning of dir, +and verifying that the portion of dir it has processed to +that point is still a valid directory name after removing the pathname +component. +If it is not a valid directory name, cd returns a non-zero status. +If neither +-L + +nor +-P + +is supplied, +cd + +behaves as if +-L + +had been supplied.
If the -e @@ -11161,9 +11303,8 @@ If the option is supplied with -P, -and the current working directory cannot be successfully determined -after a successful directory change, cd will return a non-zero -status. +and cd cannot successfully determine the current working directory +after a successful directory change, it will return a non-zero status.
On systems that support it, the -@ option presents the extended attributes associated with a file as a directory. @@ -13350,8 +13491,9 @@ If the standard input is coming from a terminal, above) to obtain the line. -Readline uses the current (or default, if line editing was not previously -active) editing settings, but uses readline's default filename completion. +Readline uses the current +(or default, if line editing was not previously active) +editing settings, but uses readline's default filename completion.
-E
@@ -13366,7 +13508,9 @@ If the standard input is coming from a terminal, above) to obtain the line. -Readline uses the current (or default, if line editing was not previously +Readline + +uses the current (or default, if line editing was not previously active) editing settings, but uses bash's default completion, including programmable completion.
-i text @@ -13560,7 +13704,7 @@ Without options, display the name and value of each shell variable in a format that can be reused as input for setting or resetting the currently-set variables. Read-only variables cannot be reset. -In posix mode, only shell variables are listed. +In posix mode, only shell variables are listed. The output is sorted according to the current locale. When options are specified, they set or unset shell attributes. Any arguments remaining after option processing are treated @@ -13775,7 +13919,7 @@ The effect is as if the shell command had been executed (see -Shell Variables< +Shell Variables above). @@ -14352,7 +14496,7 @@ If set, replaces directory names with the results of word expansion when performing filename completion. -This changes the contents of the readline editing buffer. +This changes the contents of the readline editing buffer. If not set, bash @@ -14376,8 +14520,12 @@ includes filenames beginning with a in the results of pathname expansion. The filenames +. + and +.. + must always be matched explicitly, even if dotglob @@ -14492,7 +14640,8 @@ shell variable cause words to be ignored when performing word completion even if the ignored words are the only possible completions. See -SHELL VARIABLES +Shell Variables + above for a description of @@ -14526,8 +14675,12 @@ and upper-case and lower-case ASCII characters will collate together.
If set, pathname expansion will never match the filenames +. + and +.., + even if the pattern begins with a This option is enabled by default. @@ -14600,7 +14753,7 @@ to all jobs when an interactive login shell exits.
If set, command substitution inherits the value of the errexit option, instead of unsetting it in the subshell environment. -This option is enabled when posix mode is enabled. +This option is enabled when posix mode is enabled.
interactive_comments
@@ -14940,11 +15093,11 @@ using the rules listed above.

-When the shell is in posix mode, or if the expression is part +When the shell is in posix mode, or if the expression is part of the [[ command, the < and > operators sort using the current locale. -If the shell is not in posix mode, the test and [ +If the shell is not in posix mode, the test and [ commands sort lexicographically using ASCII ordering.

@@ -16062,7 +16215,7 @@ script.

The Gnu Readline Library, Brian Fox and Chet Ramey
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://pubs.opengroup.org/onlinepubs/9799919799/
http://tiswww.case.edu/~chet/bash/POSIX - a description of posix mode
sh(1), ksh(1), csh(1)
emacs(1), vi(1)
@@ -16223,7 +16376,7 @@ Array variables may not (yet) be exported.
-
GNU Bash 5.32024 October 14BASH(1) +GNU Bash 5.32024 October 15BASH(1)

@@ -16332,7 +16485,7 @@ Array variables may not (yet) be exported.
BUGS

-This document was created by man2html from /usr/local/src/bash/bash-20241012/doc/bash.1.
-Time: 14 October 2024 17:00:24 EDT +This document was created by man2html from /usr/local/src/bash/bash-20241015/doc/bash.1.
+Time: 18 October 2024 12:02:45 EDT diff --git a/doc/bash.info b/doc/bash.info index 980573ce..8a51a0ab 100644 --- a/doc/bash.info +++ b/doc/bash.info @@ -1,9 +1,9 @@ This is bash.info, produced by makeinfo version 7.1 from bashref.texi. This text is a brief description of the features that are present in the -Bash shell (version 5.3, 14 October 2024). +Bash shell (version 5.3, 15 October 2024). - This is Edition 5.3, last updated 14 October 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 15 October 2024, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Copyright © 1988-2024 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, 14 October 2024). The Bash home page is +Bash shell (version 5.3, 15 October 2024). The Bash home page is . - This is Edition 5.3, last updated 14 October 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 15 October 2024, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Bash contains features that appear in other popular shells, and some @@ -2619,7 +2619,7 @@ set of filenames that are tested: when ‘dotglob’ is enabled, the set of filenames includes all files beginning with ‘.’, but the filenames ‘.’ and ‘..’ must be matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not include any filenames -beginning with "." unless the pattern or sub-pattern begins with a ‘.’. +beginning with ‘.’ unless the pattern or sub-pattern begins with a ‘.’. If the ‘globskipdots’ shell option is enabled, the filenames ‘.’ and ‘..’ never appear in the set. As above, ‘.’ only has a special meaning when matching filenames. @@ -2673,7 +2673,7 @@ redirection refers to the standard input (file descriptor 0). If the first character of the redirection operator is ‘>’, the redirection refers to the standard output (file descriptor 1). - The \fIword\fP following the redirection operator in the following + The WORD following the redirection operator in the following descriptions, unless otherwise noted, is subjected to brace expansion, tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, quote removal, filename expansion, and word @@ -3407,18 +3407,19 @@ standard. greater than or equal to 1. ‘cd’ - cd [-L|[-P [-e]]] [-@] [DIRECTORY] + cd [-L] [-@] [DIRECTORY] + cd -P [-e] [-@] [DIRECTORY] Change the current working directory to DIRECTORY. If DIRECTORY is not supplied, the value of the ‘HOME’ shell variable is used as - DIRECTORY. If the shell variable ‘CDPATH’ exists, ‘cd’ uses it as - a search path: ‘cd’ searches each directory name in ‘CDPATH’ for - DIRECTORY, with alternative directory names in ‘CDPATH’ separated - by a colon (‘:’). A null directory name in ‘CDPATH’ means the same - thing as the current directory. If DIRECTORY begins with a slash, - ‘CDPATH’ is not used. - - The ‘-P’ option means to not follow symbolic links: symbolic links + DIRECTORY. If the shell variable ‘CDPATH’ exists, and DIRECTORY + does not begin with a slash, ‘cd’ uses it as a search path: ‘cd’ + searches each directory name in ‘CDPATH’ for DIRECTORY, with + alternative directory names in ‘CDPATH’ separated by a colon (‘:’). + A null directory name in ‘CDPATH’ means the same thing as the + current directory. + + The ‘-P’ option means not to follow symbolic links: symbolic links are resolved while ‘cd’ is traversing DIRECTORY and before processing an instance of ‘..’ in DIRECTORY. @@ -3426,13 +3427,16 @@ standard. DIRECTORY are resolved after ‘cd’ processes an instance of ‘..’ in DIRECTORY. - If ‘..’ appears in DIRECTORY, it is processed by removing the + If ‘..’ appears in DIRECTORY, ‘cd’ processes it by removing the immediately preceding pathname component, back to a slash or the - beginning of DIRECTORY. + beginning of DIRECTORY, and verifying that the portion of DIRECTORY + it has processed to that point is still a valid directory name + after removing the pathname component. If it is not a valid + directory name, ‘cd’ returns a non-zero status. - If the ‘-e’ option is supplied with ‘-P’ and the current working - directory cannot be successfully determined after a successful - directory change, ‘cd’ will return a non-zero status. + If the ‘-e’ option is supplied with ‘-P’ and ‘cd’ cannot + successfully determine the current working directory after a + successful directory change, it will return a non-zero status. On systems that support it, the ‘-@’ option presents the extended attributes associated with a file as a directory. @@ -5364,9 +5368,9 @@ This builtin allows you to change additional optional shell behavior. completion. ‘noexpand_translation’ - If set, Bash encloses the translated results of $"..." - quoting in single quotes instead of double quotes. If the - string is not translated, this has no effect. + If set, Bash encloses the translated results of $"..." quoting + in single quotes instead of double quotes. If the string is + not translated, this has no effect. ‘nullglob’ If set, filename expansion patterns which match no files @@ -5840,7 +5844,7 @@ Variables::). ‘EPOCHREALTIME’ Each time this parameter is referenced, it expands to the number of - seconds since the Unix Epoch as a floating point value with + seconds since the Unix Epoch as a floating-point value with micro-second granularity (see the documentation for the C library function ‘time’ for the definition of Epoch). Assignments to ‘EPOCHREALTIME’ are ignored. If ‘EPOCHREALTIME’ is unset, it loses @@ -5912,12 +5916,15 @@ Variables::). value of this variable specifies the sort criteria and sort order for the results of filename expansion. If this variable is unset or set to the null string, filename expansion uses the historical - behavior of sorting by name. If set, a valid value begins with an - optional ‘+’, which is ignored, or ‘-’, which reverses the sort - order from ascending to descending, followed by a sort specifier. - The valid sort specifiers are ‘name’, ‘numeric’, ‘size’, ‘mtime’, - ‘atime’, ‘ctime’, and ‘blocks’, which sort the files on name, names - in numeric rather than lexicographic order, file size, modification + behavior of sorting by name, in ascending lexicographic order as + determined by the ‘LC_COLLATE’ shell variable. + + If set, a valid value begins with an optional ‘+’, which is + ignored, or ‘-’, which reverses the sort order from ascending to + descending, followed by a sort specifier. The valid sort + specifiers are ‘name’, ‘numeric’, ‘size’, ‘mtime’, ‘atime’, + ‘ctime’, and ‘blocks’, which sort the files on name, names in + numeric rather than lexicographic order, file size, modification time, access time, inode change time, and number of blocks, respectively. If any of the non-name keys compare as equal (e.g., if two files are the same size), sorting uses the name as a @@ -5927,14 +5934,14 @@ Variables::). order by modification time (newest first). The ‘numeric’ specifier treats names consisting solely of digits as - numbers and sorts them using the numeric value (so "2" will sort + numbers and sorts them using their numeric value (so "2" will sort before "10", for example). When using ‘numeric’, names containing non-digits sort after all the all-digit names and are sorted by name using the traditional behavior. - A sort specifier of ‘nosort’ disables sorting completely; the - results are returned in the order they are read from the file - system, and any leading ‘-’ is ignored. + A sort specifier of ‘nosort’ disables sorting completely; Bash + returns the results in the order they are read from the file + system, ignoring any leading ‘-’. If the sort specifier is missing, it defaults to NAME, so a value of ‘+’ is equivalent to the null string, and a value of ‘-’ sorts @@ -5951,17 +5958,16 @@ Variables::). ‘histchars’ Up to three characters which control history expansion, quick substitution, and tokenization (*note History Interaction::). The - first character is the “history expansion” character, that is, the - character which signifies the start of a history expansion, - normally ‘!’. The second character is the character which - signifies "quick substitution" when seen as the first character on - a line, normally ‘^’. 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, usually ‘#’. - The history comment character causes history substitution to be - skipped for the remaining words on the line. It does not - necessarily cause the shell parser to treat the rest of the line as - a comment. + first character is the “history expansion” character, the character + which begins a history expansion, normally ‘!’. The second + character is the character which signifies "quick substitution" + when seen as the first character on a line, normally ‘^’. 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, usually ‘#’. The history comment character + disables history substitution for the remaining words on the line. + It does not necessarily cause the shell parser to treat the rest of + the line as a comment. ‘HISTCMD’ The history number, or index in the history list, of the current @@ -6577,7 +6583,7 @@ conforming to the POSIX standard as well. When invoked as an interactive login shell, or as a non-interactive shell with the ‘--login’ option, it first attempts to read and execute commands from ‘/etc/profile’ and ‘~/.profile’, in that order. The -‘--noprofile’ option may be used to inhibit this behavior. +‘--noprofile’ option will inhibit this behavior. When invoked as an interactive shell with the name ‘sh’, Bash looks for the variable ‘ENV’, expands its value if it is defined, and uses the @@ -6588,8 +6594,8 @@ other startup files, the ‘--rcfile’ option has no effect. A non-interactive shell invoked with the name ‘sh’ does not attempt to read any other startup files. - When invoked as ‘sh’, Bash enters POSIX mode after the startup files -are read. + When invoked as ‘sh’, Bash enters POSIX mode after reading the +startup files. Invoked in POSIX mode ..................... @@ -6609,10 +6615,10 @@ and rarely-seen remote shell daemon, usually ‘rshd’, or the secure shell daemon ‘sshd’. If Bash determines it is being run non-interactively in this fashion, it reads and executes commands from ‘~/.bashrc’, if that file exists and is readable. It will not do this if invoked as ‘sh’. -The ‘--norc’ option may be used to inhibit this behavior, and the -‘--rcfile’ option will make Bash use a different file instead of -‘~/.bashrc’, but neither ‘rshd’ nor ‘sshd’ generally invoke the shell -with those options or allow them to be specified. +The ‘--norc’ option will inhibit this behavior, and the ‘--rcfile’ +option will make Bash use a different file instead of ‘~/.bashrc’, but +neither ‘rshd’ nor ‘sshd’ generally invoke the shell with those options +or allow them to be specified. Invoked with unequal effective and real UID/GIDs ................................................ @@ -6786,10 +6792,10 @@ numeric, and file attribute comparisons. expressions. If the operating system on which Bash is running provides these special files, Bash will use them; otherwise it will emulate them internally with this behavior: If the FILE argument to one of the -primaries is of the form ‘/dev/fd/N’, then file descriptor N is checked. -If the FILE argument to one of the primaries is one of ‘/dev/stdin’, -‘/dev/stdout’, or ‘/dev/stderr’, file descriptor 0, 1, or 2, -respectively, is checked. +primaries is of the form ‘/dev/fd/N’, then Bash checks file descriptor +N. If the FILE argument to one of the primaries is one of ‘/dev/stdin’, +‘/dev/stdout’, or ‘/dev/stderr’, Bash checks file descriptor 0, 1, or 2, +respectively. When used with ‘[[’, the ‘<’ and ‘>’ operators sort lexicographically using the current locale. The ‘test’ command uses ASCII ordering. @@ -6996,9 +7002,9 @@ levels are listed in order of decreasing precedence. Shell variables are allowed as operands; parameter expansion is performed before the expression is evaluated. Within an expression, shell variables may also be referenced by name without using the -parameter expansion syntax. This means you can use .Q x , where \fIx\fP -is a shell variable name, in an arithmetic expression, and the shell -will evaluate its value as an expression and use the result. A shell +parameter expansion syntax. This means you can use X, where X is a +shell variable name, in an arithmetic expression, and the shell will +evaluate its value as an expression and use the result. A shell variable that is null or unset evaluates to 0 when referenced by name in an expression. @@ -7662,6 +7668,9 @@ startup files. 27. Bash permanently removes jobs from the jobs table after notifying the user of their termination via the ‘wait’ or ‘jobs’ builtins. + It removes the job from the jobs list after notifying the user of + its termination, but the status is still available via ‘wait’, as + long as ‘wait’ is supplied a PID argument. 28. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when the ‘v’ command is run, instead of checking ‘$VISUAL’ and @@ -7854,7 +7863,7 @@ startup files. The trap command is run once for each child that exits. 75. Bash removes an exited background process's status from the list - of such statuses after the ‘wait’ builtin is used to obtain it. + of such statuses after the ‘wait’ builtin returns it. There is other POSIX behavior that Bash does not implement by default even when in POSIX mode. Specifically: @@ -7997,13 +8006,13 @@ required for bash-5.1 and later versions. like ‘a[@]’. Bash-5.2 will unset an element with key ‘@’ (associative arrays) or remove all the elements without unsetting the array (indexed arrays). - • Arithmetic commands ( ((...)) ) and the expressions in an + • Arithmetic commands ( ((...)) ) and the expressions in an arithmetic for statement can be expanded more than once. • Expressions used as arguments to arithmetic operators in the ‘[[’ conditional command can be expanded more than once. • The expressions in substring parameter brace expansion can be expanded more than once. - • The expressions in the $(( ... )) word expansion can be + • The expressions in the $(( ... )) word expansion can be expanded more than once. • Arithmetic expressions used as indexed array subscripts can be expanded more than once. @@ -8141,7 +8150,7 @@ about changes in a job's status so as to not interrupt any other output, though it will notify of changes in a job's status after a foreground command in a list completes, before executing the next command in the list. If the ‘-b’ option to the ‘set’ builtin is enabled, Bash reports -such changes immediately (*note The Set Builtin::). Bash executes any +status changes immediately (*note The Set Builtin::). Bash executes any trap on ‘SIGCHLD’ for each child process that terminates. When a job terminates and Bash notifies the user about it, Bash @@ -8377,27 +8386,26 @@ File: bash.info, Node: Introduction and Notation, Next: Readline Interaction, 8.1 Introduction to Line Editing ================================ -The following paragraphs describe the notation used to represent -keystrokes. +The following paragraphs use Emacs style to describe the notation used +to represent keystrokes. The text ‘C-k’ is read as 'Control-K' and describes the character produced when the key is pressed while the Control key is depressed. The text ‘M-k’ is read as 'Meta-K' and describes the character produced when the Meta key (if you have one) is depressed, and the -key is pressed (a “meta character”). The Meta key is labeled on -many keyboards. On keyboards with two keys labeled (usually to -either side of the space bar), the on the left side is generally -set to work as a Meta key. The key on the right may also be -configured to work as a Meta key or may be configured as some other -modifier, such as a Compose key for typing accented characters. - - On some keyboards, the Meta key modifier produces meta characters -with the eighth bit (0200) set. You can use the ‘enable-meta-key’ -variable to control whether or not it does this, if the keyboard allows -it. On many others, the terminal or terminal emulator converts the -metafied key to a key sequence beginning with as described in the -next paragraph. +key is pressed (a “meta character”), then both are released. The Meta +key is labeled or

The maximum length in characters of the common prefix of a list of possible completions that is displayed without modification. -When set to a value greater than zero, readline +When set to a value greater than zero, Readline replaces common prefixes longer than this value with an ellipsis when displaying possible completions.

@@ -11561,7 +11574,7 @@ sequences containing \M- or Meta-Key Bindings in Readline Init File Syntax) by converting a key sequence of the form \M-C or Meta-C to the two-character sequence -ESCC (adding the meta prefix). +ESC C (adding the meta prefix). If force-meta-prefix is set to ‘off’ (the default), Readline uses the value of the convert-meta variable to determine whether to perform this conversion: @@ -11762,7 +11775,7 @@ The default value is ‘off’.

If set to ‘on’, this alters the default completion behavior when inserting a single match into the line. It’s only active when performing completion in the middle of a word. -If enabled, readline does not insert characters from the completion +If enabled, Readline does not insert characters from the completion that match characters after point in the word being completed, so portions of the word following the cursor are not duplicated. For instance, if this is enabled, attempting completion when the cursor @@ -12232,9 +12245,10 @@ position, and mark refers to a cursor position saved by the set-mark command. The text between the point and mark is referred to as the region. Readline has the concept of an active region: -when the region is active, Readline redisplay uses the -value of the active-region-start-color variable -to denote the region. +when the region is active, +Readline redisplay highlights the region using the +value of the active-region-start-color variable. +The enable-active-region variable turns this on and off. Several commands set the region to active; those are noted below.

    @@ -13022,7 +13036,7 @@ This command is unbound by default.

execute-named-command (M-x)
-

Read a bindable readline command name from the input and execute the +

Read a bindable Readline command name from the input and execute the function to which it’s bound, as if the key sequence to which it was bound appeared in the input. If this function is supplied with a numeric argument, it passes that @@ -13144,7 +13158,7 @@ Next:

Programmable Completion Builtins), -\fBreadline\fP invokes the programmable completion facilities. +Readline invokes the programmable completion facilities.

First, Bash identifies the command name. If a compspec has been defined for that command, the @@ -13658,7 +13672,7 @@ the -E option indicates that other supplied options apply to “empty” command completion; and the -I option indicates that other supplied options should apply to completion on the initial word on the line. -These are determined in the same way as the \fBcomplete\fP builtin. +These are determined in the same way as the complete builtin.

If multiple options are supplied, the -D option takes precedence over -E, and both take precedence over -I @@ -14629,7 +14643,7 @@ You may need to supply the --srcdir=PATH argument to tell configure where the source files are. configure automatically checks for the -source code in the directory that configure is in and in ‘..’. +source code in the directory that configure is in and in ...

If you have to use a make that does not support the VPATH variable, you can compile Bash for one architecture at a diff --git a/doc/bashref.info b/doc/bashref.info index 46b95083..b144b486 100644 --- a/doc/bashref.info +++ b/doc/bashref.info @@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 7.1 from bashref.texi. This text is a brief description of the features that are present in the -Bash shell (version 5.3, 14 October 2024). +Bash shell (version 5.3, 15 October 2024). - This is Edition 5.3, last updated 14 October 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 15 October 2024, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Copyright © 1988-2024 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, 14 October 2024). The Bash home page is +Bash shell (version 5.3, 15 October 2024). The Bash home page is . - This is Edition 5.3, last updated 14 October 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 15 October 2024, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Bash contains features that appear in other popular shells, and some @@ -2620,7 +2620,7 @@ set of filenames that are tested: when ‘dotglob’ is enabled, the set of filenames includes all files beginning with ‘.’, but the filenames ‘.’ and ‘..’ must be matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not include any filenames -beginning with "." unless the pattern or sub-pattern begins with a ‘.’. +beginning with ‘.’ unless the pattern or sub-pattern begins with a ‘.’. If the ‘globskipdots’ shell option is enabled, the filenames ‘.’ and ‘..’ never appear in the set. As above, ‘.’ only has a special meaning when matching filenames. @@ -2674,7 +2674,7 @@ redirection refers to the standard input (file descriptor 0). If the first character of the redirection operator is ‘>’, the redirection refers to the standard output (file descriptor 1). - The \fIword\fP following the redirection operator in the following + The WORD following the redirection operator in the following descriptions, unless otherwise noted, is subjected to brace expansion, tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, quote removal, filename expansion, and word @@ -3408,18 +3408,19 @@ standard. greater than or equal to 1. ‘cd’ - cd [-L|[-P [-e]]] [-@] [DIRECTORY] + cd [-L] [-@] [DIRECTORY] + cd -P [-e] [-@] [DIRECTORY] Change the current working directory to DIRECTORY. If DIRECTORY is not supplied, the value of the ‘HOME’ shell variable is used as - DIRECTORY. If the shell variable ‘CDPATH’ exists, ‘cd’ uses it as - a search path: ‘cd’ searches each directory name in ‘CDPATH’ for - DIRECTORY, with alternative directory names in ‘CDPATH’ separated - by a colon (‘:’). A null directory name in ‘CDPATH’ means the same - thing as the current directory. If DIRECTORY begins with a slash, - ‘CDPATH’ is not used. - - The ‘-P’ option means to not follow symbolic links: symbolic links + DIRECTORY. If the shell variable ‘CDPATH’ exists, and DIRECTORY + does not begin with a slash, ‘cd’ uses it as a search path: ‘cd’ + searches each directory name in ‘CDPATH’ for DIRECTORY, with + alternative directory names in ‘CDPATH’ separated by a colon (‘:’). + A null directory name in ‘CDPATH’ means the same thing as the + current directory. + + The ‘-P’ option means not to follow symbolic links: symbolic links are resolved while ‘cd’ is traversing DIRECTORY and before processing an instance of ‘..’ in DIRECTORY. @@ -3427,13 +3428,16 @@ standard. DIRECTORY are resolved after ‘cd’ processes an instance of ‘..’ in DIRECTORY. - If ‘..’ appears in DIRECTORY, it is processed by removing the + If ‘..’ appears in DIRECTORY, ‘cd’ processes it by removing the immediately preceding pathname component, back to a slash or the - beginning of DIRECTORY. + beginning of DIRECTORY, and verifying that the portion of DIRECTORY + it has processed to that point is still a valid directory name + after removing the pathname component. If it is not a valid + directory name, ‘cd’ returns a non-zero status. - If the ‘-e’ option is supplied with ‘-P’ and the current working - directory cannot be successfully determined after a successful - directory change, ‘cd’ will return a non-zero status. + If the ‘-e’ option is supplied with ‘-P’ and ‘cd’ cannot + successfully determine the current working directory after a + successful directory change, it will return a non-zero status. On systems that support it, the ‘-@’ option presents the extended attributes associated with a file as a directory. @@ -5365,9 +5369,9 @@ This builtin allows you to change additional optional shell behavior. completion. ‘noexpand_translation’ - If set, Bash encloses the translated results of $"..." - quoting in single quotes instead of double quotes. If the - string is not translated, this has no effect. + If set, Bash encloses the translated results of $"..." quoting + in single quotes instead of double quotes. If the string is + not translated, this has no effect. ‘nullglob’ If set, filename expansion patterns which match no files @@ -5841,7 +5845,7 @@ Variables::). ‘EPOCHREALTIME’ Each time this parameter is referenced, it expands to the number of - seconds since the Unix Epoch as a floating point value with + seconds since the Unix Epoch as a floating-point value with micro-second granularity (see the documentation for the C library function ‘time’ for the definition of Epoch). Assignments to ‘EPOCHREALTIME’ are ignored. If ‘EPOCHREALTIME’ is unset, it loses @@ -5913,12 +5917,15 @@ Variables::). value of this variable specifies the sort criteria and sort order for the results of filename expansion. If this variable is unset or set to the null string, filename expansion uses the historical - behavior of sorting by name. If set, a valid value begins with an - optional ‘+’, which is ignored, or ‘-’, which reverses the sort - order from ascending to descending, followed by a sort specifier. - The valid sort specifiers are ‘name’, ‘numeric’, ‘size’, ‘mtime’, - ‘atime’, ‘ctime’, and ‘blocks’, which sort the files on name, names - in numeric rather than lexicographic order, file size, modification + behavior of sorting by name, in ascending lexicographic order as + determined by the ‘LC_COLLATE’ shell variable. + + If set, a valid value begins with an optional ‘+’, which is + ignored, or ‘-’, which reverses the sort order from ascending to + descending, followed by a sort specifier. The valid sort + specifiers are ‘name’, ‘numeric’, ‘size’, ‘mtime’, ‘atime’, + ‘ctime’, and ‘blocks’, which sort the files on name, names in + numeric rather than lexicographic order, file size, modification time, access time, inode change time, and number of blocks, respectively. If any of the non-name keys compare as equal (e.g., if two files are the same size), sorting uses the name as a @@ -5928,14 +5935,14 @@ Variables::). order by modification time (newest first). The ‘numeric’ specifier treats names consisting solely of digits as - numbers and sorts them using the numeric value (so "2" will sort + numbers and sorts them using their numeric value (so "2" will sort before "10", for example). When using ‘numeric’, names containing non-digits sort after all the all-digit names and are sorted by name using the traditional behavior. - A sort specifier of ‘nosort’ disables sorting completely; the - results are returned in the order they are read from the file - system, and any leading ‘-’ is ignored. + A sort specifier of ‘nosort’ disables sorting completely; Bash + returns the results in the order they are read from the file + system, ignoring any leading ‘-’. If the sort specifier is missing, it defaults to NAME, so a value of ‘+’ is equivalent to the null string, and a value of ‘-’ sorts @@ -5952,17 +5959,16 @@ Variables::). ‘histchars’ Up to three characters which control history expansion, quick substitution, and tokenization (*note History Interaction::). The - first character is the “history expansion” character, that is, the - character which signifies the start of a history expansion, - normally ‘!’. The second character is the character which - signifies "quick substitution" when seen as the first character on - a line, normally ‘^’. 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, usually ‘#’. - The history comment character causes history substitution to be - skipped for the remaining words on the line. It does not - necessarily cause the shell parser to treat the rest of the line as - a comment. + first character is the “history expansion” character, the character + which begins a history expansion, normally ‘!’. The second + character is the character which signifies "quick substitution" + when seen as the first character on a line, normally ‘^’. 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, usually ‘#’. The history comment character + disables history substitution for the remaining words on the line. + It does not necessarily cause the shell parser to treat the rest of + the line as a comment. ‘HISTCMD’ The history number, or index in the history list, of the current @@ -6578,7 +6584,7 @@ conforming to the POSIX standard as well. When invoked as an interactive login shell, or as a non-interactive shell with the ‘--login’ option, it first attempts to read and execute commands from ‘/etc/profile’ and ‘~/.profile’, in that order. The -‘--noprofile’ option may be used to inhibit this behavior. +‘--noprofile’ option will inhibit this behavior. When invoked as an interactive shell with the name ‘sh’, Bash looks for the variable ‘ENV’, expands its value if it is defined, and uses the @@ -6589,8 +6595,8 @@ other startup files, the ‘--rcfile’ option has no effect. A non-interactive shell invoked with the name ‘sh’ does not attempt to read any other startup files. - When invoked as ‘sh’, Bash enters POSIX mode after the startup files -are read. + When invoked as ‘sh’, Bash enters POSIX mode after reading the +startup files. Invoked in POSIX mode ..................... @@ -6610,10 +6616,10 @@ and rarely-seen remote shell daemon, usually ‘rshd’, or the secure shell daemon ‘sshd’. If Bash determines it is being run non-interactively in this fashion, it reads and executes commands from ‘~/.bashrc’, if that file exists and is readable. It will not do this if invoked as ‘sh’. -The ‘--norc’ option may be used to inhibit this behavior, and the -‘--rcfile’ option will make Bash use a different file instead of -‘~/.bashrc’, but neither ‘rshd’ nor ‘sshd’ generally invoke the shell -with those options or allow them to be specified. +The ‘--norc’ option will inhibit this behavior, and the ‘--rcfile’ +option will make Bash use a different file instead of ‘~/.bashrc’, but +neither ‘rshd’ nor ‘sshd’ generally invoke the shell with those options +or allow them to be specified. Invoked with unequal effective and real UID/GIDs ................................................ @@ -6787,10 +6793,10 @@ numeric, and file attribute comparisons. expressions. If the operating system on which Bash is running provides these special files, Bash will use them; otherwise it will emulate them internally with this behavior: If the FILE argument to one of the -primaries is of the form ‘/dev/fd/N’, then file descriptor N is checked. -If the FILE argument to one of the primaries is one of ‘/dev/stdin’, -‘/dev/stdout’, or ‘/dev/stderr’, file descriptor 0, 1, or 2, -respectively, is checked. +primaries is of the form ‘/dev/fd/N’, then Bash checks file descriptor +N. If the FILE argument to one of the primaries is one of ‘/dev/stdin’, +‘/dev/stdout’, or ‘/dev/stderr’, Bash checks file descriptor 0, 1, or 2, +respectively. When used with ‘[[’, the ‘<’ and ‘>’ operators sort lexicographically using the current locale. The ‘test’ command uses ASCII ordering. @@ -6997,9 +7003,9 @@ levels are listed in order of decreasing precedence. Shell variables are allowed as operands; parameter expansion is performed before the expression is evaluated. Within an expression, shell variables may also be referenced by name without using the -parameter expansion syntax. This means you can use .Q x , where \fIx\fP -is a shell variable name, in an arithmetic expression, and the shell -will evaluate its value as an expression and use the result. A shell +parameter expansion syntax. This means you can use X, where X is a +shell variable name, in an arithmetic expression, and the shell will +evaluate its value as an expression and use the result. A shell variable that is null or unset evaluates to 0 when referenced by name in an expression. @@ -7663,6 +7669,9 @@ startup files. 27. Bash permanently removes jobs from the jobs table after notifying the user of their termination via the ‘wait’ or ‘jobs’ builtins. + It removes the job from the jobs list after notifying the user of + its termination, but the status is still available via ‘wait’, as + long as ‘wait’ is supplied a PID argument. 28. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when the ‘v’ command is run, instead of checking ‘$VISUAL’ and @@ -7855,7 +7864,7 @@ startup files. The trap command is run once for each child that exits. 75. Bash removes an exited background process's status from the list - of such statuses after the ‘wait’ builtin is used to obtain it. + of such statuses after the ‘wait’ builtin returns it. There is other POSIX behavior that Bash does not implement by default even when in POSIX mode. Specifically: @@ -7998,13 +8007,13 @@ required for bash-5.1 and later versions. like ‘a[@]’. Bash-5.2 will unset an element with key ‘@’ (associative arrays) or remove all the elements without unsetting the array (indexed arrays). - • Arithmetic commands ( ((...)) ) and the expressions in an + • Arithmetic commands ( ((...)) ) and the expressions in an arithmetic for statement can be expanded more than once. • Expressions used as arguments to arithmetic operators in the ‘[[’ conditional command can be expanded more than once. • The expressions in substring parameter brace expansion can be expanded more than once. - • The expressions in the $(( ... )) word expansion can be + • The expressions in the $(( ... )) word expansion can be expanded more than once. • Arithmetic expressions used as indexed array subscripts can be expanded more than once. @@ -8142,7 +8151,7 @@ about changes in a job's status so as to not interrupt any other output, though it will notify of changes in a job's status after a foreground command in a list completes, before executing the next command in the list. If the ‘-b’ option to the ‘set’ builtin is enabled, Bash reports -such changes immediately (*note The Set Builtin::). Bash executes any +status changes immediately (*note The Set Builtin::). Bash executes any trap on ‘SIGCHLD’ for each child process that terminates. When a job terminates and Bash notifies the user about it, Bash @@ -8378,27 +8387,26 @@ File: bashref.info, Node: Introduction and Notation, Next: Readline Interactio 8.1 Introduction to Line Editing ================================ -The following paragraphs describe the notation used to represent -keystrokes. +The following paragraphs use Emacs style to describe the notation used +to represent keystrokes. The text ‘C-k’ is read as 'Control-K' and describes the character produced when the key is pressed while the Control key is depressed. The text ‘M-k’ is read as 'Meta-K' and describes the character produced when the Meta key (if you have one) is depressed, and the -key is pressed (a “meta character”). The Meta key is labeled on -many keyboards. On keyboards with two keys labeled (usually to -either side of the space bar), the on the left side is generally -set to work as a Meta key. The key on the right may also be -configured to work as a Meta key or may be configured as some other -modifier, such as a Compose key for typing accented characters. - - On some keyboards, the Meta key modifier produces meta characters -with the eighth bit (0200) set. You can use the ‘enable-meta-key’ -variable to control whether or not it does this, if the keyboard allows -it. On many others, the terminal or terminal emulator converts the -metafied key to a key sequence beginning with as described in the -next paragraph. +key is pressed (a “meta character”), then both are released. The Meta +key is labeled or

-The following paragraphs describe the notation used to represent -keystrokes. +The following paragraphs use Emacs style to +describe the notation used to represent keystrokes.

The text C-k is read as `Control-K' and describes the character @@ -110,17 +110,17 @@ is depressed. The text M-k is read as `Meta-K' and describes the character produced when the Meta key (if you have one) is depressed, and the k -key is pressed (a meta character). -The Meta key is labeled ALT on many keyboards. +key is pressed (a meta character), then both are released. +The Meta key is labeled ALT or Option on many keyboards. On keyboards with two keys labeled ALT (usually to either side of the space bar), the ALT on the left side is generally set to work as a Meta key. -The ALT key on the right may also be configured to work as a -Meta key or may be configured as some other modifier, such as a +One of the ALT keys may also be configured +as some other modifier, such as a Compose key for typing accented characters.

-On some keyboards, the Meta key modifier produces meta characters with +On some keyboards, the Meta key modifier produces characters with the eighth bit (0200) set. You can use the enable-meta-key variable to control whether or not it does this, if the keyboard allows it. @@ -528,7 +528,7 @@ commands in an inputrc file, conventionally in their home directory. The name of this file is taken from the value of the environment variable INPUTRC. If that variable is unset, the default is `~/.inputrc'. -If that file does not exist or cannot be read, readline looks for +If that file does not exist or cannot be read, Readline looks for `/etc/inputrc'.

@@ -672,7 +672,7 @@ common prefix of the set of possible completions using a different color. The color definitions are taken from the value of the LS_COLORS environment variable. If there is a color definition in LS_COLORS for the custom suffix -`readline-colored-completion-prefix', Readline uses this color for +`.readline-colored-completion-prefix', Readline uses this color for the common prefix instead of its default. The default is `off'.

@@ -723,7 +723,7 @@ The default value is `off'. The maximum length in characters of the common prefix of a list of possible completions that is displayed without modification. -When set to a value greater than zero, readline +When set to a value greater than zero, Readline replaces common prefixes longer than this value with an ellipsis when displaying possible completions.

@@ -856,7 +856,7 @@ sequences containing \M- or Meta- (see Key Bindings in 1.3.1 Readline Init File Syntax) by converting a key sequence of the form \M-C or Meta-C to the two-character sequence -ESCC (adding the meta prefix). +ESC C (adding the meta prefix). If force-meta-prefix is set to `off' (the default), Readline uses the value of the convert-meta variable to determine whether to perform this conversion: @@ -1074,7 +1074,7 @@ The default value is `off'. If set to `on', this alters the default completion behavior when inserting a single match into the line. It's only active when performing completion in the middle of a word. -If enabled, readline does not insert characters from the completion +If enabled, Readline does not insert characters from the completion that match characters after point in the word being completed, so portions of the word following the cursor are not duplicated. For instance, if this is enabled, attempting completion when the cursor @@ -1171,7 +1171,7 @@ This key binding syntax recognizes a number of symbolic character names: NEWLINE, RET, RETURN, -RUBOUT, +RUBOUT (a destructive backspace), SPACE, SPC, and @@ -1562,9 +1562,10 @@ position, and mark refers to a cursor position saved by the set-mark command. The text between the point and mark is referred to as the region. Readline has the concept of an active region: -when the region is active, Readline redisplay uses the -value of the active-region-start-color variable -to denote the region. +when the region is active, +Readline redisplay highlights the region using the +value of the active-region-start-color variable. +The enable-active-region variable turns this on and off. Several commands set the region to active; those are noted below.

@@ -1896,6 +1897,7 @@ Delete the character at point. If this function is bound to the same character as the tty EOF character, as C-d commonly is, see above for the effects. +This may also be bound to the Delete key on some keyboards.

@@ -2486,7 +2488,7 @@ This command is unbound by default.

execute-named-command (M-x)
-Read a bindable readline command name from the input and execute the +Read a bindable Readline command name from the input and execute the function to which it's bound, as if the key sequence to which it was bound appeared in the input. If this function is supplied with a numeric argument, it passes that @@ -2649,8 +2651,8 @@ Since it's possible to enter characters into the line while quoting them to disable any Readline editing function they might normally have, this line may include embedded newlines and other special characters. If prompt is NULL or the empty string, -readline does not display a prompt. -The line readline returns is allocated with malloc(); +readline() does not display a prompt. +The line readline() returns is allocated with malloc(); the caller should free() the line when it has finished with it. The declaration for readline in ANSI C is

@@ -2666,9 +2668,9 @@ text remains. This means that lines consisting of a newline return the empty string.

-If readline encounters an EOF while reading the line, +If Readline encounters an EOF while reading the line, and the line is empty at that point, -then readline returns (char *)NULL. +then readline() returns (char *)NULL. Otherwise, the line is ended just as if a newline had been typed.

@@ -3201,7 +3203,7 @@ twice in succession, for example.

Variable: rl_hook_func_t * rl_startup_hook
If non-zero, this is the address of a function to call just -before readline prints the first prompt. +before Readline prints the first prompt.

@@ -3209,7 +3211,7 @@ before readline prints the first prompt.

Variable: rl_hook_func_t * rl_pre_input_hook
If non-zero, this is the address of a function to call after -the first prompt has been printed and just before readline +the first prompt has been printed and just before Readline starts reading input characters.

@@ -3415,7 +3417,7 @@ macro.

RL_STATE_COMPLETING
Readline is performing word completion.
RL_STATE_SIGHANDLER -
Readline is currently executing the readline signal handler. +
Readline is currently executing the Readline signal handler.
RL_STATE_UNDOING
Readline is performing an undo.
RL_STATE_INPUTPENDING @@ -8127,7 +8129,7 @@ to permit their use in free software. [ ? ]

About this document

-This document was generated by Chet Ramey on October, 11 2024 +This document was generated by Chet Ramey on October, 18 2024 using texi2html

@@ -8289,7 +8291,7 @@ the following structure:
This document was generated -by Chet Ramey on October, 11 2024 +by Chet Ramey on October, 18 2024 using texi2html diff --git a/lib/readline/doc/readline.info b/lib/readline/doc/readline.info index f0a4f867..4dd9282f 100644 --- a/lib/readline/doc/readline.info +++ b/lib/readline/doc/readline.info @@ -1,6 +1,6 @@ This is readline.info, produced by makeinfo version 7.1 from rlman.texi. -This manual describes the GNU Readline Library (version 8.3, 10 October +This manual describes the GNU Readline Library (version 8.3, 15 October 2024), a library which aids in the consistency of user interface across discrete programs which provide a command line interface. @@ -63,27 +63,26 @@ File: readline.info, Node: Introduction and Notation, Next: Readline Interacti 1.1 Introduction to Line Editing ================================ -The following paragraphs describe the notation used to represent -keystrokes. +The following paragraphs use Emacs style to describe the notation used +to represent keystrokes. The text ‘C-k’ is read as 'Control-K' and describes the character produced when the key is pressed while the Control key is depressed. The text ‘M-k’ is read as 'Meta-K' and describes the character produced when the Meta key (if you have one) is depressed, and the -key is pressed (a “meta character”). The Meta key is labeled on -many keyboards. On keyboards with two keys labeled (usually to -either side of the space bar), the on the left side is generally -set to work as a Meta key. The key on the right may also be -configured to work as a Meta key or may be configured as some other -modifier, such as a Compose key for typing accented characters. - - On some keyboards, the Meta key modifier produces meta characters -with the eighth bit (0200) set. You can use the ‘enable-meta-key’ -variable to control whether or not it does this, if the keyboard allows -it. On many others, the terminal or terminal emulator converts the -metafied key to a key sequence beginning with as described in the -next paragraph. +key is pressed (a “meta character”), then both are released. The Meta +key is labeled or
execute-named-command (M-x)
-Read a bindable readline command name from the input and execute the +Read a bindable Readline command name from the input and execute the function to which it's bound, as if the key sequence to which it was bound appeared in the input. If this function is supplied with a numeric argument, it passes that @@ -3226,7 +3228,7 @@ to permit their use in free software. [ ? ]

About this document

-This document was generated by Chet Ramey on October, 11 2024 +This document was generated by Chet Ramey on October, 18 2024 using texi2html

@@ -3388,7 +3390,7 @@ the following structure:
This document was generated -by Chet Ramey on October, 11 2024 +by Chet Ramey on October, 18 2024 using texi2html diff --git a/lib/readline/doc/rluserman.info b/lib/readline/doc/rluserman.info index 1367b2be..4348ee09 100644 --- a/lib/readline/doc/rluserman.info +++ b/lib/readline/doc/rluserman.info @@ -2,7 +2,7 @@ This is rluserman.info, produced by makeinfo version 7.1 from rluserman.texi. This manual describes the end user interface of the GNU Readline Library -(version 8.3, 10 October 2024), a library which aids in the consistency +(version 8.3, 15 October 2024), a library which aids in the consistency of user interface across discrete programs which provide a command line interface. @@ -61,27 +61,26 @@ File: rluserman.info, Node: Introduction and Notation, Next: Readline Interact 1.1 Introduction to Line Editing ================================ -The following paragraphs describe the notation used to represent -keystrokes. +The following paragraphs use Emacs style to describe the notation used +to represent keystrokes. The text ‘C-k’ is read as 'Control-K' and describes the character produced when the key is pressed while the Control key is depressed. The text ‘M-k’ is read as 'Meta-K' and describes the character produced when the Meta key (if you have one) is depressed, and the -key is pressed (a “meta character”). The Meta key is labeled on -many keyboards. On keyboards with two keys labeled (usually to -either side of the space bar), the on the left side is generally -set to work as a Meta key. The key on the right may also be -configured to work as a Meta key or may be configured as some other -modifier, such as a Compose key for typing accented characters. - - On some keyboards, the Meta key modifier produces meta characters -with the eighth bit (0200) set. You can use the ‘enable-meta-key’ -variable to control whether or not it does this, if the keyboard allows -it. On many others, the terminal or terminal emulator converts the -metafied key to a key sequence beginning with as described in the -next paragraph. +key is pressed (a “meta character”), then both are released. The Meta +key is labeled or