From: Chet Ramey Date: Tue, 2 Jan 2024 15:42:34 +0000 (-0500) Subject: fix for dequoting words in pretty-print mode; posix mode changes for readonly/export... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa0b002927c2897f80da762dd4196d688a46a3ab;p=thirdparty%2Fbash.git fix for dequoting words in pretty-print mode; posix mode changes for readonly/export invalid identifier errors --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index e5fe08992..c32d4ba31 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -8203,3 +8203,35 @@ parse.y - decode_prompt_string: use save_lastarg() and bind_lastarg() to preserve the value of $_ across prompt string decoding. Patch from Grisha Levit + + 12/21 + ----- +lib/readline/doc/readline.3 + - updates to some vi-mode bindings + Patch from Josh Brobst + +builtins/setattr.def + - set_or_show_attributes: in posix mode, supplying an argument that is + not an identifier when not acting on functions is a utility error. + This will cause a non-interactive shell to exit + + 12/27 + ----- +print_cmd.c + - command_print_word_list,print_select_command_head,print_case_command_head, + print_function_def: if we're in pretty-print mode, dequote words + before printing them + Report from Seth Sabar + +shell.c + - execute_profile_file,execute_bashrc_file: separate the (duplicated) + code that sources the various profile and bashrc files out into + separate functions + - find_bashrc_file: new function, returns the name of the interactive + shell startup file that should be executed if --rcfile (--init-file) + is not supplied; currently returns DEFAULT_BASHRC + - bashrc_file: default to NULL, making it just the filename supplied as + an argument to --rcfile/--init-file + - execute_bashrc_file: execute whatever find_bashrc_file() returns + if bashrc_file is NULL + From a patch from Allison Karlitskaya diff --git a/MANIFEST b/MANIFEST index 81ef50989..164b1b75e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1145,6 +1145,7 @@ tests/errors7.sub f tests/errors8.sub f tests/errors9.sub f tests/errors10.sub f +tests/errors11.sub f tests/execscript f tests/exec.right f tests/exec1.sub f 755 diff --git a/POSIX b/POSIX index 528300ef2..1714a4f2e 100644 --- a/POSIX +++ b/POSIX @@ -223,114 +223,119 @@ The following list is what's changed when 'POSIX mode' is in effect: 42. The 'export' and 'readonly' builtin commands display their output in the format required by POSIX. - 43. The 'trap' builtin displays signal names without the leading + 43. If the 'export' and 'readonly' builtin commands get an argument + that is not a valid identifier, and they are not operating on shell + functions, they return an error. This will cause a non-interactive + shell to exit because these are special builtins. + + 44. The 'trap' builtin displays signal names without the leading 'SIG'. - 44. The 'trap' builtin doesn't check the first argument for a possible + 45. 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. - 45. 'trap -p' without arguments displays signals whose dispositions + 46. '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. - 46. The '.' and 'source' builtins do not search the current directory + 47. The '.' and 'source' builtins do not search the current directory for the filename argument if it is not found by searching 'PATH'. - 47. Enabling POSIX mode has the effect of setting the + 48. 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. - 48. Enabling POSIX mode has the effect of setting the 'shift_verbose' + 49. 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. - 49. When the 'alias' builtin displays alias definitions, it does not + 50. When the 'alias' builtin displays alias definitions, it does not display them with a leading 'alias ' unless the '-p' option is supplied. - 50. When the 'set' builtin is invoked without options, it does not + 51. When the 'set' builtin is invoked without options, it does not display shell function names and definitions. - 51. When the 'set' builtin is invoked without options, it displays + 52. 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. - 52. When the 'cd' builtin is invoked in logical mode, and the pathname + 53. 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. - 53. When the 'cd' builtin cannot change a directory because the length + 54. 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 all symbolic links are expanded, 'cd' will fail instead of attempting to use only the supplied directory name. - 54. The 'pwd' builtin verifies that the value it prints is the same as + 55. 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. - 55. When listing the history, the 'fc' builtin does not include an + 56. When listing the history, the 'fc' builtin does not include an indication of whether or not a history entry has been modified. - 56. The default editor used by 'fc' is 'ed'. + 57. The default editor used by 'fc' is 'ed'. - 57. If there are too many arguments supplied to 'fc -s', 'fc' prints + 58. If there are too many arguments supplied to 'fc -s', 'fc' prints an error message and returns failure. - 58. The 'type' and 'command' builtins will not report a non-executable + 59. 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'. - 59. The 'vi' editing mode will invoke the 'vi' editor directly when + 60. The 'vi' editing mode will invoke the 'vi' editor directly when the 'v' command is run, instead of checking '$VISUAL' and '$EDITOR'. - 60. When the 'xpg_echo' option is enabled, Bash does not attempt to + 61. 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. - 61. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' + 62. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' and '-f' options. - 62. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not + 63. 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. - 63. The 'read' builtin may be interrupted by a signal for which a trap + 64. 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. - 64. The 'printf' builtin uses 'double' (via 'strtod') to convert + 65. 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. - 65. Bash removes an exited background process's status from the list + 66. Bash removes an exited background process's status from the list of such statuses after the 'wait' builtin is used to obtain it. - 66. A double quote character ('"') is treated specially when it + 67. 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. - 67. The 'test' builtin compares strings using the current locale when + 68. The 'test' builtin compares strings using the current locale when processing the '<' and '>' binary operators. - 68. The 'test' builtin's '-t' unary primary requires an argument. + 69. 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. - 69. Command substitutions don't set the '?' special parameter. The + 70. 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 diff --git a/builtins/complete.def b/builtins/complete.def index dfd04c30f..236cd42c9 100644 --- a/builtins/complete.def +++ b/builtins/complete.def @@ -27,8 +27,8 @@ $SHORT_DOC complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G glo Specify how arguments are to be completed by Readline. For each NAME, specify how arguments are to be completed. If no options -are supplied, existing completion specifications are printed in a way that -allows them to be reused as input. +or NAMEs are supplied, display existing completion specifications in a way +that allows them to be reused as input. Options: -p print existing completion specifications in a reusable format diff --git a/builtins/setattr.def b/builtins/setattr.def index 9d74f5116..146b2e0d7 100644 --- a/builtins/setattr.def +++ b/builtins/setattr.def @@ -121,7 +121,7 @@ int set_or_show_attributes (WORD_LIST *list, int attribute, int nodefs) { register SHELL_VAR *var; - int assign, undo, any_failed, assign_error, opt; + int assign, undo, any_failed, assign_error, util_error, opt, retval; int functions_only, arrays_only, assoc_only; int aflags; char *name; @@ -133,7 +133,9 @@ set_or_show_attributes (WORD_LIST *list, int attribute, int nodefs) #endif functions_only = arrays_only = assoc_only = 0; - undo = any_failed = assign_error = 0; + undo = any_failed = assign_error = util_error = 0; + retval = EXECUTION_SUCCESS; + /* Read arguments from the front of the list. */ reset_internal_getopt (); while ((opt = internal_getopt (list, ATTROPTS)) != -1) @@ -216,6 +218,11 @@ set_or_show_attributes (WORD_LIST *list, int attribute, int nodefs) sh_invalidid (name); if (assign) assign_error++; + else if (posixly_correct) + { + util_error++; + break; /* exit immediately on bad identifier */ + } else any_failed++; list = list->next; @@ -338,9 +345,15 @@ set_or_show_attributes (WORD_LIST *list, int attribute, int nodefs) } } - return (assign_error ? EX_BADASSIGN - : ((any_failed == 0) ? EXECUTION_SUCCESS - : EXECUTION_FAILURE)); + /* various failure modes */ + if (assign_error) + retval = EX_BADASSIGN; + else if (util_error) /* only posix mode sets this */ + retval = EX_UTILERROR; + else if (any_failed) + retval = EXECUTION_FAILURE; + + return (retval); } /* Show all variable variables (v == 1) or functions (v == 0) with diff --git a/doc/bash.0 b/doc/bash.0 index b1f52929d..3bf169ce6 100644 --- a/doc/bash.0 +++ b/doc/bash.0 @@ -6620,9 +6620,9 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM-- PPAATT. - Bash-5.0 is the final version for which there will be an individual - shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on - bash-5.0 and later versions. + Bash-5.0 was the final version for which there will be an individual + shopt option for the previous version. Users should control the compat- + ibility level with BBAASSHH__CCOOMMPPAATT. The following table describes the behavior changes controlled by each compatibility level setting. The ccoommppaatt_N_N tag is used as shorthand for diff --git a/doc/bash.1 b/doc/bash.1 index c4603de13..6e60f7a9c 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -8275,7 +8275,8 @@ matches were generated. \fBcomplete\fP \fB\-pr\fP [\fB\-DEI\fP] [\fIname\fP ...] .PD Specify how arguments to each \fIname\fP should be completed. -If the \fB\-p\fP option is supplied, or if no options are supplied, +If the \fB\-p\fP option is supplied, or if no options or \fIname\fPs +are supplied, existing completion specifications are printed in a way that allows them to be reused as input. The \fB\-r\fP option removes a completion specification for @@ -11688,11 +11689,11 @@ Eventually, the options will be removed in favor of .SM .BR BASH_COMPAT . .PP -Bash-5.0 is the final version for which there will be an individual shopt -option for the previous version. Users should use +Bash-5.0 was the final version for which there will be an individual shopt +option for the previous version. Users should control the compatibility +level with .SM -.B BASH_COMPAT -on bash-5.0 and later versions. +.BR BASH_COMPAT . .PP The following table describes the behavior changes controlled by each compatibility level setting. diff --git a/doc/bash.info b/doc/bash.info index a87b08766..e0a504281 100644 --- a/doc/bash.info +++ b/doc/bash.info @@ -7469,114 +7469,119 @@ startup files. 42. The 'export' and 'readonly' builtin commands display their output in the format required by POSIX. - 43. The 'trap' builtin displays signal names without the leading + 43. If the 'export' and 'readonly' builtin commands get an argument + that is not a valid identifier, and they are not operating on shell + functions, they return an error. This will cause a non-interactive + shell to exit because these are special builtins. + + 44. The 'trap' builtin displays signal names without the leading 'SIG'. - 44. The 'trap' builtin doesn't check the first argument for a possible + 45. 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. - 45. 'trap -p' without arguments displays signals whose dispositions + 46. '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. - 46. The '.' and 'source' builtins do not search the current directory + 47. The '.' and 'source' builtins do not search the current directory for the filename argument if it is not found by searching 'PATH'. - 47. Enabling POSIX mode has the effect of setting the + 48. 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. - 48. Enabling POSIX mode has the effect of setting the 'shift_verbose' + 49. 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. - 49. When the 'alias' builtin displays alias definitions, it does not + 50. When the 'alias' builtin displays alias definitions, it does not display them with a leading 'alias ' unless the '-p' option is supplied. - 50. When the 'set' builtin is invoked without options, it does not + 51. When the 'set' builtin is invoked without options, it does not display shell function names and definitions. - 51. When the 'set' builtin is invoked without options, it displays + 52. 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. - 52. When the 'cd' builtin is invoked in logical mode, and the pathname + 53. 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. - 53. When the 'cd' builtin cannot change a directory because the length + 54. 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 all symbolic links are expanded, 'cd' will fail instead of attempting to use only the supplied directory name. - 54. The 'pwd' builtin verifies that the value it prints is the same as + 55. 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. - 55. When listing the history, the 'fc' builtin does not include an + 56. When listing the history, the 'fc' builtin does not include an indication of whether or not a history entry has been modified. - 56. The default editor used by 'fc' is 'ed'. + 57. The default editor used by 'fc' is 'ed'. - 57. If there are too many arguments supplied to 'fc -s', 'fc' prints + 58. If there are too many arguments supplied to 'fc -s', 'fc' prints an error message and returns failure. - 58. The 'type' and 'command' builtins will not report a non-executable + 59. 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'. - 59. The 'vi' editing mode will invoke the 'vi' editor directly when + 60. The 'vi' editing mode will invoke the 'vi' editor directly when the 'v' command is run, instead of checking '$VISUAL' and '$EDITOR'. - 60. When the 'xpg_echo' option is enabled, Bash does not attempt to + 61. 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. - 61. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' + 62. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' and '-f' options. - 62. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not + 63. 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. - 63. The 'read' builtin may be interrupted by a signal for which a trap + 64. 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. - 64. The 'printf' builtin uses 'double' (via 'strtod') to convert + 65. 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. - 65. Bash removes an exited background process's status from the list + 66. Bash removes an exited background process's status from the list of such statuses after the 'wait' builtin is used to obtain it. - 66. A double quote character ('"') is treated specially when it + 67. 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. - 67. The 'test' builtin compares strings using the current locale when + 68. The 'test' builtin compares strings using the current locale when processing the '<' and '>' binary operators. - 68. The 'test' builtin's '-t' unary primary requires an argument. + 69. 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. - 69. Command substitutions don't set the '?' special parameter. The + 70. 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 @@ -7642,9 +7647,9 @@ compatibility level. compatibility levels. Eventually, the options will be removed in favor of 'BASH_COMPAT'. - Bash-5.0 is the final version for which there will be an individual -shopt option for the previous version. Users should use 'BASH_COMPAT' -on bash-5.0 and later versions. + Bash-5.0 was the final version for which there will be an individual +shopt option for the previous version. Users should control the +compatibility level with 'BASH_COMPAT'. The following table describes the behavior changes controlled by each compatibility level setting. The 'compat'NN tag is used as shorthand @@ -12985,61 +12990,61 @@ Node: Directory Stack Builtins300715 Node: Controlling the Prompt304972 Node: The Restricted Shell307934 Node: Bash POSIX Mode310541 -Node: Shell Compatibility Mode327183 -Node: Job Control335428 -Node: Job Control Basics335885 -Node: Job Control Builtins340884 -Node: Job Control Variables346676 -Node: Command Line Editing347829 -Node: Introduction and Notation349497 -Node: Readline Interaction351117 -Node: Readline Bare Essentials352305 -Node: Readline Movement Commands354091 -Node: Readline Killing Commands355048 -Node: Readline Arguments356966 -Node: Searching358007 -Node: Readline Init File360190 -Node: Readline Init File Syntax361448 -Node: Conditional Init Constructs385470 -Node: Sample Init File389663 -Node: Bindable Readline Commands392784 -Node: Commands For Moving393985 -Node: Commands For History396033 -Node: Commands For Text401024 -Node: Commands For Killing404999 -Node: Numeric Arguments407700 -Node: Commands For Completion408836 -Node: Keyboard Macros413024 -Node: Miscellaneous Commands413709 -Node: Readline vi Mode420075 -Node: Programmable Completion420979 -Node: Programmable Completion Builtins428756 -Node: A Programmable Completion Example439873 -Node: Using History Interactively445118 -Node: Bash History Facilities445799 -Node: Bash History Builtins448807 -Node: History Interaction453895 -Node: Event Designators458144 -Node: Word Designators459679 -Node: Modifiers461541 -Node: Installing Bash463346 -Node: Basic Installation464480 -Node: Compilers and Options468199 -Node: Compiling For Multiple Architectures468937 -Node: Installation Names470626 -Node: Specifying the System Type472732 -Node: Sharing Defaults473446 -Node: Operation Controls474116 -Node: Optional Features475071 -Node: Reporting Bugs486288 -Node: Major Differences From The Bourne Shell487619 -Node: GNU Free Documentation License504474 -Node: Indexes529648 -Node: Builtin Index530099 -Node: Reserved Word Index537197 -Node: Variable Index539642 -Node: Function Index556773 -Node: Concept Index570629 +Node: Shell Compatibility Mode327455 +Node: Job Control335703 +Node: Job Control Basics336160 +Node: Job Control Builtins341159 +Node: Job Control Variables346951 +Node: Command Line Editing348104 +Node: Introduction and Notation349772 +Node: Readline Interaction351392 +Node: Readline Bare Essentials352580 +Node: Readline Movement Commands354366 +Node: Readline Killing Commands355323 +Node: Readline Arguments357241 +Node: Searching358282 +Node: Readline Init File360465 +Node: Readline Init File Syntax361723 +Node: Conditional Init Constructs385745 +Node: Sample Init File389938 +Node: Bindable Readline Commands393059 +Node: Commands For Moving394260 +Node: Commands For History396308 +Node: Commands For Text401299 +Node: Commands For Killing405274 +Node: Numeric Arguments407975 +Node: Commands For Completion409111 +Node: Keyboard Macros413299 +Node: Miscellaneous Commands413984 +Node: Readline vi Mode420350 +Node: Programmable Completion421254 +Node: Programmable Completion Builtins429031 +Node: A Programmable Completion Example440148 +Node: Using History Interactively445393 +Node: Bash History Facilities446074 +Node: Bash History Builtins449082 +Node: History Interaction454170 +Node: Event Designators458419 +Node: Word Designators459954 +Node: Modifiers461816 +Node: Installing Bash463621 +Node: Basic Installation464755 +Node: Compilers and Options468474 +Node: Compiling For Multiple Architectures469212 +Node: Installation Names470901 +Node: Specifying the System Type473007 +Node: Sharing Defaults473721 +Node: Operation Controls474391 +Node: Optional Features475346 +Node: Reporting Bugs486563 +Node: Major Differences From The Bourne Shell487894 +Node: GNU Free Documentation License504749 +Node: Indexes529923 +Node: Builtin Index530374 +Node: Reserved Word Index537472 +Node: Variable Index539917 +Node: Function Index557048 +Node: Concept Index570904  End Tag Table diff --git a/doc/bashref.info b/doc/bashref.info index 729497672..ea10cfecc 100644 --- a/doc/bashref.info +++ b/doc/bashref.info @@ -7470,114 +7470,119 @@ startup files. 42. The 'export' and 'readonly' builtin commands display their output in the format required by POSIX. - 43. The 'trap' builtin displays signal names without the leading + 43. If the 'export' and 'readonly' builtin commands get an argument + that is not a valid identifier, and they are not operating on shell + functions, they return an error. This will cause a non-interactive + shell to exit because these are special builtins. + + 44. The 'trap' builtin displays signal names without the leading 'SIG'. - 44. The 'trap' builtin doesn't check the first argument for a possible + 45. 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. - 45. 'trap -p' without arguments displays signals whose dispositions + 46. '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. - 46. The '.' and 'source' builtins do not search the current directory + 47. The '.' and 'source' builtins do not search the current directory for the filename argument if it is not found by searching 'PATH'. - 47. Enabling POSIX mode has the effect of setting the + 48. 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. - 48. Enabling POSIX mode has the effect of setting the 'shift_verbose' + 49. 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. - 49. When the 'alias' builtin displays alias definitions, it does not + 50. When the 'alias' builtin displays alias definitions, it does not display them with a leading 'alias ' unless the '-p' option is supplied. - 50. When the 'set' builtin is invoked without options, it does not + 51. When the 'set' builtin is invoked without options, it does not display shell function names and definitions. - 51. When the 'set' builtin is invoked without options, it displays + 52. 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. - 52. When the 'cd' builtin is invoked in logical mode, and the pathname + 53. 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. - 53. When the 'cd' builtin cannot change a directory because the length + 54. 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 all symbolic links are expanded, 'cd' will fail instead of attempting to use only the supplied directory name. - 54. The 'pwd' builtin verifies that the value it prints is the same as + 55. 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. - 55. When listing the history, the 'fc' builtin does not include an + 56. When listing the history, the 'fc' builtin does not include an indication of whether or not a history entry has been modified. - 56. The default editor used by 'fc' is 'ed'. + 57. The default editor used by 'fc' is 'ed'. - 57. If there are too many arguments supplied to 'fc -s', 'fc' prints + 58. If there are too many arguments supplied to 'fc -s', 'fc' prints an error message and returns failure. - 58. The 'type' and 'command' builtins will not report a non-executable + 59. 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'. - 59. The 'vi' editing mode will invoke the 'vi' editor directly when + 60. The 'vi' editing mode will invoke the 'vi' editor directly when the 'v' command is run, instead of checking '$VISUAL' and '$EDITOR'. - 60. When the 'xpg_echo' option is enabled, Bash does not attempt to + 61. 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. - 61. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' + 62. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' and '-f' options. - 62. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not + 63. 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. - 63. The 'read' builtin may be interrupted by a signal for which a trap + 64. 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. - 64. The 'printf' builtin uses 'double' (via 'strtod') to convert + 65. 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. - 65. Bash removes an exited background process's status from the list + 66. Bash removes an exited background process's status from the list of such statuses after the 'wait' builtin is used to obtain it. - 66. A double quote character ('"') is treated specially when it + 67. 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. - 67. The 'test' builtin compares strings using the current locale when + 68. The 'test' builtin compares strings using the current locale when processing the '<' and '>' binary operators. - 68. The 'test' builtin's '-t' unary primary requires an argument. + 69. 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. - 69. Command substitutions don't set the '?' special parameter. The + 70. 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 @@ -7643,9 +7648,9 @@ compatibility level. compatibility levels. Eventually, the options will be removed in favor of 'BASH_COMPAT'. - Bash-5.0 is the final version for which there will be an individual -shopt option for the previous version. Users should use 'BASH_COMPAT' -on bash-5.0 and later versions. + Bash-5.0 was the final version for which there will be an individual +shopt option for the previous version. Users should control the +compatibility level with 'BASH_COMPAT'. The following table describes the behavior changes controlled by each compatibility level setting. The 'compat'NN tag is used as shorthand @@ -12986,61 +12991,61 @@ Node: Directory Stack Builtins300937 Node: Controlling the Prompt305197 Node: The Restricted Shell308162 Node: Bash POSIX Mode310772 -Node: Shell Compatibility Mode327417 -Node: Job Control335665 -Node: Job Control Basics336125 -Node: Job Control Builtins341127 -Node: Job Control Variables346922 -Node: Command Line Editing348078 -Node: Introduction and Notation349749 -Node: Readline Interaction351372 -Node: Readline Bare Essentials352563 -Node: Readline Movement Commands354352 -Node: Readline Killing Commands355312 -Node: Readline Arguments357233 -Node: Searching358277 -Node: Readline Init File360463 -Node: Readline Init File Syntax361724 -Node: Conditional Init Constructs385749 -Node: Sample Init File389945 -Node: Bindable Readline Commands393069 -Node: Commands For Moving394273 -Node: Commands For History396324 -Node: Commands For Text401318 -Node: Commands For Killing405296 -Node: Numeric Arguments408000 -Node: Commands For Completion409139 -Node: Keyboard Macros413330 -Node: Miscellaneous Commands414018 -Node: Readline vi Mode420387 -Node: Programmable Completion421294 -Node: Programmable Completion Builtins429074 -Node: A Programmable Completion Example440194 -Node: Using History Interactively445442 -Node: Bash History Facilities446126 -Node: Bash History Builtins449137 -Node: History Interaction454228 -Node: Event Designators458480 -Node: Word Designators460018 -Node: Modifiers461883 -Node: Installing Bash463691 -Node: Basic Installation464828 -Node: Compilers and Options468550 -Node: Compiling For Multiple Architectures469291 -Node: Installation Names470983 -Node: Specifying the System Type473092 -Node: Sharing Defaults473809 -Node: Operation Controls474482 -Node: Optional Features475440 -Node: Reporting Bugs486660 -Node: Major Differences From The Bourne Shell487994 -Node: GNU Free Documentation License504852 -Node: Indexes530029 -Node: Builtin Index530483 -Node: Reserved Word Index537584 -Node: Variable Index540032 -Node: Function Index557166 -Node: Concept Index571025 +Node: Shell Compatibility Mode327689 +Node: Job Control335940 +Node: Job Control Basics336400 +Node: Job Control Builtins341402 +Node: Job Control Variables347197 +Node: Command Line Editing348353 +Node: Introduction and Notation350024 +Node: Readline Interaction351647 +Node: Readline Bare Essentials352838 +Node: Readline Movement Commands354627 +Node: Readline Killing Commands355587 +Node: Readline Arguments357508 +Node: Searching358552 +Node: Readline Init File360738 +Node: Readline Init File Syntax361999 +Node: Conditional Init Constructs386024 +Node: Sample Init File390220 +Node: Bindable Readline Commands393344 +Node: Commands For Moving394548 +Node: Commands For History396599 +Node: Commands For Text401593 +Node: Commands For Killing405571 +Node: Numeric Arguments408275 +Node: Commands For Completion409414 +Node: Keyboard Macros413605 +Node: Miscellaneous Commands414293 +Node: Readline vi Mode420662 +Node: Programmable Completion421569 +Node: Programmable Completion Builtins429349 +Node: A Programmable Completion Example440469 +Node: Using History Interactively445717 +Node: Bash History Facilities446401 +Node: Bash History Builtins449412 +Node: History Interaction454503 +Node: Event Designators458755 +Node: Word Designators460293 +Node: Modifiers462158 +Node: Installing Bash463966 +Node: Basic Installation465103 +Node: Compilers and Options468825 +Node: Compiling For Multiple Architectures469566 +Node: Installation Names471258 +Node: Specifying the System Type473367 +Node: Sharing Defaults474084 +Node: Operation Controls474757 +Node: Optional Features475715 +Node: Reporting Bugs486935 +Node: Major Differences From The Bourne Shell488269 +Node: GNU Free Documentation License505127 +Node: Indexes530304 +Node: Builtin Index530758 +Node: Reserved Word Index537859 +Node: Variable Index540307 +Node: Function Index557441 +Node: Concept Index571300  End Tag Table diff --git a/doc/bashref.texi b/doc/bashref.texi index 463923f3e..3fcc80f8b 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -8680,6 +8680,13 @@ prefix. The @code{export} and @code{readonly} builtin commands display their output in the format required by @sc{posix}. +@item +If the @code{export} and @code{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. + @item The @code{trap} builtin displays signal names without the leading @code{SIG}. @@ -8895,9 +8902,9 @@ Starting with bash-4.4, Bash has begun deprecating older compatibility levels. Eventually, the options will be removed in favor of @env{BASH_COMPAT}. -Bash-5.0 is the final version for which there will be an individual shopt -option for the previous version. Users should use @env{BASH_COMPAT} -on bash-5.0 and later versions. +Bash-5.0 was the final version for which there will be an individual shopt +option for the previous version. +Users should control the compatibility level with @env{BASH_COMPAT}. The following table describes the behavior changes controlled by each compatibility level setting. diff --git a/doc/builtins.0 b/doc/builtins.0 index a2aeeccd6..bea922bd9 100644 --- a/doc/builtins.0 +++ b/doc/builtins.0 @@ -79,25 +79,28 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS variable. Each non-option argument is a command as it would ap- pear in a rreeaaddlliinnee initialization 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'. Options, if supplied, - have the following meanings: + e.g., '"\C-x\C-r": re-read-init-file'. In the following de- + scriptions, output available to be re-read is formatted as com- + mands that would appear in a rreeaaddlliinnee initialization file or + that would be supplied as individual arguments to a bbiinndd com- + mand. Options, if supplied, 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 + --pp Display rreeaaddlliinnee function names and bindings in such a way that they can be re-read. --PP List current rreeaaddlliinnee function names and bindings. - --ss Display rreeaaddlliinnee key sequences bound to macros and the - strings they output in such a way that they can be re- + --ss Display rreeaaddlliinnee key sequences bound to macros and the + strings they output in such a way that they can be re- read. - --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 re-read. --VV List current rreeaaddlliinnee variable names and values. --ff _f_i_l_e_n_a_m_e @@ -111,201 +114,201 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS --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 quotes. When _s_h_e_l_l_-_c_o_m_- - _m_a_n_d is executed, the shell sets the RREEAADDLLIINNEE__LLIINNEE vari- - able to the contents of the rreeaaddlliinnee line buffer and the + 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 quotes. When _s_h_e_l_l_-_c_o_m_- + _m_a_n_d is executed, the shell sets the RREEAADDLLIINNEE__LLIINNEE vari- + able 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__AARRGGUU-- - MMEENNTT variable. If there was no argument, that variable + 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__AARRGGUU-- + MMEENNTT variable. If there was no argument, that variable is not set. If the executed command changes the value of - any of RREEAADDLLIINNEE__LLIINNEE, RREEAADDLLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, + any of RREEAADDLLIINNEE__LLIINNEE, RREEAADDLLIINNEE__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 + --XX List all key sequences bound to shell commands and the associated commands in a format that can be reused as in- put. - The return value is 0 unless an unrecognized option is given or + The return value is 0 unless an unrecognized option is given or an error occurred. bbrreeaakk [_n] - Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is - specified, break _n levels. _n must be >= 1. If _n is greater - than the number of enclosing loops, all enclosing loops are ex- - ited. The return value is 0 unless _n is not greater than or + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + specified, break _n levels. _n must be >= 1. If _n is greater + than the number of enclosing loops, all enclosing loops are ex- + ited. 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, passing it _a_r_g_u_m_e_n_t_s, and + Execute the specified shell builtin, 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 func- + whose name is the same as a shell builtin, retaining the func- tionality of the builtin within the function. The ccdd builtin is - commonly redefined this way. The return status is false if + commonly redefined this way. The return status 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). With- out _e_x_p_r, ccaalllleerr displays the line number and source filename of - the current subroutine call. If a non-negative integer is sup- + the current subroutine call. If a non-negative integer is sup- plied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name, - and source file corresponding to that position in the current - 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 + and source file corresponding to that position in the current + 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 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 the default. The vari- + Change the current directory to _d_i_r. if _d_i_r is not supplied, + the value of the HHOOMMEE shell variable is the default. The vari- able CCDDPPAATTHH defines the search path for the directory containing - _d_i_r: each directory name in CCDDPPAATTHH is searched for _d_i_r. Alter- - native directory names in CCDDPPAATTHH are separated by a colon (:). - A null directory name in CCDDPPAATTHH is the same as the current di- - rectory, i.e., ``..''. If _d_i_r begins with a slash (/), then CCDD-- - PPAATTHH is not used. The --PP option causes ccdd to use the physical + _d_i_r: each directory name in CCDDPPAATTHH is searched for _d_i_r. Alter- + native directory names in CCDDPPAATTHH are separated by a colon (:). + A null directory name in CCDDPPAATTHH is the same as the current di- + rectory, i.e., ``..''. If _d_i_r begins with a slash (/), then CCDD-- + PPAATTHH is not used. The --PP option causes ccdd to use the physical directory structure by resolving symbolic links while traversing - _d_i_r and before processing instances of _._. in _d_i_r (see also the + _d_i_r and before processing instances of _._. in _d_i_r (see also the --PP option to the sseett builtin command); the --LL option forces sym- - bolic links to be followed by resolving the link after process- - ing instances of _._. in _d_i_r. If _._. appears in _d_i_r, it is pro- - cessed by removing the immediately previous pathname component - from _d_i_r, back to a slash or the beginning of _d_i_r. 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 an unsuccessful status. On systems that + bolic links to be followed by resolving the link after process- + ing instances of _._. in _d_i_r. If _._. appears in _d_i_r, it is pro- + cessed by removing the immediately previous pathname component + from _d_i_r, back to a slash or the beginning of _d_i_r. 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 an unsuccessful status. On systems that support it, the --@@ option presents the extended attributes asso- - ciated with a file as a directory. An argument of -- is con- - verted to $$OOLLDDPPWWDD before the directory change is attempted. If - a non-empty directory name from CCDDPPAATTHH is used, or if -- is the - first argument, and the directory change is successful, the ab- - solute pathname of the new working directory is written to the + ciated with a file as a directory. An argument of -- is con- + verted to $$OOLLDDPPWWDD before the directory change is attempted. If + a non-empty directory name from CCDDPPAATTHH is used, or if -- is the + first argument, and the directory change is successful, the ab- + solute pathname of the new working directory is written to the standard output. If the directory change is successful, ccdd sets - the value of the PPWWDD environment variable to the new directory - name, and sets the OOLLDDPPWWDD environment variable to the value of - the current working directory before the change. The return - value is true if the directory was successfully changed; false + the value of the PPWWDD environment variable to the new directory + name, and sets the OOLLDDPPWWDD environment variable to the value of + the current working directory before the change. The return + value is true if the directory was successfully changed; false otherwise. ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...] - Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function + Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function lookup. Only builtin commands or commands found in the PPAATTHH are - executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is - performed using a default value for PPAATTHH that is guaranteed to - find all of the standard utilities. If either the --VV or --vv op- - tion is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv - option causes a single word indicating the command or filename + executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is + performed using a default value for PPAATTHH that is guaranteed to + find all of the standard utilities. If either the --VV or --vv op- + tion is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv + option causes a single word indicating the command or filename used to invoke _c_o_m_m_a_n_d to be displayed; the --VV option produces a - more verbose description. If the --VV or --vv option is supplied, - the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If + more verbose description. If the --VV or --vv option is supplied, + the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If neither option is supplied and an error occurred or _c_o_m_m_a_n_d can- - not be found, the exit status is 127. Otherwise, the exit sta- + not be found, the exit status is 127. Otherwise, the exit sta- tus of the ccoommmmaanndd builtin is the exit status of _c_o_m_m_a_n_d. ccoommppggeenn [--VV _v_a_r_n_a_m_e] [_o_p_t_i_o_n] [_w_o_r_d] - Generate possible completion matches for _w_o_r_d according to the - _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee + Generate possible completion matches for _w_o_r_d according to the + _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee builtin with the exceptions of --pp, --rr, --DD, --EE, and --II, and write - the matches to the standard output. If the --VV option is sup- + the matches to the standard output. If the --VV option is sup- plied, ccoommppggeenn stores the generated completions into the indexed - array variable _v_a_r_n_a_m_e instead of writing them to the standard - output. When using the --FF or --CC options, the various shell - variables set by the programmable completion facilities, while + array variable _v_a_r_n_a_m_e instead of writing them to the standard + output. When using the --FF or --CC options, the various shell + variables set by the programmable completion facilities, while available, will not have useful values. The matches will be generated in the same way as if the program- mable completion code had generated them directly from a comple- - tion specification with the same flags. If _w_o_r_d is specified, + tion specification with the same flags. If _w_o_r_d is specified, only those completions matching _w_o_r_d will be displayed. - The return value is true unless an invalid option is supplied, + The return value is true unless an invalid option is supplied, or no matches were generated. ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--DDEEII] [--AA _a_c_t_i_o_n] [--GG _g_l_o_b_p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d] [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e _._._.] ccoommpplleettee --pprr [--DDEEII] [_n_a_m_e ...] - Specify how arguments to each _n_a_m_e should be completed. If the - --pp option is supplied, or if no options are supplied, existing - completion specifications are printed in a way that allows them + Specify how arguments to each _n_a_m_e should be completed. If the + --pp option is supplied, or if no options are supplied, existing + completion specifications are printed in a way that allows them to be reused as input. The --rr option removes a completion spec- - ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com- + ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com- pletion specifications. The --DD option indicates that other sup- - plied options and actions should apply to the ``default'' com- - mand completion; that is, completion attempted on a command for - which no completion has previously been defined. The --EE option - indicates that other supplied options and actions should apply - to ``empty'' command completion; that is, completion attempted - on a blank line. The --II option indicates that other supplied - options and actions should apply to completion on the initial - non-assignment word on the line, or after a command delimiter - such as ;; or ||, which is usually command name completion. If - multiple options are supplied, the --DD option takes precedence + plied options and actions should apply to the ``default'' com- + mand completion; that is, completion attempted on a command for + which no completion has previously been defined. The --EE option + indicates that other supplied options and actions should apply + to ``empty'' command completion; that is, completion attempted + on a blank line. The --II option indicates that other supplied + options and actions should apply to completion on the initial + non-assignment word on the line, or after a command delimiter + such as ;; or ||, which is usually command name completion. If + multiple options are supplied, the --DD option takes precedence over --EE, and both take precedence over --II. If any of --DD, --EE, or - --II are supplied, any other _n_a_m_e arguments are ignored; these + --II are supplied, any other _n_a_m_e arguments are ignored; these completions only apply to the case specified by the option. - The process of applying these completion specifications when + The process of applying these completion specifications when word completion is attempted is described in _b_a_s_h_(_1_). - Other options, if specified, have the following meanings. The - arguments to the --GG, --WW, and --XX options (and, if necessary, the - --PP and --SS options) should be quoted to protect them from expan- + Other options, if specified, have the following meanings. The + arguments to the --GG, --WW, and --XX options (and, if necessary, the + --PP and --SS options) should be quoted to protect them from expan- sion before the ccoommpplleettee builtin is invoked. --oo _c_o_m_p_-_o_p_t_i_o_n - The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- - spec's behavior beyond the simple generation of comple- + The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- + spec's behavior beyond the simple generation of comple- tions. _c_o_m_p_-_o_p_t_i_o_n may be one of: bbaasshhddeeffaauulltt Perform the rest of the default bbaasshh completions if the compspec generates no matches. - ddeeffaauulltt Use readline's default filename completion if + ddeeffaauulltt Use readline's default filename completion if the compspec generates no matches. ddiirrnnaammeess - Perform directory name completion if the comp- + Perform directory name completion if the comp- spec generates no matches. ffiilleennaammeess - Tell readline that the compspec generates file- - names, so it can perform any filename-specific - processing (like adding a slash to directory - names, quoting special characters, or suppress- - ing trailing spaces). Intended to be used with + Tell readline that the compspec generates file- + names, so it can perform any filename-specific + processing (like adding a slash to directory + names, quoting special characters, or suppress- + ing trailing spaces). Intended to be used with shell functions. ffuullllqquuoottee - Tell readline to quote all the completed words + Tell readline to quote all the completed words even if they are not filenames. - nnooqquuoottee Tell readline not to quote the completed words - if they are filenames (quoting filenames is the + nnooqquuoottee Tell readline not to quote the completed words + if they are filenames (quoting filenames is the default). - nnoossoorrtt Tell readline not to sort the list of possible + nnoossoorrtt Tell readline not to sort the list of possible completions alphabetically. - nnoossppaaccee Tell readline not to append a space (the de- - fault) to words completed at the end of the + nnoossppaaccee Tell readline not to append a space (the de- + fault) to words completed at the end of the line. pplluussddiirrss - After any matches defined by the compspec are + After any matches defined by the compspec are generated, directory name completion is at- tempted and any matches are added to the results of the other actions. --AA _a_c_t_i_o_n - The _a_c_t_i_o_n may be one of the following to generate a + The _a_c_t_i_o_n may be one of the following to generate a list of possible completions: aalliiaass Alias names. May also be specified as --aa. aarrrraayyvvaarr Array variable names. bbiinnddiinngg RReeaaddlliinnee key binding names. - bbuuiillttiinn Names of shell builtin commands. May also be + bbuuiillttiinn Names of shell builtin commands. May also be specified as --bb. ccoommmmaanndd Command names. May also be specified as --cc. ddiirreeccttoorryy @@ -313,7 +316,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS ddiissaabblleedd Names of disabled shell builtins. eennaabblleedd Names of enabled shell builtins. - eexxppoorrtt Names of exported shell variables. May also be + eexxppoorrtt Names of exported shell variables. May also be specified as --ee. ffiillee File names. May also be specified as --ff. ffuunnccttiioonn @@ -322,17 +325,17 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS hheellppttooppiicc Help topics as accepted by the hheellpp builtin. hhoossttnnaammee - Hostnames, as taken from the file specified by + Hostnames, as taken from the file specified by the HHOOSSTTFFIILLEE shell variable. - jjoobb Job names, if job control is active. May also + jjoobb Job names, if job control is active. May also be specified as --jj. - kkeeyywwoorrdd Shell reserved words. May also be specified as + kkeeyywwoorrdd Shell reserved words. May also be specified as --kk. rruunnnniinngg Names of running jobs, if job control is active. sseerrvviiccee Service names. May also be specified as --ss. - sseettoopptt Valid arguments for the --oo option to the sseett + sseettoopptt Valid arguments for the --oo option to the sseett builtin. - sshhoopptt Shell option names as accepted by the sshhoopptt + sshhoopptt Shell option names as accepted by the sshhoopptt builtin. ssiiggnnaall Signal names. ssttooppppeedd Names of stopped jobs, if job control is active. @@ -341,198 +344,198 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS Names of all shell variables. May also be spec- ified as --vv. --CC _c_o_m_m_a_n_d - _c_o_m_m_a_n_d is executed in a subshell environment, and its - output is used as the possible completions. Arguments + _c_o_m_m_a_n_d is executed in a subshell environment, and its + output is used as the possible completions. Arguments are passed as with the --FF option. --FF _f_u_n_c_t_i_o_n - The shell function _f_u_n_c_t_i_o_n is executed in the current - shell environment. When the function is executed, the + The shell function _f_u_n_c_t_i_o_n is executed in the current + shell environment. When the function is executed, the first argument ($$11) is the name of the command whose ar- guments 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 cur- - rent command line. When it finishes, the possible com- - pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY + the word preceding the word being completed on the cur- + rent command line. When it finishes, the possible com- + pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY array variable. --GG _g_l_o_b_p_a_t - The pathname expansion pattern _g_l_o_b_p_a_t is expanded to + The pathname expansion pattern _g_l_o_b_p_a_t is expanded to generate the possible completions. --PP _p_r_e_f_i_x - _p_r_e_f_i_x is added at the beginning of each possible com- + _p_r_e_f_i_x is added at the beginning of each possible com- pletion after all other options have been applied. --SS _s_u_f_f_i_x _s_u_f_f_i_x is appended to each possible completion after all other options have been applied. --WW _w_o_r_d_l_i_s_t - The _w_o_r_d_l_i_s_t is split using the characters in the IIFFSS - special variable as delimiters, and each resultant word - is expanded. Shell quoting is honored within _w_o_r_d_l_i_s_t, + The _w_o_r_d_l_i_s_t is split using the characters in the IIFFSS + special variable as delimiters, and each resultant word + is expanded. Shell quoting is honored within _w_o_r_d_l_i_s_t, in order to provide a mechanism for the words to contain - shell metacharacters or characters in the value of IIFFSS. - The possible completions are the members of the resul- + shell metacharacters or characters in the value of IIFFSS. + The possible completions are the members of the resul- tant list which match the word being completed. --XX _f_i_l_t_e_r_p_a_t - _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. + _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. It is applied to the list of possible completions gener- - ated by the preceding options and arguments, and each - completion matching _f_i_l_t_e_r_p_a_t is removed from the list. - A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this + ated by the preceding options and arguments, and each + completion matching _f_i_l_t_e_r_p_a_t is removed from the list. + A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this case, any completion not matching _f_i_l_t_e_r_p_a_t is removed. - The return value is true unless an invalid option is supplied, + The return value is true unless an invalid option is supplied, an option other than --pp, --rr, --DD, --EE, or --II is supplied without a - _n_a_m_e argument, an attempt is made to remove a completion speci- + _n_a_m_e argument, an attempt is made to remove a completion speci- fication for a _n_a_m_e for which no specification exists, or an er- ror occurs adding a completion specification. ccoommppoopptt [--oo _o_p_t_i_o_n] [--DDEEII] [++oo _o_p_t_i_o_n] [_n_a_m_e] - Modify completion options for each _n_a_m_e according to the _o_p_- + Modify completion options for each _n_a_m_e according to the _o_p_- _t_i_o_ns, or for the currently-executing completion if no _n_a_m_es are - supplied. If no _o_p_t_i_o_ns are given, display the completion op- - tions for each _n_a_m_e or the current completion. The possible - values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin de- - scribed above. The --DD option indicates that other supplied op- - tions should apply to the ``default'' command completion; that - is, completion attempted on a command for which no completion + supplied. If no _o_p_t_i_o_ns are given, display the completion op- + tions for each _n_a_m_e or the current completion. The possible + values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin de- + scribed above. The --DD option indicates that other supplied op- + tions should apply to the ``default'' command completion; that + is, completion attempted on a command for which no completion has previously been defined. The --EE option indicates that other - supplied options should apply to ``empty'' command completion; - that is, completion attempted on a blank line. The --II option + supplied options should apply to ``empty'' command completion; + that is, completion attempted on a blank line. The --II option indicates that other supplied options should apply to completion - on the initial non-assignment word on the line, or after a com- - mand delimiter such as ;; or ||, which is usually command name + on the initial non-assignment word on the line, or after a com- + mand delimiter such as ;; or ||, which is usually command name completion. - The return value is true unless an invalid option is supplied, + The return value is true unless an invalid option is supplied, an attempt is made to modify the options for a _n_a_m_e for which no completion specification exists, or an output error occurs. ccoonnttiinnuuee [_n] Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or - sseelleecctt loop. If _n is specified, resume at the _nth enclosing - loop. _n must be >= 1. If _n is greater than the number of en- - closing loops, the last enclosing loop (the ``top-level'' loop) - is resumed. The return value is 0 unless _n is not greater than + sseelleecctt loop. If _n is specified, resume at the _nth enclosing + loop. _n must be >= 1. If _n is greater than the number of en- + closing loops, the last enclosing loop (the ``top-level'' loop) + is resumed. The return value is 0 unless _n is not greater than or equal to 1. ddeeccllaarree [--aaAAffFFggiiIIllnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] ttyyppeesseett [--aaAAffFFggiiIIllnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] - Declare variables and/or give them attributes. If no _n_a_m_es are - given then display the values of variables. The --pp option will + Declare variables and/or give them attributes. If no _n_a_m_es are + given then display the values of variables. The --pp option will display the attributes and values of each _n_a_m_e. When --pp is used - with _n_a_m_e arguments, additional options, other than --ff and --FF, - are ignored. When --pp is supplied without _n_a_m_e arguments, it - will display the attributes and values of all variables having + with _n_a_m_e arguments, additional options, other than --ff and --FF, + are ignored. When --pp is supplied without _n_a_m_e arguments, it + will display the attributes and values of all variables having the attributes specified by the additional options. If no other - options are supplied with --pp, ddeeccllaarree will display the at- - tributes and values of all shell variables. The --ff option will + options are supplied with --pp, ddeeccllaarree will display the at- + tributes and values of all shell variables. The --ff option will restrict the display to shell functions. The --FF option inhibits - the display of function definitions; only the function name and + the display of function definitions; only the function name and attributes are printed. If the eexxttddeebbuugg shell option is enabled - using sshhoopptt, the source file name and line number where each - _n_a_m_e is defined are displayed as well. The --FF option implies + using sshhoopptt, the source file name and line number where each + _n_a_m_e is defined are displayed as well. The --FF option implies --ff. The --gg option forces variables to be created or modified at the global scope, even when ddeeccllaarree is executed in a shell func- - tion. It is ignored in all other cases. The --II option causes - local variables to inherit the attributes (except the _n_a_m_e_r_e_f + tion. It is ignored in all other cases. The --II option causes + local variables to inherit the attributes (except the _n_a_m_e_r_e_f attribute) and value of any existing variable with the same _n_a_m_e - at a surrounding scope. If there is no existing variable, the + at a surrounding scope. If there is no existing variable, the local variable is initially unset. The following options can be - used to restrict output to variables with the specified attri- + used to restrict output to variables with the specified attri- bute or to give variables attributes: - --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss in + --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss in _b_a_s_h_(_1_)). --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss in _b_a_s_h_(_1_)). --ff Use function names only. --ii The variable is treated as an integer; arithmetic evalua- - tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h_(_1_)) is performed + tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h_(_1_)) is performed when the variable is assigned a value. - --ll When the variable is assigned a value, all upper-case - characters are converted to lower-case. The upper-case + --ll When the variable is assigned a value, all upper-case + characters are converted to lower-case. The upper-case attribute is disabled. - --nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name - reference to another variable. That other variable is - defined by the value of _n_a_m_e. All references, assign- - ments, and attribute modifications to _n_a_m_e, except those - using or changing the --nn attribute itself, are performed - on the variable referenced by _n_a_m_e's value. The nameref + --nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name + reference to another variable. That other variable is + defined by the value of _n_a_m_e. All references, assign- + ments, and attribute modifications to _n_a_m_e, except those + using or changing the --nn attribute itself, are performed + on the variable referenced by _n_a_m_e's value. The nameref attribute cannot be applied to array variables. --rr Make _n_a_m_es readonly. These names cannot then be assigned values by subsequent assignment statements or unset. --tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions in- - herit the DDEEBBUUGG and RREETTUURRNN traps from the calling shell. + herit the DDEEBBUUGG and RREETTUURRNN traps from the calling shell. The trace attribute has no special meaning for variables. - --uu When the variable is assigned a value, all lower-case - characters are converted to upper-case. The lower-case + --uu When the variable is assigned a value, all lower-case + characters are converted to upper-case. The lower-case attribute is disabled. - --xx Mark _n_a_m_es for export to subsequent commands via the en- + --xx Mark _n_a_m_es for export to subsequent commands via the en- vironment. - Using `+' instead of `-' turns off the attribute instead, with - the exceptions that ++aa and ++AA may not be used to destroy array - variables and ++rr will not remove the readonly attribute. When + Using `+' instead of `-' turns off the attribute instead, with + the exceptions that ++aa and ++AA may not be used to destroy array + variables and ++rr will not remove the readonly attribute. When used in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e local, as - with the llooccaall command, unless the --gg option is supplied. If a - variable name is followed by =_v_a_l_u_e, the value of the variable - is set to _v_a_l_u_e. When using --aa or --AA and the compound assign- - ment syntax to create array variables, additional attributes do - not take effect until subsequent assignments. The return value + with the llooccaall command, unless the --gg option is supplied. If a + variable name is followed by =_v_a_l_u_e, the value of the variable + is set to _v_a_l_u_e. When using --aa or --AA and the compound assign- + ment syntax to create array variables, additional attributes do + not take effect until subsequent assignments. The return value is 0 unless an invalid option is encountered, an attempt is made to define a function using ``-f foo=bar'', an attempt is made to assign a value to a readonly variable, an attempt is made to as- sign a value to an array variable without using the compound as- signment syntax (see AArrrraayyss in _b_a_s_h_(_1_)), one of the _n_a_m_e_s is not - a valid shell variable name, an attempt is made to turn off - readonly status for a readonly variable, an attempt is made to - turn off array status for an array variable, or an attempt is + a valid shell variable name, an attempt is made to turn off + readonly status for a readonly variable, an attempt is made to + turn off array status for an array variable, or an attempt is made to display a non-existent function with --ff. ddiirrss [[--ccllppvv]] [[++_n]] [[--_n]] - Without options, displays the list of currently remembered di- - rectories. The default display is on a single line with direc- - tory names separated by spaces. Directories are added to the - list with the ppuusshhdd command; the ppooppdd command removes entries + Without options, displays the list of currently remembered di- + rectories. The default display is on a single line with direc- + tory names separated by spaces. Directories are added to the + list with the ppuusshhdd command; the ppooppdd command removes entries from the list. The current directory is always the first direc- tory in the stack. - --cc Clears the directory stack by deleting all of the en- + --cc Clears the directory stack by deleting all of the en- tries. - --ll Produces a listing using full pathnames; the default + --ll Produces a listing using full pathnames; the default listing format uses a tilde to denote the home directory. --pp Print the directory stack with one entry per line. - --vv Print the directory stack with one entry per line, pre- + --vv Print the directory stack with one entry per line, pre- fixing each entry with its index in the stack. ++_n Displays the _nth entry counting from the left of the list shown by ddiirrss when invoked without options, starting with zero. - --_n Displays the _nth entry counting from the right of the + --_n Displays the _nth entry counting from the right of the list shown by ddiirrss when invoked without options, starting with zero. - The return value is 0 unless an invalid option is supplied or _n + The return value is 0 unless an invalid option is supplied or _n indexes beyond the end of the directory stack. ddiissoowwnn [--aarr] [--hh] [_j_o_b_s_p_e_c ... | _p_i_d ... ] - Without options, remove each _j_o_b_s_p_e_c from the table of active - jobs. If _j_o_b_s_p_e_c is not present, and neither the --aa nor the --rr - option is supplied, the _c_u_r_r_e_n_t _j_o_b is used. If the --hh option - is given, each _j_o_b_s_p_e_c is not removed from the table, but is - marked so that SSIIGGHHUUPP is not sent to the job if the shell re- + Without options, remove each _j_o_b_s_p_e_c from the table of active + jobs. If _j_o_b_s_p_e_c is not present, and neither the --aa nor the --rr + option is supplied, the _c_u_r_r_e_n_t _j_o_b is used. If the --hh option + is given, each _j_o_b_s_p_e_c is not removed from the table, but is + marked so that SSIIGGHHUUPP is not sent to the job if the shell re- ceives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is supplied, the --aa option means - to remove or mark all jobs; the --rr option without a _j_o_b_s_p_e_c ar- + to remove or mark all jobs; the --rr option without a _j_o_b_s_p_e_c ar- gument restricts operation to running jobs. The return value is 0 unless a _j_o_b_s_p_e_c does not specify a valid job. eecchhoo [--nneeEE] [_a_r_g ...] - Output the _a_r_gs, separated by spaces, followed by a newline. - The return status is 0 unless a write error occurs. If --nn is + Output the _a_r_gs, separated by spaces, followed by a newline. + The return status is 0 unless a write error occurs. If --nn is specified, the trailing newline is suppressed. If the --ee option - is given, interpretation of the following backslash-escaped - characters is enabled. The --EE option disables the interpreta- - tion of these escape characters, even on systems where they are - interpreted by default. The xxppgg__eecchhoo shell option may be used - to dynamically determine whether or not eecchhoo interprets any op- + is given, interpretation of the following backslash-escaped + characters is enabled. The --EE option disables the interpreta- + tion of these escape characters, even on systems where they are + interpreted by default. The xxppgg__eecchhoo shell option may be used + to dynamically determine whether or not eecchhoo interprets any op- tions and expands these escape characters by default. eecchhoo does - not interpret ---- to mean the end of options. eecchhoo interprets + not interpret ---- to mean the end of options. eecchhoo interprets the following escape sequences: \\aa alert (bell) \\bb backspace @@ -545,207 +548,207 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS \\tt horizontal tab \\vv vertical tab \\\\ backslash - \\00_n_n_n the eight-bit character whose value is the octal value + \\00_n_n_n the eight-bit character whose value is the octal value _n_n_n (zero 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) eennaabbllee [--aa] [--ddnnppss] [--ff _f_i_l_e_n_a_m_e] [_n_a_m_e ...] - Enable and disable builtin shell commands. Disabling a builtin + Enable and disable builtin shell commands. Disabling a builtin allows a disk command which has the same name as a shell builtin - to be executed without specifying a full pathname, even though - the shell normally searches for builtins before disk commands. - If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are en- - abled. For example, to use the tteesstt binary found via the PPAATTHH - instead of the shell builtin version, run ``enable -n test''. - The --ff option means to load the new builtin command _n_a_m_e from + to be executed without specifying a full pathname, even though + the shell normally searches for builtins before disk commands. + If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are en- + abled. For example, to use the tteesstt binary found via the PPAATTHH + instead of the shell builtin version, run ``enable -n test''. + The --ff option means to load the new builtin command _n_a_m_e from shared object _f_i_l_e_n_a_m_e, on systems that support dynamic loading. BBaasshh will use the value of the BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH variable as a colon-separated list of directories in which to search for _f_i_l_e_- _n_a_m_e, if _f_i_l_e_n_a_m_e does not contain a slash. The default is sys- tem-dependent, and may include "." to force a search of the cur- - rent directory. The --dd option will delete a builtin previously - loaded with --ff. If no _n_a_m_e arguments are given, or if the --pp - option is supplied, a list of shell builtins is printed. With - no other option arguments, the list consists of all enabled - shell builtins. If --nn is supplied, only disabled builtins are - printed. If --aa is supplied, the list printed includes all - builtins, with an indication of whether or not each is enabled. + rent directory. The --dd option will delete a builtin previously + loaded with --ff. If no _n_a_m_e arguments are given, or if the --pp + option is supplied, a list of shell builtins is printed. With + no other option arguments, the list consists of all enabled + shell builtins. If --nn is supplied, only disabled builtins are + printed. If --aa is supplied, the list printed includes all + builtins, with an indication of whether or not each is enabled. If --ss is supplied, the output is restricted to the POSIX _s_p_e_c_i_a_l - builtins. If no options are supplied and a _n_a_m_e is not a shell - builtin, eennaabbllee will attempt to load _n_a_m_e from a shared object - named _n_a_m_e, as if the command were ``enable -f _n_a_m_e _n_a_m_e . The - return value is 0 unless a _n_a_m_e is not a shell builtin or there + builtins. If no options are supplied and a _n_a_m_e is not a shell + builtin, eennaabbllee will attempt to load _n_a_m_e from a shared object + named _n_a_m_e, as if the command were ``enable -f _n_a_m_e _n_a_m_e . The + return value is 0 unless a _n_a_m_e is not a shell builtin or there is an error loading a new builtin from a shared object. eevvaall [_a_r_g ...] - The _a_r_gs are read and concatenated together into a single com- - mand. This command is then read and executed by the shell, and - its exit status is returned as the value of eevvaall. If there are + The _a_r_gs are read and concatenated together into a single com- + mand. This command is then read and executed by the shell, and + its exit status is returned as the value of eevvaall. If there are no _a_r_g_s, or only null arguments, eevvaall returns 0. eexxeecc [--ccll] [--aa _n_a_m_e] [_c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]] - If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process - is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If + If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process + is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If the --ll option is supplied, the shell places a dash at the begin- ning of the zeroth argument passed to _c_o_m_m_a_n_d. This is what _l_o_- - _g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with - an empty environment. If --aa is supplied, the shell passes _n_a_m_e + _g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with + an empty environment. If --aa is supplied, the shell passes _n_a_m_e as the zeroth argument to the executed command. If _c_o_m_m_a_n_d can- - not be executed for some reason, a non-interactive shell exits, - unless the eexxeeccffaaiill shell option is enabled. In that case, it - returns failure. An interactive shell returns failure if the - file cannot be executed. A subshell exits unconditionally if - eexxeecc fails. If _c_o_m_m_a_n_d is not specified, any redirections take - effect in the current shell, and the return status is 0. If + not be executed for some reason, a non-interactive shell exits, + unless the eexxeeccffaaiill shell option is enabled. In that case, it + returns failure. An interactive shell returns failure if the + file cannot be executed. A subshell exits unconditionally if + eexxeecc fails. If _c_o_m_m_a_n_d is not specified, any redirections take + effect in the current shell, and the return status is 0. If there is a redirection error, the return status is 1. eexxiitt [_n] - Cause the shell to exit with a status of _n. If _n is omitted, + Cause the shell to exit with a status of _n. If _n is omitted, the exit status is that of the last command executed. A trap on EEXXIITT is executed before the shell terminates. eexxppoorrtt [--ffnn] [_n_a_m_e[=_w_o_r_d]] ... eexxppoorrtt --pp - The supplied _n_a_m_e_s are marked for automatic export to the envi- - ronment of subsequently executed commands. If the --ff option is - given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or - if the --pp option is supplied, a list of names of all exported - variables is printed. The --nn option causes the export property + The supplied _n_a_m_e_s are marked for automatic export to the envi- + ronment of subsequently executed commands. If the --ff option is + given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or + if the --pp option is supplied, a list of names of all exported + variables is printed. The --nn option causes the export property to be removed from each _n_a_m_e. If a variable name is followed by =_w_o_r_d, the value of the variable is set to _w_o_r_d. eexxppoorrtt returns an exit status of 0 unless an invalid option is encountered, one - of the _n_a_m_e_s is not a valid shell variable name, or --ff is sup- + of the _n_a_m_e_s is not a valid shell variable name, or --ff is sup- plied with a _n_a_m_e that is not a function. ffaallssee Does nothing, returns a non-zero status. ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t] ffcc --ss [_p_a_t=_r_e_p] [_c_m_d] - The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t - from the history list and displays or edits and re-executes - them. _F_i_r_s_t and _l_a_s_t may be specified as a string (to locate - the last command beginning with that string) or as a number (an - index into the history list, where a negative number is used as - an offset from the current command number). When listing, a - _f_i_r_s_t or _l_a_s_t of 0 is equivalent to -1 and -0 is equivalent to - the current command (usually the ffcc command); otherwise 0 is - equivalent to -1 and -0 is invalid. If _l_a_s_t is not specified, - it is set to the current command for listing (so that ``fc -l - -10'' prints the last 10 commands) and to _f_i_r_s_t otherwise. If - _f_i_r_s_t is not specified, it is set to the previous command for + The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t + from the history list and displays or edits and re-executes + them. _F_i_r_s_t and _l_a_s_t may be specified as a string (to locate + the last command beginning with that string) or as a number (an + index into the history list, where a negative number is used as + an offset from the current command number). When listing, a + _f_i_r_s_t or _l_a_s_t of 0 is equivalent to -1 and -0 is equivalent to + the current command (usually the ffcc command); otherwise 0 is + equivalent to -1 and -0 is invalid. If _l_a_s_t is not specified, + it is set to the current command for listing (so that ``fc -l + -10'' prints the last 10 commands) and to _f_i_r_s_t otherwise. If + _f_i_r_s_t is not specified, it is set to the previous command for editing and -16 for listing. - The --nn option suppresses the command numbers when listing. The - --rr option reverses the order of the commands. If the --ll option - is given, the commands are listed on standard output. Other- - wise, the editor given by _e_n_a_m_e is invoked on a file containing - those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT - variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set. - If neither variable is set, _v_i is used. When editing is com- + The --nn option suppresses the command numbers when listing. The + --rr option reverses the order of the commands. If the --ll option + is given, the commands are listed on standard output. Other- + wise, the editor given by _e_n_a_m_e is invoked on a file containing + those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT + variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set. + If neither variable is set, _v_i is used. When editing is com- plete, the edited commands are echoed and executed. - In the second form, _c_o_m_m_a_n_d is re-executed after each instance - of _p_a_t is replaced by _r_e_p. _C_o_m_m_a_n_d is interpreted the same as - _f_i_r_s_t above. A useful alias to use with this is ``r="fc -s"'', - so that typing ``r cc'' runs the last command beginning with + In the second form, _c_o_m_m_a_n_d is re-executed after each instance + of _p_a_t is replaced by _r_e_p. _C_o_m_m_a_n_d is interpreted the same as + _f_i_r_s_t above. A useful alias to use with this is ``r="fc -s"'', + so that typing ``r cc'' runs the last command beginning with ``cc'' and typing ``r'' re-executes the last command. - If the first form is used, the return value is 0 unless an in- - valid option is encountered or _f_i_r_s_t or _l_a_s_t specify history - lines out of range. If the --ee option is supplied, the return + If the first form is used, the return value is 0 unless an in- + valid option is encountered or _f_i_r_s_t or _l_a_s_t specify history + lines out of range. If the --ee option is supplied, the return value is the value of the last command executed or failure if an error occurs with the temporary file of commands. If the second - form is used, the return status is that of the command re-exe- - cuted, unless _c_m_d does not specify a valid history line, in + form is used, the return status is that of the command re-exe- + cuted, unless _c_m_d does not specify a valid history line, in which case ffcc returns failure. ffgg [_j_o_b_s_p_e_c] - Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. + Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. If _j_o_b_s_p_e_c is not present, the shell's notion of the _c_u_r_r_e_n_t _j_o_b - is used. The return value is that of the command placed into - the foreground, or failure if run when job control is disabled + is used. The return value is that of the command placed into + the foreground, or failure if run when job control is disabled or, when run with job control enabled, if _j_o_b_s_p_e_c does not spec- - ify a valid job or _j_o_b_s_p_e_c specifies a job that was started + ify a valid job or _j_o_b_s_p_e_c specifies a job that was started without job control. ggeettooppttss _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g _._._.] - ggeettooppttss is used by shell procedures to parse positional parame- - ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- - nized; if a character is followed by a colon, the option is ex- + ggeettooppttss is used by shell procedures to parse positional parame- + ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- + nized; if a character is followed by a colon, the option is ex- pected to have an argument, which should be separated from it by - white space. The colon and question mark characters may not be - used as option characters. Each time it is invoked, ggeettooppttss - places the next option in the shell variable _n_a_m_e, initializing + white space. The colon and question mark characters may not be + used as option characters. Each time it is invoked, ggeettooppttss + places the next option in the shell variable _n_a_m_e, initializing _n_a_m_e if it does not exist, and the index of the next argument to be processed into the variable OOPPTTIINNDD. OOPPTTIINNDD is initialized to 1 each time the shell or a shell script is invoked. When an op- tion requires an argument, ggeettooppttss places that argument into the variable OOPPTTAARRGG. The shell does not reset OOPPTTIINNDD automatically; - it must be manually reset between multiple calls to ggeettooppttss - within the same shell invocation if a new set of parameters is + it must be manually reset between multiple calls to ggeettooppttss + within the same shell invocation if a new set of parameters is to be used. When the end of options is encountered, ggeettooppttss exits with a re- turn value greater than zero. OOPPTTIINNDD is set to the index of the first non-option argument, and _n_a_m_e is set to ?. - ggeettooppttss normally parses the positional parameters, but if more - arguments are supplied as _a_r_g values, ggeettooppttss parses those in- + ggeettooppttss normally parses the positional parameters, but if more + arguments are supplied as _a_r_g values, ggeettooppttss parses those in- stead. - ggeettooppttss can report errors in two ways. If the first character - of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In - normal operation, diagnostic messages are printed when invalid - options or missing option arguments are encountered. If the - variable OOPPTTEERRRR is set to 0, no error messages will be dis- + ggeettooppttss can report errors in two ways. If the first character + of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In + normal operation, diagnostic messages are printed when invalid + options or missing option arguments are encountered. If the + variable OOPPTTEERRRR is set to 0, no error messages will be dis- played, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon. If an invalid option is seen, ggeettooppttss places ? into _n_a_m_e and, if - not silent, prints an error message and unsets OOPPTTAARRGG. If - ggeettooppttss is silent, the option character found is placed in OOPP-- + not silent, prints an error message and unsets OOPPTTAARRGG. If + ggeettooppttss is silent, the option character found is placed in OOPP-- TTAARRGG and no diagnostic message is printed. - If a required argument is not found, and ggeettooppttss is not silent, - a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a - diagnostic message is printed. If ggeettooppttss is silent, then a - colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option + If a required argument is not found, and ggeettooppttss is not silent, + a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a + diagnostic message is printed. If ggeettooppttss is silent, then a + colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option character found. - ggeettooppttss returns true if an option, specified or unspecified, is + ggeettooppttss returns true if an option, specified or unspecified, is found. It returns false if the end of options is encountered or an error occurs. hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e] Each time hhaasshh is invoked, the full pathname of the command _n_a_m_e - is determined by searching the directories in $$PPAATTHH and remem- + is determined by searching the directories in $$PPAATTHH and remem- bered. Any previously-remembered pathname is discarded. If the - --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e as the full filename - of the command. The --rr option causes the shell to forget all - remembered locations. Assigning to the PPAATTHH variable also - clears all hashed filenames. The --dd option causes the shell to - forget the remembered location of each _n_a_m_e. If the --tt option + --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e as the full filename + of the command. The --rr option causes the shell to forget all + remembered locations. Assigning to the PPAATTHH variable also + clears all hashed filenames. The --dd option causes the shell to + forget the remembered location of each _n_a_m_e. If the --tt option is supplied, the full pathname to which each _n_a_m_e corresponds is - printed. If multiple _n_a_m_e arguments are supplied with --tt, the - _n_a_m_e is printed before the hashed full pathname. The --ll option - causes output to be displayed in a format that may be reused as - input. If no arguments are given, or if only --ll is supplied, - information about remembered commands is printed. The --tt, --dd, - and --pp options (the options that act on the _n_a_m_e arguments) are - mutually exclusive. Only one will be active. If more than one + printed. If multiple _n_a_m_e arguments are supplied with --tt, the + _n_a_m_e is printed before the hashed full pathname. The --ll option + causes output to be displayed in a format that may be reused as + input. If no arguments are given, or if only --ll is supplied, + information about remembered commands is printed. The --tt, --dd, + and --pp options (the options that act on the _n_a_m_e arguments) are + mutually exclusive. Only one will be active. If more than one is supplied, --tt has higher priority than --pp, and both are higher - priority than --dd. The return status is true unless a _n_a_m_e is + priority than --dd. The return status is true unless a _n_a_m_e is not found or an invalid option is supplied. hheellpp [--ddmmss] [_p_a_t_t_e_r_n] - Display helpful information about builtin commands. If _p_a_t_t_e_r_n - is specified, hheellpp gives detailed help on all commands matching - _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control + Display helpful information about builtin commands. If _p_a_t_t_e_r_n + is specified, hheellpp gives detailed help on all commands matching + _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control structures is printed. --dd Display a short description of each _p_a_t_t_e_r_n --mm Display the description of each _p_a_t_t_e_r_n in a manpage-like @@ -763,55 +766,55 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS hhiissttoorryy --ss _a_r_g [_a_r_g _._._.] With no options, display the command history list with line num- bers. Lines listed with a ** have been modified. An argument of - _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- - FFOORRMMAATT is set and not null, it is used as a format string for - _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- - played history entry. No intervening blank is printed between - the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is - supplied, it is used as the name of the history file; if not, - the value of HHIISSTTFFIILLEE is used. If _f_i_l_e_n_a_m_e is not supplied and - HHIISSTTFFIILLEE is unset or null, the --aa,, --nn,, --rr,, and --ww options have + _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- + FFOORRMMAATT is set and not null, it is used as a format string for + _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- + played history entry. No intervening blank is printed between + the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is + supplied, it is used as the name of the history file; if not, + the value of HHIISSTTFFIILLEE is used. If _f_i_l_e_n_a_m_e is not supplied and + HHIISSTTFFIILLEE is unset or null, the --aa,, --nn,, --rr,, and --ww options have no effect. Options, if supplied, have the following meanings: --cc Clear the history list by deleting all the entries. --dd _o_f_f_s_e_t - Delete the history entry at position _o_f_f_s_e_t. If _o_f_f_s_e_t + Delete the history entry at position _o_f_f_s_e_t. If _o_f_f_s_e_t is negative, it is interpreted as relative to one greater than the last history position, so negative indices count - back from the end of the history, and an index of -1 + back from the end of the history, and an index of -1 refers to the current hhiissttoorryy --dd command. --dd _s_t_a_r_t-_e_n_d - Delete the range of history entries between positions - _s_t_a_r_t and _e_n_d, inclusive. Positive and negative values + Delete the range of history entries between positions + _s_t_a_r_t and _e_n_d, inclusive. Positive and negative values for _s_t_a_r_t and _e_n_d are interpreted as described above. - --aa Append the ``new'' history lines to the history file. - These are history lines entered since the beginning of + --aa Append the ``new'' history lines to the history file. + These are history lines entered since the beginning of the current bbaasshh session, but not already appended to the history file. - --nn Read the history lines not already read from the history - file into the current history list. These are lines ap- - pended to the history file since the beginning of the + --nn Read the history lines not already read from the history + file into the current history list. These are lines ap- + pended to the history file since the beginning of the current bbaasshh session. - --rr Read the contents of the history file and append them to + --rr Read the contents of the history file and append them to the current history list. --ww Write the current history list to the history file, over- writing the history file's contents. - --pp Perform history substitution on the following _a_r_g_s and - display the result on the standard output. Does not - store the results in the history list. Each _a_r_g must be + --pp Perform history substitution on the following _a_r_g_s and + display the result on the standard output. Does not + store the results in the history list. Each _a_r_g must be quoted to disable normal history expansion. - --ss Store the _a_r_g_s in the history list as a single entry. - The last command in the history list is removed before + --ss Store the _a_r_g_s in the history list as a single entry. + The last command in the history list is removed before the _a_r_g_s are added. - If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- - tion associated with each history entry is written to the his- - tory file, marked with the history comment character. When the - history file is read, lines beginning with the history comment - character followed immediately by a digit are interpreted as + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- + tion associated with each history entry is written to the his- + tory file, marked with the history comment character. 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 entry. The return value is 0 unless an invalid option is encountered, an error occurs while - reading or writing the history file, an invalid _o_f_f_s_e_t or range - is supplied as an argument to --dd, or the history expansion sup- + reading or writing the history file, an invalid _o_f_f_s_e_t or range + is supplied as an argument to --dd, or the history expansion sup- plied as an argument to --pp fails. jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ] @@ -819,15 +822,15 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS The first form lists the active jobs. The options have the fol- lowing meanings: --ll List process IDs in addition to the normal information. - --nn Display information only about jobs that have changed + --nn Display information only about jobs that have changed status since the user was last notified of their status. - --pp List only the process ID of the job's process group + --pp List only the process ID of the job's process group leader. --rr Display only running jobs. --ss Display only stopped jobs. - If _j_o_b_s_p_e_c is given, output is restricted to information about - that job. The return status is 0 unless an invalid option is + If _j_o_b_s_p_e_c is given, output is restricted to information about + that job. The return status is 0 unless an invalid option is encountered or an invalid _j_o_b_s_p_e_c is supplied. If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in @@ -836,269 +839,269 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ... kkiillll --ll|--LL [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s] - Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes - named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive - signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or - a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not - present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the - signal names. If any arguments are supplied when --ll is given, - the names of the signals corresponding to the arguments are + Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes + named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive + signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or + a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not + present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the + signal names. If any arguments are supplied when --ll is given, + the names of the signals corresponding to the arguments are listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to - --ll is a number specifying either a signal number or the exit - status of a process terminated by a signal. The --LL option is - equivalent to --ll. kkiillll returns true if at least one signal was + --ll is a number specifying either a signal number or the exit + status of a process terminated by a signal. The --LL option is + equivalent to --ll. kkiillll returns true if at least one signal was successfully sent, or false if an error occurs or an invalid op- tion is encountered. lleett _a_r_g [_a_r_g ...] Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH-- - MMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h_(_1_)). If the last _a_r_g evaluates to 0, + MMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h_(_1_)). If the last _a_r_g evaluates to 0, lleett returns 1; 0 is returned otherwise. llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ... | - ] - For each argument, a local variable named _n_a_m_e is created, and - assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted + For each argument, a local variable named _n_a_m_e is created, and + assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted by ddeeccllaarree. When llooccaall is used within a function, it causes the - variable _n_a_m_e to have a visible scope restricted to that func- - tion and its children. If _n_a_m_e is -, the set of shell options - is made local to the function in which llooccaall is invoked: shell - options changed using the sseett builtin inside the function after + variable _n_a_m_e to have a visible scope restricted to that func- + tion and its children. If _n_a_m_e is -, the set of shell options + is made local to the function in which llooccaall is invoked: shell + options changed using the sseett builtin inside the function after the call to llooccaall are restored to their original values when the function returns. The restore is effected as if a series of sseett - commands were executed to restore the values that were in place - before the function. With no operands, llooccaall writes a list of - local variables to the standard output. It is an error to use + commands were executed to restore the values that were in place + before the function. With no operands, llooccaall writes a list of + local variables to the standard output. It is an error to use llooccaall when not within a function. The return status is 0 unless - llooccaall is used outside a function, an invalid _n_a_m_e is supplied, + llooccaall is used outside a function, an invalid _n_a_m_e is supplied, or _n_a_m_e is a readonly variable. llooggoouutt Exit a login shell. - mmaappffiillee [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC + mmaappffiillee [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] rreeaaddaarrrraayy [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] - Read lines from the standard input into the indexed array vari- - able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- - plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if + Read lines from the standard input into the indexed array vari- + able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- + plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if supplied, have the following meanings: - --dd The first character of _d_e_l_i_m is used to terminate each - input line, rather than newline. If _d_e_l_i_m is the empty + --dd The first character of _d_e_l_i_m is used to terminate each + input line, rather than newline. If _d_e_l_i_m is the empty string, mmaappffiillee will terminate a line when it reads a NUL character. - --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are + --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are copied. - --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default + --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default index is 0. --ss Discard the first _c_o_u_n_t lines read. - --tt Remove a trailing _d_e_l_i_m (default newline) from each line + --tt Remove a trailing _d_e_l_i_m (default newline) from each line read. - --uu Read lines from file descriptor _f_d instead of the stan- + --uu Read lines from file descriptor _f_d instead of the stan- dard input. - --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The + --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The --cc option specifies _q_u_a_n_t_u_m. - --cc Specify the number of lines read between each call to + --cc Specify the number of lines read between each call to _c_a_l_l_b_a_c_k. - If --CC is specified without --cc, the default quantum is 5000. + If --CC is specified without --cc, the default quantum is 5000. When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next array element to be assigned and the line to be assigned to that - element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after + element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after the line is read but before the array element is assigned. - If not supplied with an explicit origin, mmaappffiillee will clear _a_r_- + If not supplied with an explicit origin, mmaappffiillee will clear _a_r_- _r_a_y before assigning to it. - mmaappffiillee returns successfully unless an invalid option or option - argument is supplied, _a_r_r_a_y is invalid or unassignable, or if + mmaappffiillee returns successfully unless an invalid option or option + argument is supplied, _a_r_r_a_y is invalid or unassignable, or if _a_r_r_a_y is not an indexed array. ppooppdd [-nn] [+_n] [-_n] Removes entries from the directory stack. The elements are num- - bered from 0 starting at the first directory listed by ddiirrss. - With no arguments, ppooppdd removes the top directory from the + bered from 0 starting at the first directory listed by ddiirrss. + With no arguments, ppooppdd removes the top directory from the stack, and changes to the new top directory. Arguments, if sup- plied, have the following meanings: - --nn Suppresses the normal change of directory when removing + --nn Suppresses the normal change of directory when removing directories from the stack, so that only the stack is ma- nipulated. - ++_n Removes the _nth entry counting from the left of the list - shown by ddiirrss, starting with zero, from the stack. For - example: ``popd +0'' removes the first directory, ``popd + ++_n Removes the _nth entry counting from the left of the list + shown by ddiirrss, starting with zero, from the stack. For + example: ``popd +0'' removes the first directory, ``popd +1'' the second. --_n Removes the _nth entry counting from the right of the list - shown by ddiirrss, starting with zero. For example: ``popd - -0'' removes the last directory, ``popd -1'' the next to + shown by ddiirrss, starting with zero. For example: ``popd + -0'' removes the last directory, ``popd -1'' the next to last. - If the top element of the directory stack is modified, and the - _-_n option was not supplied, ppooppdd uses the ccdd builtin to change + If the top element of the directory stack is modified, and the + _-_n option was not supplied, ppooppdd uses the ccdd builtin to change to the directory at the top of the stack. If the ccdd fails, ppooppdd returns a non-zero value. - Otherwise, ppooppdd returns false if an invalid option is encoun- + Otherwise, ppooppdd returns false if an invalid option is encoun- tered, the directory stack is empty, or a non-existent directory stack entry is specified. - If the ppooppdd command is successful, bash runs ddiirrss to show the - final contents of the directory stack, and the return status is + If the ppooppdd command is successful, bash runs ddiirrss to show the + final contents of the directory stack, and the return status is 0. pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s] - Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the - control of the _f_o_r_m_a_t. The --vv option causes the output to be - assigned to the variable _v_a_r rather than being printed to the + Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the + control of the _f_o_r_m_a_t. The --vv option causes the output to be + assigned to the variable _v_a_r rather than being printed to the standard output. - The _f_o_r_m_a_t is a character string which contains three types of - objects: plain characters, which are simply copied to standard - output, character escape sequences, which are converted and - copied to the standard output, and format specifications, each - of which causes printing of the next successive _a_r_g_u_m_e_n_t. In + The _f_o_r_m_a_t is a character string which contains three types of + objects: plain characters, which are simply copied to standard + output, character escape sequences, which are converted and + copied to the standard output, and format specifications, each + of which causes printing of the next successive _a_r_g_u_m_e_n_t. In addition to the standard _p_r_i_n_t_f(3) format characters ccssnnddiioouuxxXXee-- EEffFFggGGaaAA, pprriinnttff interprets the following additional format spec- ifiers: %%bb causes pprriinnttff to expand backslash escape sequences in the corresponding _a_r_g_u_m_e_n_t in the same way as eecchhoo --ee. - %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a - format that can be reused as shell input. %%qq and %%QQ use - the $$'''' quoting style if any characters in the argument - string require it, and backslash quoting otherwise. If - the format string uses the _p_r_i_n_t_f alternate form, these + %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a + format that can be reused as shell input. %%qq and %%QQ use + the $$'''' quoting style if any characters in the argument + string require it, and backslash quoting otherwise. If + the format string uses the _p_r_i_n_t_f alternate form, these two formats quote the argument string using single quotes. - %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- + %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- _m_e_n_t before quoting it. %%((_d_a_t_e_f_m_t))TT - causes pprriinnttff to output the date-time string resulting - from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). + causes pprriinnttff to output the date-time string resulting + from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). The corresponding _a_r_g_u_m_e_n_t is an integer representing the - number of seconds since the epoch. Two special argument - values may be used: -1 represents the current time, and - -2 represents the time the shell was invoked. If no ar- + number of seconds since the epoch. Two special argument + values may be used: -1 represents the current time, and + -2 represents the time the shell was invoked. If no ar- gument is specified, conversion behaves as if -1 had been - given. This is an exception to the usual pprriinnttff behav- + given. This is an exception to the usual pprriinnttff behav- ior. The %b, %q, and %T format specifiers all use the field width and precision arguments from the format specification and write that - many bytes from (or use that wide a field for) the expanded ar- - gument, which usually contains more characters than the origi- + many bytes from (or use that wide a field for) the expanded ar- + gument, which usually contains more characters than the origi- nal. The %n format specifier accepts a corresponding argument that is treated as a shell variable name. - The %s and %c format specifiers accept an l (long) modifier, + The %s and %c format specifiers accept an l (long) modifier, which forces them to convert the argument string to a wide-char- acter string and apply any supplied field width and precision in terms of characters, not bytes. - Arguments to non-string format specifiers are treated as C con- + Arguments to non-string format specifiers are treated as C con- stants, except that a leading plus or minus sign is allowed, and - if the leading character is a single or double quote, the value + if the leading character is a single or double quote, the value is the ASCII value of the following character. - The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied, - the extra format specifications behave as if a zero value or - null string, as appropriate, had been supplied. The return - value is zero on success, non-zero if an invalid option is sup- + the extra format specifications behave as if a zero value or + null string, as appropriate, had been supplied. The return + value is zero on success, non-zero if an invalid option is sup- plied or a write or assignment error occurs. ppuusshhdd [--nn] [+_n] [-_n] ppuusshhdd [--nn] [_d_i_r] - Adds a directory to the top of the directory stack, or rotates - the stack, making the new top of the stack the current working - directory. With no arguments, ppuusshhdd exchanges the top two ele- - ments of the directory stack. Arguments, if supplied, have the + Adds a directory to the top of the directory stack, or rotates + the stack, making the new top of the stack the current working + directory. With no arguments, ppuusshhdd exchanges the top two ele- + ments of the directory stack. Arguments, if supplied, have the following meanings: - --nn Suppresses the normal change of directory when rotating - or adding directories to the stack, so that only the + --nn Suppresses the normal change of directory when rotating + or adding directories to the stack, so that only the stack is manipulated. - ++_n Rotates the stack so that the _nth directory (counting - from the left of the list shown by ddiirrss, starting with + ++_n Rotates the stack so that the _nth directory (counting + from the left of the list shown by ddiirrss, starting with zero) is at the top. - --_n Rotates the stack so that the _nth directory (counting - from the right of the list shown by ddiirrss, starting with + --_n Rotates the stack so that the _nth directory (counting + from the right of the list shown by ddiirrss, starting with zero) is at the top. _d_i_r Adds _d_i_r to the directory stack at the top After the stack has been modified, if the --nn option was not sup- - plied, ppuusshhdd uses the ccdd builtin to change to the directory at + plied, ppuusshhdd uses the ccdd builtin to change to the directory at the top of the stack. If the ccdd fails, ppuusshhdd returns a non-zero value. - Otherwise, if no arguments are supplied, ppuusshhdd returns 0 unless - the directory stack is empty. When rotating the directory - stack, ppuusshhdd returns 0 unless the directory stack is empty or a + Otherwise, if no arguments are supplied, ppuusshhdd returns 0 unless + the directory stack is empty. When rotating the directory + stack, ppuusshhdd returns 0 unless the directory stack is empty or a non-existent directory stack element is specified. - If the ppuusshhdd command is successful, bash runs ddiirrss to show the + If the ppuusshhdd command is successful, bash runs ddiirrss to show the final contents of the directory stack. ppwwdd [--LLPP] - Print the absolute pathname of the current working directory. + Print the absolute pathname of the current working directory. The pathname printed contains no symbolic links if the --PP option is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command - is enabled. If the --LL option is used, the pathname printed may - contain symbolic links. The return status is 0 unless an error + is enabled. If the --LL option is used, the pathname printed may + contain symbolic links. The return status is 0 unless an error occurs while reading the name of the current directory or an in- valid option is supplied. - rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] + rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] - One line is read from the standard input, or from the file de- + One line is read from the standard input, or from the file de- scriptor _f_d supplied as an argument to the --uu option, split into - words as described in _b_a_s_h_(_1_) under WWoorrdd SSpplliittttiinngg, and the + words as described in _b_a_s_h_(_1_) under WWoorrdd SSpplliittttiinngg, and the first word is assigned to the first _n_a_m_e, the second word to the second _n_a_m_e, and so on. If there are more words than names, the remaining words and their intervening delimiters are assigned to - the last _n_a_m_e. If there are fewer words read from the input - stream than names, the remaining names are assigned empty val- - ues. The characters in IIFFSS are used to split the line into - words using the same rules the shell uses for expansion (de- + the last _n_a_m_e. If there are fewer words read from the input + stream than names, the remaining names are assigned empty val- + ues. The characters in IIFFSS are used to split the line into + words using the same rules the shell uses for expansion (de- scribed in _b_a_s_h_(_1_) under WWoorrdd SSpplliittttiinngg). The backslash charac- - ter (\\) may be used to remove any special meaning for the next + ter (\\) may be used to remove any special meaning for the next character read and for line continuation. Options, if supplied, have the following meanings: --aa _a_n_a_m_e The words are assigned to sequential indices of the array variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any - new values are assigned. Other _n_a_m_e arguments are ig- + new values are assigned. Other _n_a_m_e arguments are ig- nored. --dd _d_e_l_i_m The first character of _d_e_l_i_m is used to terminate the in- - put line, rather than newline. If _d_e_l_i_m is the empty - string, rreeaadd will terminate a line when it reads a NUL + put line, rather than newline. If _d_e_l_i_m is the empty + string, rreeaadd 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 in _b_a_s_h_(_1_)) to obtain the - line. Readline uses the current (or default, if line - editing was not previously active) editing settings, but + --ee If the standard input is coming from a terminal, rreeaadd + uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h_(_1_)) 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. - --EE If the standard input is coming from a terminal, rreeaadd - uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h_(_1_)) to obtain the - line. Readline uses the current (or default, if line - editing was not previously active) editing settings, but - uses bash's default completion, including programmable + --EE If the standard input is coming from a terminal, rreeaadd + uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h_(_1_)) to obtain the + line. Readline uses the current (or default, if line + editing was not previously active) editing settings, but + uses bash's default completion, including programmable completion. --ii _t_e_x_t - If rreeaaddlliinnee is being used to read the line, _t_e_x_t is + If rreeaaddlliinnee is being used to read the line, _t_e_x_t is placed into the editing buffer before editing begins. --nn _n_c_h_a_r_s - rreeaadd returns after reading _n_c_h_a_r_s characters rather than + rreeaadd returns after reading _n_c_h_a_r_s characters rather than waiting for a complete line of input, but honors a delim- - iter if fewer than _n_c_h_a_r_s characters are read before the + iter if fewer than _n_c_h_a_r_s characters are read before the delimiter. --NN _n_c_h_a_r_s - rreeaadd returns after reading exactly _n_c_h_a_r_s characters - rather than waiting for a complete line of input, unless - EOF is encountered or rreeaadd times out. Delimiter charac- - ters encountered in the input are not treated specially - and do not cause rreeaadd to return until _n_c_h_a_r_s characters - are read. The result is not split on the characters in - IIFFSS; the intent is that the variable is assigned exactly + rreeaadd returns after reading exactly _n_c_h_a_r_s characters + rather than waiting for a complete line of input, unless + EOF is encountered or rreeaadd times out. Delimiter charac- + ters encountered in the input are not treated specially + and do not cause rreeaadd to return until _n_c_h_a_r_s characters + are read. The result is not split on the characters in + IIFFSS; the intent is that the variable is assigned exactly the characters read (with the exception of backslash; see the --rr option below). --pp _p_r_o_m_p_t @@ -1106,134 +1109,134 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS line, before attempting to read any input. The prompt is displayed only if input is coming from a terminal. --rr Backslash does not act as an escape character. The back- - slash is considered to be part of the line. In particu- - lar, a backslash-newline pair may not then be used as a + slash is considered to be part of the line. In particu- + lar, a backslash-newline pair may not then be used as a line continuation. --ss Silent mode. If input is coming from a terminal, charac- ters are not echoed. --tt _t_i_m_e_o_u_t - Cause rreeaadd to time out and return failure if a complete - line of input (or a specified number of characters) is - not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- - mal number with a fractional portion following the deci- - mal point. This option is only effective if rreeaadd is - reading input from a terminal, pipe, or other special - file; it has no effect when reading from regular files. + Cause rreeaadd to time out and return failure if a complete + line of input (or a specified number of characters) is + not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- + mal number with a fractional portion following the deci- + mal point. This option is only effective if rreeaadd is + reading input from a terminal, pipe, or other special + file; it has no effect when reading from regular files. If rreeaadd times out, rreeaadd saves any partial input read into - the specified variable _n_a_m_e. If _t_i_m_e_o_u_t is 0, rreeaadd re- - turns immediately, without trying to read any data. The - exit status is 0 if input is available on the specified - file descriptor, or the read will return EOF, non-zero - otherwise. The exit status is greater than 128 if the + the specified variable _n_a_m_e. If _t_i_m_e_o_u_t is 0, rreeaadd re- + turns immediately, without trying to read any data. The + exit status is 0 if input is available on the specified + file descriptor, or the read will return EOF, non-zero + otherwise. The exit status is greater than 128 if the timeout is exceeded. --uu _f_d Read input from file descriptor _f_d. - If no _n_a_m_e_s are supplied, the line read, without the ending de- - limiter but otherwise unmodified, is assigned to the variable - RREEPPLLYY. The exit status is zero, unless end-of-file is encoun- - tered, rreeaadd times out (in which case the status is greater than - 128), a variable assignment error (such as assigning to a read- + If no _n_a_m_e_s are supplied, the line read, without the ending de- + limiter but otherwise unmodified, is assigned to the variable + RREEPPLLYY. The exit status is zero, unless end-of-file is encoun- + tered, rreeaadd times out (in which case the status is greater than + 128), a variable assignment error (such as assigning to a read- only variable) occurs, or an invalid file descriptor is supplied as the argument to --uu. rreeaaddoonnllyy [--aaAAff] [--pp] [_n_a_m_e[=_w_o_r_d] ...] - The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s - may not be changed by subsequent assignment. If the --ff option - is supplied, the functions corresponding to the _n_a_m_e_s are so - marked. The --aa option restricts the variables to indexed ar- - rays; the --AA option restricts the variables to associative ar- + The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s + may not be changed by subsequent assignment. If the --ff option + is supplied, the functions corresponding to the _n_a_m_e_s are so + marked. The --aa option restricts the variables to indexed ar- + rays; the --AA option restricts the variables to associative ar- rays. If both options are supplied, --AA takes precedence. If no - _n_a_m_e arguments are given, or if the --pp option is supplied, a + _n_a_m_e arguments are given, or if the --pp option is supplied, a list of all readonly names is printed. The other options may be - used to restrict the output to a subset of the set of readonly - names. The --pp option causes output to be displayed in a format - that may be reused as input. If a variable name is followed by - =_w_o_r_d, the value of the variable is set to _w_o_r_d. The return - status is 0 unless an invalid option is encountered, one of the + used to restrict the output to a subset of the set of readonly + names. The --pp option causes output to be displayed in a format + that may be reused as input. If a variable name is followed by + =_w_o_r_d, the value of the variable is set to _w_o_r_d. The return + status is 0 unless an invalid option is encountered, one of the _n_a_m_e_s is not a valid shell variable name, or --ff is supplied with a _n_a_m_e that is not a function. rreettuurrnn [_n] - Causes a function to stop executing and return the value speci- - fied by _n to its caller. If _n is omitted, the return status is - that of the last command executed in the function body. If rree-- + Causes a function to stop executing and return the value speci- + fied by _n to its caller. If _n is omitted, the return status is + that of the last command executed in the function body. If rree-- ttuurrnn is executed by a trap handler, the last command used to de- - termine the status is the last command executed before the trap - handler. If rreettuurrnn is executed during a DDEEBBUUGG trap, the last - command used to determine the status is the last command exe- - cuted by the trap handler before rreettuurrnn was invoked. If rreettuurrnn - is used outside a function, but during execution of a script by - the .. (ssoouurrccee) command, it causes the shell to stop executing - that script and return either _n or the exit status of the last - command executed within the script as the exit status of the + termine the status is the last command executed before the trap + handler. If rreettuurrnn is executed during a DDEEBBUUGG trap, the last + command used to determine the status is the last command exe- + cuted by the trap handler before rreettuurrnn was invoked. If rreettuurrnn + is used outside a function, but during execution of a script by + the .. (ssoouurrccee) command, it causes the shell to stop executing + that script and return either _n or the exit status of the last + command executed within the script as the exit status of the script. If _n is supplied, the return value is its least signif- - icant 8 bits. The return status is non-zero if rreettuurrnn is sup- - plied a non-numeric argument, or is used outside a function and - not during execution of a script by .. or ssoouurrccee. Any command + icant 8 bits. The return status is non-zero if rreettuurrnn is sup- + plied a non-numeric argument, or is used outside a function and + not during execution of a script by .. or ssoouurrccee. Any command associated with the RREETTUURRNN trap is executed before execution re- sumes after the function or script. sseett [--aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...] sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...] sseett --oo - 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- + 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 - 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 + be reset. In _p_o_s_i_x _m_o_d_e, 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 for the positional parameters and are assigned, in order, to $$11, - $$22, ...... $$_n. Options, if specified, have the following mean- + $$22, ...... $$_n. Options, if specified, have the following mean- ings: --aa Each variable or function that is created or modified is - given the export attribute and marked for export to the + given the export attribute and marked for export to the environment of subsequent commands. - --bb Report the status of terminated background jobs immedi- + --bb Report the status of terminated background jobs immedi- ately, rather than before the next primary prompt. This is effective only when job control is enabled. - --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a - single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d - (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h_(_1_)), exits with a non-zero - status. The shell does not exit if the command that - fails is part of the command list immediately following + --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a + single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d + (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h_(_1_)), exits with a non-zero + status. The shell does not exit if the command that + fails is part of the command list immediately following a wwhhiillee or uunnttiill keyword, part of the test following the - iiff or eelliiff reserved words, part of any command executed - in a &&&& or |||| list except the command following the fi- + iiff or eelliiff reserved words, part of any command executed + in a &&&& or |||| list except the command following the fi- nal &&&& or ||||, any command in a pipeline but the last, or - if the command's return value is being inverted with !!. - If a compound command other than a subshell returns a - non-zero status because a command failed while --ee was - being ignored, the shell does not exit. A trap on EERRRR, + if the command's return value is being inverted with !!. + If a compound command other than a subshell returns a + non-zero status because a command failed while --ee was + being ignored, the shell does not exit. A trap on EERRRR, if set, is executed before the shell exits. This option applies to the shell environment and each subshell envi- ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT in _b_a_s_h_(_1_)), and may cause subshells to exit before execut- ing all the commands in the subshell. - If a compound command or shell function executes in a - context where --ee is being ignored, none of the commands - executed within the compound command or function body - will be affected by the --ee setting, even if --ee is set - and a command returns a failure status. If a compound - command or shell function sets --ee while executing in a - context where --ee is ignored, that setting will not have - any effect until the compound command or the command + If a compound command or shell function executes in a + context where --ee is being ignored, none of the commands + executed within the compound command or function body + will be affected by the --ee setting, even if --ee is set + and a command returns a failure status. If a compound + command or shell function sets --ee while executing in a + context where --ee is ignored, that setting will not have + any effect until the compound command or the command containing the function call completes. --ff Disable pathname expansion. - --hh Remember the location of commands as they are looked up + --hh Remember the location of commands as they are looked up for execution. This is enabled by default. - --kk All arguments in the form of assignment statements are - placed in the environment for a command, not just those + --kk All arguments in the form of assignment statements are + placed in the environment for a command, not just those that precede the command name. - --mm Monitor mode. Job control is enabled. This option is - on by default for interactive shells on systems that - support it (see JJOOBB CCOONNTTRROOLL in _b_a_s_h_(_1_)). All processes - run in a separate process group. When a background job - completes, the shell prints a line containing its exit + --mm Monitor mode. Job control is enabled. This option is + on by default for interactive shells on systems that + support it (see JJOOBB CCOONNTTRROOLL in _b_a_s_h_(_1_)). All processes + run in a separate process group. When a background job + completes, the shell prints a line containing its exit status. --nn Read commands but do not execute them. This may be used - to check a shell script for syntax errors. This is ig- + to check a shell script for syntax errors. This is ig- nored by interactive shells. --oo _o_p_t_i_o_n_-_n_a_m_e The _o_p_t_i_o_n_-_n_a_m_e can be one of the following: @@ -1241,10 +1244,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS Same as --aa. bbrraacceeeexxppaanndd Same as --BB. - eemmaaccss Use an emacs-style command line editing inter- + eemmaaccss Use an emacs-style command line editing inter- face. This is enabled by default when the shell is interactive, unless the shell is started with - the ----nnooeeddiittiinngg option. This also affects the + the ----nnooeeddiittiinngg option. This also affects the editing interface used for rreeaadd --ee. eerrrreexxiitt Same as --ee. eerrrrttrraaccee @@ -1254,12 +1257,12 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS hhaasshhaallll Same as --hh. hhiisstteexxppaanndd Same as --HH. - hhiissttoorryy Enable command history, as described in _b_a_s_h_(_1_) - under HHIISSTTOORRYY. This option is on by default in + hhiissttoorryy Enable command history, as described in _b_a_s_h_(_1_) + under HHIISSTTOORRYY. This option is on by default in interactive shells. iiggnnoorreeeeooff - The effect is as if the shell command ``IG- - NOREEOF=10'' had been executed (see SShheellll VVaarrii-- + The effect is as if the shell command ``IG- + NOREEOF=10'' had been executed (see SShheellll VVaarrii-- aabblleess in _b_a_s_h_(_1_)). kkeeyywwoorrdd Same as --kk. mmoonniittoorr Same as --mm. @@ -1274,179 +1277,179 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS pphhyyssiiccaall Same as --PP. ppiippeeffaaiill - If set, the return value of a pipeline is the - value of the last (rightmost) command to exit - with a non-zero status, or zero if all commands - in the pipeline exit successfully. This option + If set, the return value of a pipeline is the + value of the last (rightmost) command to exit + with a non-zero status, or zero if all commands + in the pipeline exit successfully. This option is disabled by default. - ppoossiixx 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 - in _b_a_s_h_(_1_) for a reference to a document that + ppoossiixx 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 + in _b_a_s_h_(_1_) for a reference to a document that details how posix mode affects bash's behavior. pprriivviilleeggeedd Same as --pp. vveerrbboossee Same as --vv. - vvii Use a vi-style command line editing interface. + vvii Use a vi-style command line editing interface. This also affects the editing interface used for rreeaadd --ee. xxttrraaccee Same as --xx. - If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, sseett prints the - current shell option settings. If ++oo is supplied with - no _o_p_t_i_o_n_-_n_a_m_e, sseett prints a series of sseett commands to - recreate the current option settings on the standard + If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, sseett prints the + current shell option settings. If ++oo is supplied with + no _o_p_t_i_o_n_-_n_a_m_e, sseett prints a series of sseett commands to + recreate the current option settings on the standard output. - --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and - $$BBAASSHH__EENNVV files are not processed, shell functions are - not inherited from the environment, and the SSHHEELLLLOOPPTTSS, - BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- - pear in the environment, are ignored. 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 sup- + --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and + $$BBAASSHH__EENNVV files are not processed, shell functions are + not inherited from the environment, and the SSHHEELLLLOOPPTTSS, + BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- + pear in the environment, are ignored. 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 sup- plied, these actions are taken and the effective user id - is set to the real user id. If the --pp option is sup- - plied at startup, the effective user id is not reset. - Turning this option off causes the effective user and + is set to the real user id. If the --pp option is sup- + plied at startup, the effective user id is not reset. + Turning this option off causes the effective user and group ids to be set to the real user and group ids. --rr Enable restricted shell mode. This option cannot be un- set once it has been set. --tt Exit after reading and executing one command. --uu Treat unset variables and parameters other than the spe- - cial parameters "@" and "*", or array variables sub- - scripted with "@" or "*", as an error when performing - parameter expansion. If expansion is attempted on an - unset variable or parameter, the shell prints an error - message, and, if not interactive, exits with a non-zero + cial parameters "@" and "*", or array variables sub- + scripted with "@" or "*", as an error when performing + parameter expansion. If expansion is attempted on an + unset variable or parameter, the shell prints an error + message, and, if not interactive, exits with a non-zero status. --vv Print shell input lines as they are read. - --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee + --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee command, sseelleecctt command, or arithmetic ffoorr command, dis- - play the expanded value of PPSS44, followed by the command - and its expanded arguments or associated word list, to + play the expanded value of PPSS44, followed by the command + and its expanded arguments or associated word list, to standard error. - --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn + --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn in _b_a_s_h_(_1_)). This is on by default. - --CC If set, bbaasshh does not overwrite an existing file with - the >>, >>&&, and <<>> redirection operators. This may be + --CC If set, bbaasshh does not overwrite an existing file with + the >>, >>&&, and <<>> redirection operators. This may be overridden when creating output files by using the redi- rection operator >>|| instead of >>. --EE If set, any trap on EERRRR is inherited by shell functions, - command substitutions, and commands executed in a sub- - shell environment. The EERRRR trap is normally not inher- + command substitutions, and commands executed in a sub- + shell environment. The EERRRR trap is normally not inher- ited in such cases. --HH Enable !! style history substitution. This option is on by default when the shell is interactive. - --PP If set, the shell does not resolve symbolic links when - executing commands such as ccdd that change the current + --PP If set, the shell does not resolve symbolic links when + executing commands such as ccdd that change the current working directory. It uses the physical directory structure instead. By default, bbaasshh follows the logical - chain of directories when performing commands which + chain of directories when performing commands which change the current directory. - --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by + --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by shell functions, command substitutions, and commands ex- - ecuted in a subshell environment. The DDEEBBUUGG and RREETTUURRNN + ecuted in a subshell environment. The DDEEBBUUGG and RREETTUURRNN traps are normally not inherited in such cases. - ---- If no arguments follow this option, then the positional + ---- If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parame- - ters are set to the _a_r_gs, even if some of them begin + ters are set to the _a_r_gs, even if some of them begin with a --. - -- Signal the end of options, cause all remaining _a_r_gs to + -- Signal the end of options, cause all remaining _a_r_gs to be assigned to the positional parameters. The --xx and --vv options are turned off. If there are no _a_r_gs, the posi- tional parameters remain unchanged. - The options are off by default unless otherwise noted. Using + - rather than - causes these options to be turned off. The op- + The options are off by default unless otherwise noted. Using + + rather than - causes these options to be turned off. The op- tions can also be specified as arguments to an invocation of the - shell. The current set of options may be found in $$--. The re- - turn status is always true unless an invalid option is encoun- + shell. The current set of options may be found in $$--. The re- + turn status is always true unless an invalid option is encoun- tered. sshhiifftt [_n] - The positional parameters from _n+1 ... are renamed to $$11 ........ - Parameters represented by the numbers $$## down to $$##-_n+1 are un- - set. _n must be a non-negative number less than or equal to $$##. - If _n is 0, no parameters are changed. If _n is not given, it is + The positional parameters from _n+1 ... are renamed to $$11 ........ + Parameters represented by the numbers $$## down to $$##-_n+1 are un- + set. _n must be a non-negative number less than or equal to $$##. + If _n is 0, no parameters are changed. If _n is not given, it is assumed to be 1. If _n is greater than $$##, the positional param- - eters are not changed. The return status is greater than zero + eters are not changed. The return status is greater than zero if _n is greater than $$## or less than zero; otherwise 0. sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...] - Toggle the values of settings controlling optional shell behav- - ior. The settings can be either those listed below, or, if the + Toggle the values of settings controlling optional shell behav- + ior. The settings can be either those listed below, or, if the --oo option is used, those available with the --oo option to the sseett builtin command. With no options, or with the --pp option, a list - of all settable options is displayed, with an indication of + of all settable options is displayed, with an indication of whether or not each is set; if _o_p_t_n_a_m_e_s are supplied, the output - is restricted to those options. The --pp option causes output to - be displayed in a form that may be reused as input. Other op- + is restricted to those options. The --pp option causes output to + be displayed in a form that may be reused as input. Other op- tions have the following meanings: --ss Enable (set) each _o_p_t_n_a_m_e. --uu Disable (unset) each _o_p_t_n_a_m_e. - --qq Suppresses normal output (quiet mode); the return status + --qq Suppresses normal output (quiet mode); the return status indicates whether the _o_p_t_n_a_m_e is set or unset. If multi- - ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta- - tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- + ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta- + tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- wise. - --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for + --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for the --oo option to the sseett builtin. - If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt - shows only those options which are set or unset, respectively. - Unless otherwise noted, the sshhoopptt options are disabled (unset) + If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt + shows only those options which are set or unset, respectively. + Unless otherwise noted, the sshhoopptt options are disabled (unset) by default. - The return status when listing options is zero if all _o_p_t_n_a_m_e_s - are enabled, non-zero otherwise. When setting or unsetting op- - tions, the return status is zero unless an _o_p_t_n_a_m_e is not a + The return status when listing options is zero if all _o_p_t_n_a_m_e_s + are enabled, non-zero otherwise. When setting or unsetting op- + tions, the return status is zero unless an _o_p_t_n_a_m_e is not a valid shell option. The list of sshhoopptt options is: aarrrraayy__eexxppaanndd__oonnccee - If set, the shell suppresses multiple evaluation of as- + If set, the shell suppresses multiple evaluation of as- sociative and indexed array subscripts during arithmetic expression evaluation, while executing builtins that can - perform variable assignments, and while executing + perform variable assignments, and while executing builtins that perform array dereferencing. aassssoocc__eexxppaanndd__oonnccee Deprecated; a synonym for aarrrraayy__eexxppaanndd__oonnccee. - aauuttooccdd If set, a command name that is the name of a directory - is executed as if it were the argument to the ccdd com- + aauuttooccdd If set, a command name that is the name of a directory + is executed as if it were the argument to the ccdd com- mand. This option is only used by interactive shells. ccddaabbllee__vvaarrss - If set, an argument to the ccdd builtin command that is - not a directory is assumed to be the name of a variable + If set, an argument to the ccdd builtin command that is + not a directory is assumed to be the name of a variable whose value is the directory to change to. ccddssppeellll If set, minor errors in the spelling of a directory com- - ponent in a ccdd command will be corrected. The errors + ponent in a ccdd command will be corrected. The errors checked for are transposed characters, a missing charac- - ter, and one character too many. If a correction is - found, the corrected filename is printed, and the com- - mand proceeds. This option is only used by interactive + ter, and one character too many. If a correction is + found, the corrected filename is printed, and the com- + mand proceeds. This option is only used by interactive shells. cchheecckkhhaasshh If set, bbaasshh checks that a command found in the hash ta- - ble exists before trying to execute it. If a hashed - command no longer exists, a normal path search is per- + ble exists before trying to execute it. If a hashed + command no longer exists, a normal path search is per- formed. cchheecckkjjoobbss If set, bbaasshh lists the status of any stopped and running - jobs before exiting an interactive shell. If any jobs + jobs before exiting an interactive shell. If any jobs are running, this causes the exit to be deferred until a - second exit is attempted without an intervening command - (see JJOOBB CCOONNTTRROOLL in _b_a_s_h_(_1_)). The shell always post- + second exit is attempted without an intervening command + (see JJOOBB CCOONNTTRROOLL in _b_a_s_h_(_1_)). The shell always post- pones exiting if any jobs are stopped. cchheecckkwwiinnssiizzee - If set, bbaasshh checks the window size after each external - (non-builtin) command and, if necessary, updates the - values of LLIINNEESS and CCOOLLUUMMNNSS. This option is enabled by + If set, bbaasshh checks the window size after each external + (non-builtin) command and, if necessary, updates the + values of LLIINNEESS and CCOOLLUUMMNNSS. This option is enabled by default. - ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- - line command in the same history entry. This allows - easy re-editing of multi-line commands. This option is - enabled by default, but only has an effect if command - history is enabled, as described in _b_a_s_h_(_1_) under HHIISS-- + ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- + line command in the same history entry. This allows + easy re-editing of multi-line commands. This option is + enabled by default, but only has an effect if command + history is enabled, as described in _b_a_s_h_(_1_) under HHIISS-- TTOORRYY. ccoommppaatt3311 ccoommppaatt3322 @@ -1456,122 +1459,122 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS ccoommppaatt4433 ccoommppaatt4444 ccoommppaatt5500 - These control aspects of the shell's compatibility mode + These control aspects of the shell's compatibility mode (see SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE in _b_a_s_h_(_1_)). ccoommpplleettee__ffuullllqquuoottee - If set, bbaasshh quotes all shell metacharacters in file- - names and directory names when performing completion. + If set, bbaasshh quotes all shell metacharacters in file- + names and directory names when performing completion. If not set, bbaasshh removes metacharacters such as the dol- - lar sign from the set of characters that will be quoted - in completed filenames when these metacharacters appear - in shell variable references in words to be completed. - This means that dollar signs in variable names that ex- - pand to directories will not be quoted; however, any - dollar signs appearing in filenames will not be quoted, - either. This is active only when bash is using back- - slashes to quote completed filenames. This variable is - set by default, which is the default bash behavior in + lar sign from the set of characters that will be quoted + in completed filenames when these metacharacters appear + in shell variable references in words to be completed. + This means that dollar signs in variable names that ex- + pand to directories will not be quoted; however, any + dollar signs appearing in filenames will not be quoted, + either. This is active only when bash is using back- + slashes to quote completed filenames. This variable is + set by default, which is the default bash behavior in versions through 4.2. 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 buf- - fer. If not set, bbaasshh attempts to preserve what the + If set, bbaasshh replaces directory names with the results + of word expansion when performing filename completion. + This changes the contents of the readline editing buf- + fer. If not set, bbaasshh attempts to preserve what the user typed. ddiirrssppeellll - If set, bbaasshh attempts spelling correction on directory - names during word completion if the directory name ini- + If set, bbaasshh attempts spelling correction on directory + 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 + 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 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 - eexxeecc builtin command. An interactive shell does not + not execute the file specified as an argument to the + eexxeecc builtin command. An interactive shell does not exit if eexxeecc fails. eexxppaanndd__aalliiaasseess If set, aliases are expanded as described in _b_a_s_h_(_1_) un- - der AALLIIAASSEESS. This option is enabled by default for in- + der AALLIIAASSEESS. This option is enabled by default for in- teractive shells. eexxttddeebbuugg - If set at shell invocation, or in a shell startup file, + If set at shell invocation, or in a shell startup file, arrange to execute the debugger profile before the shell - starts, identical to the ----ddeebbuuggggeerr option. If set af- - ter invocation, behavior intended for use by debuggers + starts, identical to the ----ddeebbuuggggeerr option. If set af- + ter invocation, behavior intended for use by debuggers is enabled: 11.. The --FF option to the ddeeccllaarree builtin displays the source file name and line number corresponding to each function name supplied as an argument. - 22.. If the command run by the DDEEBBUUGG trap returns a - non-zero value, the next command is skipped and + 22.. If the command run by the DDEEBBUUGG trap returns a + non-zero value, the next command is skipped and not executed. - 33.. If the command run by the DDEEBBUUGG trap returns a - value of 2, and the shell is executing in a sub- - routine (a shell function or a shell script exe- - cuted by the .. or ssoouurrccee builtins), the shell + 33.. If the command run by the DDEEBBUUGG trap returns a + value of 2, and the shell is executing in a sub- + routine (a shell function or a shell script exe- + cuted by the .. or ssoouurrccee builtins), the shell simulates a call to rreettuurrnn. - 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described + 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described in their descriptions in _b_a_s_h_(_1_)). - 55.. Function tracing is enabled: command substitu- + 55.. Function tracing is enabled: command substitu- tion, shell functions, and subshells invoked with (( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps. - 66.. Error tracing is enabled: command substitution, - shell functions, and subshells invoked with (( + 66.. Error tracing is enabled: command substitution, + shell functions, and subshells invoked with (( _c_o_m_m_a_n_d )) inherit the EERRRR trap. eexxttgglloobb If set, the extended pattern matching features described in _b_a_s_h_(_1_) under PPaatthhnnaammee EExxppaannssiioonn are enabled. eexxttqquuoottee - If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed - within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double + If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed + within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double quotes. This option is enabled by default. ffaaiillgglloobb - If set, patterns which fail to match filenames during + If set, patterns which fail to match filenames during pathname expansion result in an expansion error. ffoorrccee__ffiiggnnoorree - If set, the suffixes specified by the FFIIGGNNOORREE shell - variable cause words to be ignored when performing word + 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 in _b_a_s_h_(_1_) for a - description of FFIIGGNNOORREE. This option is enabled by de- + ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS in _b_a_s_h_(_1_) for a + description of FFIIGGNNOORREE. This option is enabled by de- fault. gglloobbaasscciiiirraannggeess - If set, range expressions used in pattern matching - bracket expressions (see PPaatttteerrnn MMaattcchhiinngg in _b_a_s_h_(_1_)) + If set, range expressions used in pattern matching + bracket expressions (see PPaatttteerrnn MMaattcchhiinngg in _b_a_s_h_(_1_)) behave as if in the traditional C locale when performing - comparisons. That is, the current locale's collating - sequence is not taken into account, so bb will not col- - late between AA and BB, and upper-case and lower-case + comparisons. That is, the current locale's collating + sequence is not taken into account, so bb will not col- + late between AA and BB, and upper-case and lower-case ASCII characters will collate together. gglloobbsskkiippddoottss - If set, pathname expansion will never match the file- + If set, pathname expansion will never match the file- 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 - and subdirectories. If the pattern is followed by a //, + text will match all files and zero or more directories + and subdirectories. If the pattern is followed by a //, only directories and subdirectories match. ggnnuu__eerrrrffmmtt @@ -1579,25 +1582,25 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS GNU error message format. hhiissttaappppeenndd - If set, the history list is appended to the file named + If set, the history list is appended to the file named by the value of the HHIISSTTFFIILLEE variable when the shell ex- its, rather than overwriting the file. hhiissttrreeeeddiitt - If set, and rreeaaddlliinnee is being used, a user is given the + If set, and rreeaaddlliinnee is being used, a user is given the opportunity to re-edit a failed history substitution. hhiissttvveerriiffyy - If set, and rreeaaddlliinnee is being used, the results of his- - tory substitution are not immediately passed to the - shell parser. Instead, the resulting line is loaded + If set, and rreeaaddlliinnee is being used, the results of his- + tory substitution are not immediately passed to the + shell parser. Instead, the resulting line is loaded into the rreeaaddlliinnee editing buffer, allowing further modi- fication. hhoossttccoommpplleettee If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to - perform hostname completion when a word containing a @@ - is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE in + perform hostname completion when a word containing a @@ + is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE in _b_a_s_h_(_1_)). This is enabled by default. hhuuppoonneexxiitt @@ -1605,23 +1608,23 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS active login shell exits. 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 + 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 enabled. iinntteerraaccttiivvee__ccoommmmeennttss If set, allow a word beginning with ## to cause that word - and all remaining characters on that line to be ignored + and all remaining characters on that line to be ignored in an interactive shell (see CCOOMMMMEENNTTSS in _b_a_s_h_(_1_)). This option is enabled by default. llaassttppiippee - If set, and job control is not active, the shell runs + If set, and job control is not active, the shell runs the last command of a pipeline not executed in the back- ground in the current shell environment. - lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line + lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line commands are saved to the history with embedded newlines rather than using semicolon separators where possible. @@ -1632,126 +1635,126 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS tribute is not inherited. llooccaallvvaarr__uunnsseett - If set, calling uunnsseett on local variables in previous - function scopes marks them so subsequent lookups find - them unset until that function returns. This is identi- - cal to the behavior of unsetting local variables at the + If set, calling uunnsseett on local variables in previous + function scopes marks them so subsequent lookups find + them unset until that function returns. This is identi- + cal to the behavior of unsetting local variables at the current function scope. llooggiinn__sshheellll - The shell sets this option if it is started as a login + The shell sets this option if it is started as a login shell (see IINNVVOOCCAATTIIOONN in _b_a_s_h_(_1_)). The value may not be changed. mmaaiillwwaarrnn - If set, and a file that bbaasshh is checking for mail has - been accessed since the last time it was checked, the - message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis- + If set, and a file that bbaasshh is checking for mail has + been accessed since the last time it was checked, the + message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis- played. nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn - If set, and rreeaaddlliinnee is being used, bbaasshh will not at- - tempt to search the PPAATTHH for possible completions when + If set, and rreeaaddlliinnee is being used, bbaasshh will not at- + tempt to search the PPAATTHH for possible completions when completion is attempted on an empty line. nnooccaasseegglloobb - If set, bbaasshh matches filenames in a case-insensitive + If set, bbaasshh matches filenames in a case-insensitive fashion when performing pathname expansion (see PPaatthhnnaammee EExxppaannssiioonn in _b_a_s_h_(_1_)). nnooccaasseemmaattcchh - If set, bbaasshh matches patterns in a case-insensitive + If set, bbaasshh matches patterns in a case-insensitive fashion when performing matching while executing ccaassee or [[[[ conditional commands, when performing pattern substi- - tution word expansions, or when filtering possible com- + tution word expansions, or when filtering possible com- pletions as part of programmable completion. nnooeexxppaanndd__ttrraannssllaattiioonn - If set, bbaasshh encloses the translated results of $"..." - quoting in single quotes instead of double quotes. If + If set, bbaasshh encloses the translated results of $"..." + quoting in single quotes instead of double quotes. If the string is not translated, this has no effect. nnuullllgglloobb If set, pathname expansion patterns which match no files - (see PPaatthhnnaammee EExxppaannssiioonn in _b_a_s_h_(_1_)) expand to nothing + (see PPaatthhnnaammee EExxppaannssiioonn in _b_a_s_h_(_1_)) expand to nothing and are removed, rather than expanding to themselves. ppaattssuubb__rreeppllaacceemmeenntt If set, bbaasshh expands occurrences of && in the replacement - string of pattern substitution to the text matched by - the pattern, as described under PPaarraammeetteerr EExxppaannssiioonn in + string of pattern substitution to the text matched by + the pattern, as described under PPaarraammeetteerr EExxppaannssiioonn in _b_a_s_h_(_1_). This option is enabled by default. pprrooggccoommpp If set, the programmable completion facilities (see PPrroo-- - ggrraammmmaabbllee CCoommpplleettiioonn in _b_a_s_h_(_1_)) are enabled. This op- + ggrraammmmaabbllee CCoommpplleettiioonn in _b_a_s_h_(_1_)) are enabled. This op- tion is enabled by default. pprrooggccoommpp__aalliiaass - If set, and programmable completion is enabled, bbaasshh - treats a command name that doesn't have any completions - as a possible alias and attempts alias expansion. If it - has an alias, bbaasshh attempts programmable completion us- + If set, and programmable completion is enabled, bbaasshh + treats a command name that doesn't have any completions + as a possible alias and attempts alias expansion. If it + has an alias, bbaasshh attempts programmable completion us- ing the command word resulting from the expanded alias. pprroommppttvvaarrss If set, prompt strings undergo parameter expansion, com- - mand substitution, arithmetic expansion, and quote re- - moval after being expanded as described in PPRROOMMPPTTIINNGG in + mand substitution, arithmetic expansion, and quote re- + moval after being expanded as described in PPRROOMMPPTTIINNGG in _b_a_s_h_(_1_). This option is enabled by default. rreessttrriicctteedd__sshheellll - The shell sets this option if it is started in re- - stricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL in _b_a_s_h_(_1_)). The - value may not be changed. This is not reset when the - startup files are executed, allowing the startup files + The shell sets this option if it is started in re- + stricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL in _b_a_s_h_(_1_)). The + value may not be changed. This is not reset when the + startup files are executed, allowing the startup files to discover whether or not a shell is restricted. sshhiifftt__vveerrbboossee - If set, the sshhiifftt builtin prints an error message when + If set, the sshhiifftt builtin prints an error message when the shift count exceeds the number of positional parame- ters. ssoouurrcceeppaatthh If set, the .. (ssoouurrccee) builtin uses the value of PPAATTHH to - find the directory containing the file supplied as an + find the directory containing the file supplied as an argument. This option is enabled by default. vvaarrrreeddiirr__cclloossee - If set, the shell automatically closes file descriptors + If set, the shell automatically closes file descriptors assigned using the _{_v_a_r_n_a_m_e_} redirection syntax (see RREE-- - DDIIRREECCTTIIOONN in _b_a_s_h_(_1_)) instead of leaving them open when + DDIIRREECCTTIIOONN in _b_a_s_h_(_1_)) instead of leaving them open when the command completes. xxppgg__eecchhoo - If set, the eecchhoo builtin expands backslash-escape se- - quences by default. If the ppoossiixx shell option is also + If set, the eecchhoo builtin expands backslash-escape se- + quences by default. If the ppoossiixx shell option is also enabled, eecchhoo does not interpret any options. ssuussppeenndd [--ff] - Suspend the execution of this shell until it receives a SSIIGGCCOONNTT - signal. A login shell, or a shell without job control enabled, - cannot be suspended; the --ff option can be used to override this - and force the suspension. The return status is 0 unless the - shell is a login shell or job control is not enabled and --ff is + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. A login shell, or a shell without job control enabled, + cannot be suspended; the --ff option can be used to override this + and force the suspension. The return status is 0 unless the + shell is a login shell or job control is not enabled and --ff is not supplied. tteesstt _e_x_p_r [[ _e_x_p_r ]] Return a status of 0 (true) or 1 (false) depending on the evalu- ation of the conditional expression _e_x_p_r. Each operator and op- - erand must be a separate argument. Expressions are composed of - the primaries described in _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- + erand must be a separate argument. Expressions are composed of + the primaries described in _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- SSIIOONNSS. tteesstt does not accept any options, nor does it accept and ignore an argument of ---- as signifying the end of options. - Expressions may be combined using the following operators, - listed in decreasing order of precedence. The evaluation de- - pends on the number of arguments; see below. Operator prece- + Expressions may be combined using the following operators, + listed in decreasing order of precedence. The evaluation de- + pends on the number of arguments; see below. Operator prece- dence is used when there are five or more arguments. !! _e_x_p_r True if _e_x_p_r is false. (( _e_x_p_r )) - Returns the value of _e_x_p_r. This may be used to override + Returns the value of _e_x_p_r. This may be used to override the normal precedence of operators. _e_x_p_r_1 -aa _e_x_p_r_2 True if both _e_x_p_r_1 and _e_x_p_r_2 are true. @@ -1768,161 +1771,161 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS null. 2 arguments If the first argument is !!, the expression is true if and - only if the second argument is null. If the first argu- - ment is one of the unary conditional operators listed in - _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + only if the second argument is null. If the first argu- + ment is one of the unary conditional operators listed in + _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is true if the unary test is true. If the first argument is not a valid unary conditional operator, the expression is false. 3 arguments The following conditions are applied in the order listed. - If the second argument is one of the binary conditional - operators listed in _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- - SSIIOONNSS, the result of the expression is the result of the - binary test using the first and third arguments as oper- - ands. The --aa and --oo operators are considered binary op- + If the second argument is one of the binary conditional + operators listed in _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- + SSIIOONNSS, the result of the expression is the result of the + binary test using the first and third arguments as oper- + ands. The --aa and --oo operators are considered binary op- erators when there are three arguments. If the first ar- - gument is !!, the value is the negation of the two-argu- - ment test using the second and third arguments. If the + gument is !!, the value is the negation of the two-argu- + ment test using the second and third arguments. If the first argument is exactly (( and the third argument is ex- - actly )), the result is the one-argument test of the sec- + actly )), the result is the one-argument test of the sec- ond argument. Otherwise, the expression is false. 4 arguments The following conditions are applied in the order listed. If the first argument is !!, the result is the negation of - the three-argument expression composed of the remaining - arguments. the two-argument test using the second and - third arguments. If the first argument is exactly (( and - the fourth argument is exactly )), the result is the two- - argument test of the second and third arguments. Other- + the three-argument expression composed of the remaining + arguments. the two-argument test using the second and + third arguments. If the first argument is exactly (( and + the fourth argument is exactly )), the result is the two- + argument test of the second and third arguments. Other- wise, the expression is parsed and evaluated according to precedence using the rules listed above. 5 or more arguments - The expression is parsed and evaluated according to + The expression is parsed and evaluated according to precedence using the rules listed above. If the shell is not in _p_o_s_i_x _m_o_d_e, when used with tteesstt or [[, the - << and >> operators sort lexicographically using ASCII ordering. - When the shell is in _p_o_s_i_x _m_o_d_e, these operators sort using the + << and >> operators sort lexicographically using ASCII ordering. + When the shell is in _p_o_s_i_x _m_o_d_e, these operators sort using the current locale. - ttiimmeess Print the accumulated user and system times for the shell and + ttiimmeess Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0. ttrraapp [--llpp] [[_a_c_t_i_o_n] _s_i_g_s_p_e_c ...] The _a_c_t_i_o_n is a command that is read and executed when the shell receives signal(s) _s_i_g_s_p_e_c. If _a_c_t_i_o_n is absent (and there is a - single _s_i_g_s_p_e_c) or --, each specified signal is reset to its - original disposition (the value it had upon entrance to the - shell). If _a_c_t_i_o_n is the null string the signal specified by - each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in- + single _s_i_g_s_p_e_c) or --, each specified signal is reset to its + original disposition (the value it had upon entrance to the + shell). If _a_c_t_i_o_n is the null string the signal specified by + each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in- vokes. - If no arguments are supplied, ttrraapp displays the actions associ- + If no arguments are supplied, ttrraapp displays the actions associ- ated with each trapped signal as a set of ttrraapp commands that can - be reused as shell input to restore the current signal disposi- - tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp - displays the actions associated with each _s_i_g_s_p_e_c or, if none + be reused as shell input to restore the current signal disposi- + tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp + displays the actions associated with each _s_i_g_s_p_e_c or, if none are supplied, for all trapped signals, as a set of ttrraapp commands - that can be reused as shell input to restore the current signal - dispositions. The --PP option behaves similarly, but displays - only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- - quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options to - ttrraapp may be used in a subshell environment (e.g., command sub- - stitution) and, as long as they are used before ttrraapp is used to - change a signal's handling, will display the state of its par- + that can be reused as shell input to restore the current signal + dispositions. The --PP option behaves similarly, but displays + only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- + quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options to + ttrraapp may be used in a subshell environment (e.g., command sub- + stitution) and, as long as they are used before ttrraapp is used to + change a signal's handling, will display the state of its par- ent's traps. - The --ll option causes ttrraapp to print a list of signal names and - their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal - name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names + The --ll option causes ttrraapp to print a list of signal names and + their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal + name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are case insensitive and the SSIIGG prefix is optional. - If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit - from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is + If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit + from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is executed before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, - _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, + _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, arithmetic _f_o_r command, and before the first command executes in - a shell function (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h_(_1_)). Refer to the - description of the eexxttddeebbuugg option to the sshhoopptt builtin for de- - tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, - the command _a_c_t_i_o_n is executed each time a shell function or a - script executed with the .. or ssoouurrccee builtins finishes execut- + a shell function (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h_(_1_)). Refer to the + description of the eexxttddeebbuugg option to the sshhoopptt builtin for de- + tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, + the command _a_c_t_i_o_n is executed each time a shell function or a + script executed with the .. or ssoouurrccee builtins finishes execut- ing. - If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n is executed whenever a + If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n is executed whenever a pipeline (which may consist of a single simple command), a list, or a compound command returns a non-zero exit status, subject to - the following conditions. The EERRRR trap is not executed if the + the following conditions. The EERRRR trap is not executed if the failed command is part of the command list immediately following - a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, + a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, part of a command executed in a &&&& or |||| list except the command - following the final &&&& or ||||, any command in a pipeline but the - last, or if the command's return value is being inverted using + following the final &&&& or ||||, any command in a pipeline but the + last, or if the command's return value is being inverted using !!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) op- tion. When the shell is not interactive, signals ignored upon entry to the shell cannot be trapped or reset. Interactive shells permit trapping signals ignored on entry. Trapped signals that are not - being ignored are reset to their original values in a subshell - or subshell environment when one is created. The return status + being ignored are reset to their original values in a subshell + or subshell environment when one is created. The return status is false if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true. ttrruuee Does nothing, returns a 0 status. ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] - With no options, indicate how each _n_a_m_e would be interpreted if + With no options, indicate how each _n_a_m_e would be interpreted if used as a command name. If the --tt option is used, ttyyppee prints a - string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or - _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, - builtin, or executable disk file, respectively. If the _n_a_m_e is - not found, then nothing is printed, and ttyyppee returns a non-zero - exit status. If the --pp option is used, ttyyppee either returns the - name of the executable file that would be found by searching - $$PPAATTHH if _n_a_m_e were specified as a command name, or nothing if - ``type -t name'' would not return _f_i_l_e. The --PP option forces a - PPAATTHH search for each _n_a_m_e, even if ``type -t name'' would not + string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or + _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, + builtin, or executable disk file, respectively. If the _n_a_m_e is + not found, then nothing is printed, and ttyyppee returns a non-zero + exit status. If the --pp option is used, ttyyppee either returns the + name of the executable file that would be found by searching + $$PPAATTHH if _n_a_m_e were specified as a command name, or nothing if + ``type -t name'' would not return _f_i_l_e. The --PP option forces a + PPAATTHH search for each _n_a_m_e, even if ``type -t name'' would not return _f_i_l_e. If a command is hashed, --pp and --PP print the hashed - value, which is not necessarily the file that appears first in - PPAATTHH. If the --aa option is used, ttyyppee prints all of the places - that contain a command named _n_a_m_e. This includes aliases, re- - served words, functions, and builtins, but the path search op- + value, which is not necessarily the file that appears first in + PPAATTHH. If the --aa option is used, ttyyppee prints all of the places + that contain a command named _n_a_m_e. This includes aliases, re- + served words, functions, and builtins, but the path search op- tions (--pp and --PP) can be supplied to restrict the output to exe- - cutable files. ttyyppee does not consult the table of hashed com- + cutable files. ttyyppee does not consult the table of hashed com- mands when using --aa with --pp, and only performs a PPAATTHH search for - _n_a_m_e. The --ff option suppresses shell function lookup, as with - the ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments + _n_a_m_e. The --ff option suppresses shell function lookup, as with + the ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments are found, false if any are not found. uulliimmiitt [--HHSS] --aa uulliimmiitt [--HHSS] [--bbccddeeffiikkllmmnnppqqrrssttuuvvxxPPRRTT [_l_i_m_i_t]] - Provides control over the resources available to the shell and - to processes started by it, on systems that allow such control. + Provides control over the resources available to the shell and + to processes started by it, on systems that allow such control. The --HH and --SS options specify that the hard or soft limit is set - for the given resource. A hard limit cannot be increased by a - non-root user once it is set; a soft limit may be increased up - to the value of the hard limit. If neither --HH nor --SS is speci- + for the given resource. A hard limit cannot be increased by a + non-root user once it is set; a soft limit may be increased up + to the value of the hard limit. If neither --HH nor --SS is speci- fied, both the soft and hard limits are set. The value of _l_i_m_i_t can be a number in the unit specified for the resource or one of the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the - current hard limit, the current soft limit, and no limit, re- - spectively. If _l_i_m_i_t is omitted, the current value of the soft + current hard limit, the current soft limit, and no limit, re- + spectively. If _l_i_m_i_t is omitted, the current value of the soft limit of the resource is printed, unless the --HH option is given. - When more than one resource is specified, the limit name and - unit, if appropriate, are printed before the value. Other op- + When more than one resource is specified, the limit name and + unit, if appropriate, are printed before the value. Other op- tions are interpreted as follows: --aa All current limits are reported; no limits are set --bb The maximum socket buffer size --cc The maximum size of core files created --dd The maximum size of a process's data segment --ee The maximum scheduling priority ("nice") - --ff The maximum size of files written by the shell and its + --ff The maximum size of files written by the shell and its children --ii The maximum number of pending signals --kk The maximum number of kqueues that may be allocated --ll The maximum size that may be locked into memory - --mm The maximum resident set size (many systems do not honor + --mm The maximum resident set size (many systems do not honor this limit) --nn The maximum number of open file descriptors (most systems do not allow this value to be set) @@ -1931,134 +1934,134 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS --rr The maximum real-time scheduling priority --ss The maximum stack size --tt The maximum amount of cpu time in seconds - --uu The maximum number of processes available to a single + --uu The maximum number of processes available to a single user - --vv The maximum amount of virtual memory available to the + --vv The maximum amount of virtual memory available to the shell and, on some systems, to its children --xx The maximum number of file locks --PP The maximum number of pseudoterminals - --RR The maximum time a real-time process can run before + --RR The maximum time a real-time process can run before blocking, in microseconds --TT The maximum number of threads - If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the - new value of the specified resource. If no option is given, - then --ff is assumed. Values are in 1024-byte increments, except - for --tt, which is in seconds; --RR, which is in microseconds; --pp, - which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and - --uu, which are unscaled values; and, when in posix mode, --cc and - --ff, which are in 512-byte increments. The return status is 0 - unless an invalid option or argument is supplied, or an error + If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the + new value of the specified resource. If no option is given, + then --ff is assumed. Values are in 1024-byte increments, except + for --tt, which is in seconds; --RR, which is in microseconds; --pp, + which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and + --uu, which are unscaled values; and, when in posix mode, --cc and + --ff, which are in 512-byte increments. The return status is 0 + unless an invalid option or argument is supplied, or an error occurs while setting a new limit. uummaasskk [--pp] [--SS] [_m_o_d_e] The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with - a digit, it is interpreted as an octal number; otherwise it is - interpreted as a symbolic mode mask similar to that accepted by - _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is - printed. The --SS option causes the mask to be printed in sym- - bolic form; the default output is an octal number. If the --pp + a digit, it is interpreted as an octal number; otherwise it is + interpreted as a symbolic mode mask similar to that accepted by + _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is + printed. The --SS option causes the mask to be printed in sym- + bolic form; the default output is an octal number. If the --pp option is supplied, and _m_o_d_e is omitted, the output is in a form that may be reused as input. The return status is 0 if the mode - was successfully changed or if no _m_o_d_e argument was supplied, + was successfully changed or if no _m_o_d_e argument was supplied, and false otherwise. uunnaalliiaass [-aa] [_n_a_m_e ...] - Remove each _n_a_m_e from the list of defined aliases. If --aa is - supplied, all alias definitions are removed. The return value + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, all alias definitions are removed. The return value is true unless a supplied _n_a_m_e is not a defined alias. uunnsseett [-ffvv] [-nn] [_n_a_m_e ...] - For each _n_a_m_e, remove the corresponding variable or function. + For each _n_a_m_e, remove the corresponding variable or function. If the --vv option is given, each _n_a_m_e refers to a shell variable, - and that variable is removed. Read-only variables may not be - unset. If --ff is specified, each _n_a_m_e refers to a shell func- - tion, and the function definition is removed. If the --nn option - is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, - _n_a_m_e will be unset rather than the variable it references. --nn - has no effect if the --ff option is supplied. If no options are - supplied, each _n_a_m_e refers to a variable; if there is no vari- - able by that name, a function with that name, if any, is unset. - Each unset variable or function is removed from the environment - passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS, + and that variable is removed. Read-only variables may not be + unset. If --ff is specified, each _n_a_m_e refers to a shell func- + tion, and the function definition is removed. If the --nn option + is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, + _n_a_m_e will be unset rather than the variable it references. --nn + has no effect if the --ff option is supplied. If no options are + supplied, each _n_a_m_e refers to a variable; if there is no vari- + able by that name, a function with that name, if any, is unset. + Each unset variable or function is removed from the environment + passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS, BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBBSSHHEELLLL, BBAASSHHPPIIDD, - CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- - NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are + CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- + NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are unset, they lose their special properties, even if they are sub- sequently reset. The exit status is true unless a _n_a_m_e is read- only or may not be unset. wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d _._._.] Wait for each specified child process and return its termination - status. Each _i_d may be a process ID or a job specification; if - a job spec is given, all processes in that job's pipeline are - waited for. If _i_d is not given, wwaaiitt waits for all running - background jobs and the last-executed process substitution, if + status. Each _i_d may be a process ID or a job specification; if + a job spec is given, all processes in that job's pipeline are + waited for. If _i_d is not given, wwaaiitt waits for all running + background jobs and the last-executed process substitution, if its process id is the same as $$!!, and the return status is zero. - If the --nn option is supplied, wwaaiitt waits for a single job from + If the --nn option is supplied, wwaaiitt waits for a single job from the list of _i_ds or, if no _i_ds are supplied, any job, to complete - and returns its exit status. If none of the supplied arguments + and returns its exit status. If none of the supplied arguments is a child of the shell, or if no arguments are supplied and the - shell has no unwaited-for children, the exit status is 127. If - the --pp option is supplied, the process or job identifier of the - job for which the exit status is returned is assigned to the - variable _v_a_r_n_a_m_e named by the option argument. The variable - will be unset initially, before any assignment. This is useful - only when the --nn option is supplied. Supplying the --ff option, - when job control is enabled, forces wwaaiitt to wait for _i_d to ter- + shell has no unwaited-for children, the exit status is 127. If + the --pp option is supplied, the process or job identifier of the + job for which the exit status is returned is assigned to the + variable _v_a_r_n_a_m_e named by the option argument. The variable + will be unset initially, before any assignment. This is useful + only when the --nn option is supplied. Supplying the --ff option, + when job control is enabled, forces wwaaiitt to wait for _i_d to ter- minate before returning its status, instead of returning when it - changes status. If _i_d specifies a non-existent process or job, - the return status is 127. If wwaaiitt is interrupted by a signal, - the return status will be greater than 128, as described under - SSIIGGNNAALLSS in _b_a_s_h_(_1_). Otherwise, the return status is the exit + changes status. If _i_d specifies a non-existent process or job, + the return status is 127. If wwaaiitt is interrupted by a signal, + the return status will be greater than 128, as described under + SSIIGGNNAALLSS in _b_a_s_h_(_1_). Otherwise, the return status is the exit status of the last process or job waited for. SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE - Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- - fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322, - ccoommppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibil- - ity level -- each option is mutually exclusive. The compatibility - level is intended to allow users to select behavior from previous ver- - sions that is incompatible with newer versions while they migrate - scripts to use current features and behavior. It's intended to be a + Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- + fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322, + ccoommppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibil- + ity level -- each option is mutually exclusive. The compatibility + level is intended to allow users to select behavior from previous ver- + sions that is incompatible with newer versions while they migrate + scripts to use current features and behavior. It's intended to be a temporary solution. - This section does not mention behavior that is standard for a particu- - lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the - regexp matching operator quotes special regexp characters in the word, + This section does not mention behavior that is standard for a particu- + lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the + regexp matching operator quotes special regexp characters in the word, which is default behavior in bash-3.2 and subsequent versions). - If a user enables, say, ccoommppaatt3322, it may affect the behavior of other - compatibility levels up to and including the current compatibility - level. The idea is that each compatibility level controls behavior - that changed in that version of bbaasshh, but that behavior may have been - present in earlier versions. For instance, the change to use locale- - based comparisons with the [[[[ command came in bash-4.1, and earlier + If a user enables, say, ccoommppaatt3322, it may affect the behavior of other + compatibility levels up to and including the current compatibility + level. The idea is that each compatibility level controls behavior + that changed in that version of bbaasshh, but that behavior may have been + present in earlier versions. For instance, the change to use locale- + based comparisons with the [[[[ command came in bash-4.1, and earlier versions used ASCII-based comparisons, so enabling ccoommppaatt3322 will enable - ASCII-based comparisons as well. That granularity may not be suffi- - cient for all uses, and as a result users should employ compatibility - levels carefully. Read the documentation for a particular feature to + ASCII-based comparisons as well. That granularity may not be suffi- + cient for all uses, and as a result users should employ compatibility + levels carefully. Read the documentation for a particular feature to find out the current behavior. - Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as- + Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as- signed to this variable (a decimal version number like 4.2, or an inte- - ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com- + ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com- patibility level. - Starting with bash-4.4, bbaasshh has begun deprecating older compatibility - levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM-- + Starting with bash-4.4, bbaasshh has begun deprecating older compatibility + levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM-- PPAATT. - Bash-5.0 is the final version for which there will be an individual - shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on - bash-5.0 and later versions. + Bash-5.0 was the final version for which there will be an individual + shopt option for the previous version. Users should control the compat- + ibility level with BBAASSHH__CCOOMMPPAATT. - The following table describes the behavior changes controlled by each + The following table describes the behavior changes controlled by each compatibility level setting. The ccoommppaatt_N_N tag is used as shorthand for setting the compatibility level to _N_N using one of the following mecha- - nisms. For versions prior to bash-5.0, the compatibility level may be - set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and - later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- + nisms. For versions prior to bash-5.0, the compatibility level may be + set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and + later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- quired for bash-5.1 and later versions. ccoommppaatt3311 @@ -2066,110 +2069,110 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE ator (=~) has no special effect ccoommppaatt3322 - +o the << and >> operators to the [[[[ command do not consider + +o the << and >> operators to the [[[[ command do not consider the current locale when comparing strings; they use ASCII ordering. ccoommppaatt4400 - +o the << and >> operators to the [[[[ command do not consider + +o the << and >> operators to the [[[[ command do not consider the current locale when comparing strings; they use ASCII ordering. BBaasshh versions prior to bash-4.1 use ASCII col- - lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current + lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current locale's collation sequence and _s_t_r_c_o_l_l(3). ccoommppaatt4411 - +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still + +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still be recognized as a reserved word (this is POSIX interpre- tation 267) +o in _p_o_s_i_x mode, the parser requires that an even number of - single quotes occur in the _w_o_r_d portion of a double- - quoted parameter expansion and treats them specially, so - that characters within the single quotes are considered + single quotes occur in the _w_o_r_d portion of a double- + quoted parameter expansion and treats them specially, so + that characters within the single quotes are considered quoted (this is POSIX interpretation 221) ccoommppaatt4422 +o the replacement string in double-quoted pattern substitu- - tion does not undergo quote removal, as it does in ver- + tion does not undergo quote removal, as it does in ver- sions after bash-4.2 - +o in posix mode, single quotes are considered special when - expanding the _w_o_r_d portion of a double-quoted parameter - expansion and can be used to quote a closing brace or - other special character (this is part of POSIX interpre- - tation 221); in later versions, single quotes are not + +o in posix mode, single quotes are considered special when + expanding the _w_o_r_d portion of a double-quoted parameter + expansion and can be used to quote a closing brace or + other special character (this is part of POSIX interpre- + tation 221); in later versions, single quotes are not special within double-quoted word expansions ccoommppaatt4433 - +o the shell does not print a warning message if an attempt - is made to use a quoted compound assignment as an argu- - ment to declare (e.g., declare -a foo='(1 2)'). Later + +o the shell does not print a warning message if an attempt + is made to use a quoted compound assignment as an argu- + ment to declare (e.g., declare -a foo='(1 2)'). Later versions warn that this usage is deprecated - +o word expansion errors are considered non-fatal errors - that cause the current command to fail, even in posix - mode (the default behavior is to make them fatal errors + +o word expansion errors are considered non-fatal errors + that cause the current command to fail, even in posix + mode (the default behavior is to make them fatal errors that cause the shell to exit) - +o when executing a shell function, the loop state + +o when executing a shell function, the loop state (while/until/etc.) is not reset, so bbrreeaakk or ccoonnttiinnuuee in that function will break or continue loops in the calling - context. Bash-4.4 and later reset the loop state to pre- + context. Bash-4.4 and later reset the loop state to pre- vent this ccoommppaatt4444 - +o the shell sets up the values used by BBAASSHH__AARRGGVV and - BBAASSHH__AARRGGCC so they can expand to the shell's positional + +o the shell sets up the values used by BBAASSHH__AARRGGVV and + BBAASSHH__AARRGGCC so they can expand to the shell's positional parameters even if extended debugging mode is not enabled - +o a subshell inherits loops from its parent context, so - bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. - Bash-5.0 and later reset the loop state to prevent the + +o a subshell inherits loops from its parent context, so + bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. + Bash-5.0 and later reset the loop state to prevent the exit - +o variable assignments preceding builtins like eexxppoorrtt and + +o variable assignments preceding builtins like eexxppoorrtt and rreeaaddoonnllyy that set attributes continue to affect variables with the same name in the calling environment even if the shell is not in posix mode ccoommppaatt5500 - +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- + +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- duce slightly more randomness. If the shell compatibility - level is set to 50 or lower, it reverts to the method - from bash-5.0 and previous versions, so seeding the ran- - dom number generator by assigning a value to RRAANNDDOOMM will + level is set to 50 or lower, it reverts to the method + from bash-5.0 and previous versions, so seeding the ran- + dom number generator by assigning a value to RRAANNDDOOMM will produce the same sequence as in bash-5.0 - +o If the command hash table is empty, bash versions prior - to bash-5.1 printed an informational message to that ef- - fect, even when producing output that can be reused as - input. Bash-5.1 suppresses that message when the --ll op- + +o If the command hash table is empty, bash versions prior + to bash-5.1 printed an informational message to that ef- + fect, even when producing output that can be reused as + input. Bash-5.1 suppresses that message when the --ll op- tion is supplied. ccoommppaatt5511 - +o The uunnsseett builtin treats attempts to unset array sub- - scripts @@ and ** differently depending on whether the ar- - ray is indexed or associative, and differently than in + +o The uunnsseett builtin treats attempts to unset array sub- + scripts @@ and ** differently depending on whether the ar- + ray is indexed or associative, and differently than in previous versions. +o arithmetic commands ( ((...)) ) and the expressions in an arithmetic for statement can be expanded more than once - +o expressions used as arguments to arithmetic operators in + +o expressions used as arguments to arithmetic operators in the [[[[ conditional command can be expanded more than once - +o the expressions in substring parameter brace expansion + +o the expressions in substring parameter brace expansion can be expanded more than once - +o the expressions in the $(( ... )) word expansion can be + +o the expressions in the $(( ... )) word expansion can be expanded more than once - +o arithmetic expressions used as indexed array subscripts + +o arithmetic expressions used as indexed array subscripts can be expanded more than once - +o tteesstt --vv, when given an argument of AA[[@@]], where AAPP iiss aann + +o tteesstt --vv, when given an argument of AA[[@@]], where AAPP iiss aann eexxiissttiinngg aassssoocciiaattiivvee aarrrraayy,, wwiillll rreettuurrnn ttrruuee iiff tthhee aarrrraayy - hhaass aannyy sseett eelleemmeennttss.. BBaasshh--55..22 wwiillll llooookk ffoorr aanndd rreeppoorrtt + hhaass aannyy sseett eelleemmeennttss.. BBaasshh--55..22 wwiillll llooookk ffoorr aanndd rreeppoorrtt oonn aa kkeeyy nnaammeedd @@.. ++oo the ${_p_a_r_a_m_e_t_e_r[[::]]==_v_a_l_u_e} word expansion will return - _v_a_l_u_e, before any variable-specific transformations have + _v_a_l_u_e, before any variable-specific transformations have been performed (e.g., converting to lowercase). Bash-5.2 will return the final value assigned to the variable. - +o Parsing command substitutions will behave as if extended + +o Parsing command substitutions will behave as if extended globbing (see the description of the sshhoopptt builtin above) - is enabled, so that parsing a command substitution con- + is enabled, so that parsing a command substitution con- taining an extglob pattern (say, as part of a shell func- - tion) will not fail. This assumes the intent is to en- - able extglob before the command is executed and word ex- - pansions are performed. It will fail at word expansion - time if extglob hasn't been enabled by the time the com- + tion) will not fail. This assumes the intent is to en- + able extglob before the command is executed and word ex- + pansions are performed. It will fail at word expansion + time if extglob hasn't been enabled by the time the com- mand is executed. SSEEEE AALLSSOO diff --git a/doc/version.texi b/doc/version.texi index cecc569e0..613fa956b 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -2,10 +2,10 @@ Copyright (C) 1988-2023 Free Software Foundation, Inc. @end ignore -@set LASTCHANGE Thu Dec 14 11:05:10 EST 2023 +@set LASTCHANGE Thu Dec 21 12:07:50 EST 2023 @set EDITION 5.3 @set VERSION 5.3 -@set UPDATED 14 December 2023 +@set UPDATED 21 December 2023 @set UPDATED-MONTH December 2023 diff --git a/lib/readline/doc/readline.3 b/lib/readline/doc/readline.3 index 8b0ba1086..9977ad30f 100644 --- a/lib/readline/doc/readline.3 +++ b/lib/readline/doc/readline.3 @@ -6,9 +6,9 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Mon Jul 17 16:46:23 EDT 2023 +.\" Last Change: Thu Dec 21 09:29:52 EST 2023 .\" -.TH READLINE 3 "2023 July 17" "GNU Readline 8.3" +.TH READLINE 3 "2023 December 21" "GNU Readline 8.3" .\" .\" File Name macro. This used to be `.PN', for Path Name, .\" but Sun doesn't seem to like that very much. @@ -1464,15 +1464,17 @@ VI Insert Mode functions "C-I" complete "C-J" accept-line "C-M" accept-line +"C-N" menu-complete +"C-P" menu-complete-backward "C-R" reverse-search-history "C-S" forward-search-history "C-T" transpose-chars "C-U" unix-line-discard "C-V" quoted-insert -"C-W" unix-word-rubout +"C-W" vi-unix-word-rubout "C-Y" yank "C-[" vi-movement-mode -"C-_" undo +"C-_" vi-undo "\^ " to "\(ti" self-insert "C-?" backward-delete-char .PP @@ -1494,7 +1496,7 @@ VI Command Mode functions "C-T" transpose-chars "C-U" unix-line-discard "C-V" quoted-insert -"C-W" unix-word-rubout +"C-W" vi-unix-word-rubout "C-Y" yank "C-_" vi-undo "\^ " forward-char @@ -1528,7 +1530,7 @@ VI Command Mode functions "T" vi-char-search "U" revert-line "W" vi-next-word -"X" backward-delete-char +"X" vi-rubout "Y" vi-yank-to "\e" vi-complete "\(ha" vi-first-print @@ -1543,7 +1545,7 @@ VI Command Mode functions "h" backward-char "i" vi-insertion-mode "j" next-history -"k" prev-history +"k" previous-history "l" forward-char "m" vi-set-mark "n" vi-search-again diff --git a/lib/readline/doc/rluser.texi b/lib/readline/doc/rluser.texi index 72d951aa7..3793d8133 100644 --- a/lib/readline/doc/rluser.texi +++ b/lib/readline/doc/rluser.texi @@ -2161,7 +2161,8 @@ matches were generated. @end example Specify how arguments to each @var{name} should be completed. -If the @option{-p} option is supplied, or if no options are supplied, existing +If the @option{-p} option is supplied, or if no options or @var{name}s +are supplied, existing completion specifications are printed in a way that allows them to be reused as input. The @option{-r} option removes a completion specification for diff --git a/lib/readline/readline.h b/lib/readline/readline.h index d300e6a0e..f8c356e50 100644 --- a/lib/readline/readline.h +++ b/lib/readline/readline.h @@ -39,9 +39,9 @@ extern "C" { #endif /* Hex-encoded Readline version number. */ -#define RL_READLINE_VERSION 0x0802 /* Readline 8.2 */ +#define RL_READLINE_VERSION 0x0803 /* Readline 8.3 */ #define RL_VERSION_MAJOR 8 -#define RL_VERSION_MINOR 2 +#define RL_VERSION_MINOR 3 /* Readline data structures. */ diff --git a/print_cmd.c b/print_cmd.c index 2b33f1970..201824eab 100644 --- a/print_cmd.c +++ b/print_cmd.c @@ -585,7 +585,17 @@ xtrace_print_word_list (WORD_LIST *list, int xtflags) static void command_print_word_list (WORD_LIST *list, char *separator) { - _print_word_list (list, separator, cprintf); + WORD_LIST *nlist; + + /* A start at removing CTLESC from commands that haven't been expanded. */ + if (pretty_print_mode) + { + nlist = list ? dequote_list (list) : list; + _print_word_list (nlist, separator, cprintf); + /* we're just pretty-printing, so this can be destructive */ + } + else + _print_word_list (list, separator, cprintf); } void @@ -645,7 +655,12 @@ print_arith_for_command (ARITH_FOR_COM *arith_for_command) void print_select_command_head (SELECT_COM *select_command) { - cprintf ("select %s in ", select_command->name->word); + WORD_DESC *w; + + w = (pretty_print_mode) ? dequote_word (select_command->name) : select_command->name; + /* we're just pretty-printing, so this can be destructive */ + + cprintf ("select %s in ", w->word); command_print_word_list (select_command->map_list, " "); } @@ -715,7 +730,12 @@ print_group_command (GROUP_COM *group_command) void print_case_command_head (CASE_COM *case_command) { - cprintf ("case %s in ", case_command->word->word); + WORD_DESC *w; + + w = (pretty_print_mode) ? dequote_word (case_command->word) : case_command->word; + /* we're just pretty-printing, so this can be destructive */ + + cprintf ("case %s in ", w->word); } void @@ -1288,16 +1308,20 @@ print_function_def (FUNCTION_DEF *func) { COMMAND *cmdcopy; REDIRECT *func_redirects; + WORD_DESC *w; + + w = pretty_print_mode ? dequote_word (func->name) : func->name; + /* we're just pretty-printing, so this can be destructive */ func_redirects = NULL; /* When in posix mode, print functions as posix specifies them, but prefix `function' to words that are not valid POSIX identifiers. */ if (posixly_correct == 0) - cprintf ("function %s () \n", func->name->word); - else if (valid_function_name (func->name->word, posixly_correct) == 0) - cprintf ("function %s () \n", func->name->word); + cprintf ("function %s () \n", w->word); + else if (valid_function_name (w->word, posixly_correct) == 0) + cprintf ("function %s () \n", w->word); else - cprintf ("%s () \n", func->name->word); + cprintf ("%s () \n", w->word); begin_unwind_frame ("function-def"); add_unwind_protect (uw_reset_locals, 0); diff --git a/shell.c b/shell.c index 8f4c34bd1..9a9798902 100644 --- a/shell.c +++ b/shell.c @@ -196,8 +196,8 @@ int have_devfd = HAVE_DEV_FD; int have_devfd = 0; #endif -/* The name of the .(shell)rc file. */ -static char *bashrc_file = DEFAULT_BASHRC; +/* The name of the .(shell)rc file, DEFAULT_BASHRC is sourced by default */ +static char *bashrc_file; /* Non-zero means to act more like the Bourne shell on startup. */ static int act_like_sh; @@ -321,6 +321,8 @@ static void add_shopt_to_alist (char *, int); static void run_shopt_alist (void); static void execute_env_file (char *); +static void execute_profile_file (void); +static void execute_bashrc_file (void); static void run_startup_files (void); static int open_shell_script (char *); static void set_bash_input (void); @@ -1090,6 +1092,7 @@ set_exit_status (int s) */ static void + execute_env_file (char *env_file) { char *fn; @@ -1103,6 +1106,50 @@ execute_env_file (char *env_file) } } +/* Execute /etc/profile and one of the personal login shell initialization files. */ +static void +execute_profile_file (void) +{ + maybe_execute_file (SYS_PROFILE, 1); + + if (act_like_sh) /* sh */ + maybe_execute_file ("~/.profile", 1); + else if ((maybe_execute_file ("~/.bash_profile", 1) == 0) && + (maybe_execute_file ("~/.bash_login", 1) == 0)) /* bash */ + maybe_execute_file ("~/.profile", 1); +} + +/* Return the name of the default interactive shell startup file. We just + return the name of the historical bash startup file, but we could look + at a BASHRC variable or some more elaborate scheme. */ +static inline char * +find_bashrc_file (void) +{ + return DEFAULT_BASHRC; +} + +static void +execute_bashrc_file (void) +{ +#ifdef SYS_BASHRC +# if defined (__OPENNT) + maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); +# else + maybe_execute_file (SYS_BASHRC, 1); +# endif +#endif + + if (bashrc_file) + maybe_execute_file (bashrc_file, 1); + else + { + char *fn; + + if (fn = find_bashrc_file ()) + maybe_execute_file (fn, 1); /* don't have to free this yet */ + } +} + static void run_startup_files (void) { @@ -1111,7 +1158,7 @@ run_startup_files (void) #endif int sourced_login, run_by_ssh; -#if 1 /* TAG:bash-5.3 andrew.gregory.8@gmail.com 2/21/2022 */ + /* TAG:bash-5.3 andrew.gregory.8@gmail.com 2/21/2022 */ /* get the rshd/sshd case out of the way first. */ if (interactive_shell == 0 && no_rc == 0 && login_shell == 0 && act_like_sh == 0 && command_execution_string && shell_level < 2) @@ -1121,7 +1168,6 @@ run_startup_files (void) (find_variable ("SSH2_CLIENT") != (SHELL_VAR *)0); #else run_by_ssh = 0; -#endif #endif ssh_reading_startup_files = 0; @@ -1134,14 +1180,7 @@ run_startup_files (void) #endif { ssh_reading_startup_files = 1; -#ifdef SYS_BASHRC -# if defined (__OPENNT) - maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); -# else - maybe_execute_file (SYS_BASHRC, 1); -# endif -#endif - maybe_execute_file (bashrc_file, 1); + execute_bashrc_file (); ssh_reading_startup_files = 0; return; } @@ -1170,15 +1209,7 @@ run_startup_files (void) /* Execute /etc/profile and one of the personal login shell initialization files. */ if (no_profile == 0) - { - maybe_execute_file (SYS_PROFILE, 1); - - if (act_like_sh) /* sh */ - maybe_execute_file ("~/.profile", 1); - else if ((maybe_execute_file ("~/.bash_profile", 1) == 0) && - (maybe_execute_file ("~/.bash_login", 1) == 0)) /* bash */ - maybe_execute_file ("~/.profile", 1); - } + execute_profile_file (); sourced_login = 1; } @@ -1203,32 +1234,13 @@ run_startup_files (void) /* We don't execute .bashrc for login shells. */ no_rc++; - /* Execute /etc/profile and one of the personal login shell - initialization files. */ if (no_profile == 0) - { - maybe_execute_file (SYS_PROFILE, 1); - - if (act_like_sh) /* sh */ - maybe_execute_file ("~/.profile", 1); - else if ((maybe_execute_file ("~/.bash_profile", 1) == 0) && - (maybe_execute_file ("~/.bash_login", 1) == 0)) /* bash */ - maybe_execute_file ("~/.profile", 1); - } + execute_profile_file (); } /* bash */ if (act_like_sh == 0 && no_rc == 0) - { -#ifdef SYS_BASHRC -# if defined (__OPENNT) - maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); -# else - maybe_execute_file (SYS_BASHRC, 1); -# endif -#endif - maybe_execute_file (bashrc_file, 1); - } + execute_bashrc_file (); /* sh */ else if (act_like_sh && privileged_mode == 0 && sourced_env++ == 0) execute_env_file (get_string_value ("ENV")); @@ -2009,7 +2021,7 @@ shell_reinitialize (void) /* Ensure that the default startup file is used. (Except that we don't execute this file for reinitialized shells). */ - bashrc_file = DEFAULT_BASHRC; + bashrc_file = NULL; /* Delete all variables and functions. They will be reinitialized when the environment is parsed. */ diff --git a/tests/errors.right b/tests/errors.right index 83057a98a..9b760de3c 100644 --- a/tests/errors.right +++ b/tests/errors.right @@ -45,106 +45,100 @@ exec: usage: exec [-cl] [-a name] [command [argument ...]] [redirection ...] hash: usage: hash [-lr] [-p pathname] [-dt] [name ...] ./errors.tests: line 153: hash: -d: option requires an argument ./errors.tests: line 157: hash: hashing disabled -./errors.tests: line 160: export: `AA[4]': not a valid identifier -./errors.tests: line 161: readonly: `AA[4]': not a valid identifier -./errors.tests: line 162: export: `invalid-var=4': not a valid identifier -./errors.tests: line 163: readonly: `invalid-var=4': not a valid identifier -./errors.tests: line 164: export: `invalid-var': not a valid identifier -./errors.tests: line 165: readonly: `invalid-var': not a valid identifier -./errors.tests: line 168: unset: [-2]: bad array subscript -./errors.tests: line 172: AA: readonly variable -./errors.tests: line 176: AA: readonly variable -./errors.tests: line 184: shift: 5: shift count out of range -./errors.tests: line 185: shift: -2: shift count out of range -./errors.tests: line 186: shift: 5: shift count out of range -./errors.tests: line 187: shift: -2: shift count out of range -./errors.tests: line 190: shopt: no_such_option: invalid shell option name -./errors.tests: line 191: shopt: no_such_option: invalid shell option name -./errors.tests: line 192: shopt: no_such_option: invalid option name -./errors.tests: line 195: umask: 09: octal number out of range -./errors.tests: line 196: umask: `:': invalid symbolic mode character -./errors.tests: line 197: umask: `:': invalid symbolic mode operator -./errors.tests: line 200: umask: -i: invalid option +./errors.tests: line 160: unset: [-2]: bad array subscript +./errors.tests: line 164: AA: readonly variable +./errors.tests: line 168: AA: readonly variable +./errors.tests: line 176: shift: 5: shift count out of range +./errors.tests: line 177: shift: -2: shift count out of range +./errors.tests: line 178: shift: 5: shift count out of range +./errors.tests: line 179: shift: -2: shift count out of range +./errors.tests: line 182: shopt: no_such_option: invalid shell option name +./errors.tests: line 183: shopt: no_such_option: invalid shell option name +./errors.tests: line 184: shopt: no_such_option: invalid option name +./errors.tests: line 187: umask: 09: octal number out of range +./errors.tests: line 188: umask: `:': invalid symbolic mode character +./errors.tests: line 189: umask: `:': invalid symbolic mode operator +./errors.tests: line 192: umask: -i: invalid option umask: usage: umask [-p] [-S] [mode] -./errors.tests: line 204: umask: `p': invalid symbolic mode character -./errors.tests: line 213: VAR: readonly variable -./errors.tests: line 216: declare: VAR: readonly variable -./errors.tests: line 217: declare: VAR: readonly variable -./errors.tests: line 219: declare: unset: not found -./errors.tests: line 222: VAR: readonly variable +./errors.tests: line 196: umask: `p': invalid symbolic mode character +./errors.tests: line 205: VAR: readonly variable +./errors.tests: line 208: declare: VAR: readonly variable +./errors.tests: line 209: declare: VAR: readonly variable +./errors.tests: line 211: declare: unset: not found +./errors.tests: line 214: VAR: readonly variable comsub: -c: line 1: syntax error near unexpected token `)' comsub: -c: line 1: `: $( for z in 1 2 3; do )' comsub: -c: line 1: syntax error near unexpected token `done' comsub: -c: line 1: `: $( for z in 1 2 3; done )' -./errors.tests: line 229: cd: HOME not set -./errors.tests: line 230: cd: /tmp/xyz.bash: No such file or directory -./errors.tests: line 232: cd: OLDPWD not set -./errors.tests: line 233: cd: /bin/sh: Not a directory -./errors.tests: line 235: cd: /tmp/cd-notthere: No such file or directory -./errors.tests: line 237: cd: too many arguments +./errors.tests: line 221: cd: HOME not set +./errors.tests: line 222: cd: /tmp/xyz.bash: No such file or directory +./errors.tests: line 224: cd: OLDPWD not set +./errors.tests: line 225: cd: /bin/sh: Not a directory +./errors.tests: line 227: cd: /tmp/cd-notthere: No such file or directory +./errors.tests: line 229: cd: too many arguments bash: line 1: PWD: readonly variable 1 bash: line 1: OLDPWD: readonly variable 1 -./errors.tests: line 244: .: filename argument required +./errors.tests: line 236: .: filename argument required .: usage: . filename [arguments] -./errors.tests: line 245: source: filename argument required +./errors.tests: line 237: source: filename argument required source: usage: source filename [arguments] -./errors.tests: line 248: .: -i: invalid option +./errors.tests: line 240: .: -i: invalid option .: usage: . filename [arguments] -./errors.tests: line 251: set: -q: invalid option +./errors.tests: line 243: set: -q: invalid option set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...] -./errors.tests: line 254: enable: sh: not a shell builtin -./errors.tests: line 254: enable: bash: not a shell builtin -./errors.tests: line 257: shopt: cannot set and unset shell options simultaneously -./errors.tests: line 260: read: -x: invalid option +./errors.tests: line 246: enable: sh: not a shell builtin +./errors.tests: line 246: enable: bash: not a shell builtin +./errors.tests: line 249: shopt: cannot set and unset shell options simultaneously +./errors.tests: line 252: read: -x: invalid option read: usage: read [-Eers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...] -./errors.tests: line 263: read: var: invalid timeout specification -./errors.tests: line 266: read: `/bin/sh': not a valid identifier -./errors.tests: line 267: read: `/bin/sh': not a valid identifier -./errors.tests: line 268: read: `invalid-name': not a valid identifier -./errors.tests: line 271: VAR: readonly variable -./errors.tests: line 274: read: XX: invalid file descriptor specification -./errors.tests: line 275: read: 42: invalid file descriptor: Bad file descriptor -./errors.tests: line 278: mapfile: XX: invalid file descriptor specification -./errors.tests: line 279: mapfile: 42: invalid file descriptor: Bad file descriptor -./errors.tests: line 283: mapfile: empty array variable name -./errors.tests: line 284: mapfile: `invalid-var': not a valid identifier -./errors.tests: line 287: readonly: -x: invalid option +./errors.tests: line 255: read: var: invalid timeout specification +./errors.tests: line 258: read: `/bin/sh': not a valid identifier +./errors.tests: line 259: read: `/bin/sh': not a valid identifier +./errors.tests: line 260: read: `invalid-name': not a valid identifier +./errors.tests: line 263: VAR: readonly variable +./errors.tests: line 266: read: XX: invalid file descriptor specification +./errors.tests: line 267: read: 42: invalid file descriptor: Bad file descriptor +./errors.tests: line 270: mapfile: XX: invalid file descriptor specification +./errors.tests: line 271: mapfile: 42: invalid file descriptor: Bad file descriptor +./errors.tests: line 275: mapfile: empty array variable name +./errors.tests: line 276: mapfile: `invalid-var': not a valid identifier +./errors.tests: line 279: readonly: -x: invalid option readonly: usage: readonly [-aAf] [name[=value] ...] or readonly -p -./errors.tests: line 290: eval: -i: invalid option +./errors.tests: line 282: eval: -i: invalid option eval: usage: eval [arg ...] -./errors.tests: line 291: command: -i: invalid option +./errors.tests: line 283: command: -i: invalid option command: usage: command [-pVv] command [arg ...] -./errors.tests: line 294: /bin/sh + 0: arithmetic syntax error: operand expected (error token is "/bin/sh + 0") -./errors.tests: line 295: /bin/sh + 0: arithmetic syntax error: operand expected (error token is "/bin/sh + 0") -./errors.tests: line 298: trap: NOSIG: invalid signal specification -./errors.tests: line 301: trap: -s: invalid option +./errors.tests: line 286: /bin/sh + 0: arithmetic syntax error: operand expected (error token is "/bin/sh + 0") +./errors.tests: line 287: /bin/sh + 0: arithmetic syntax error: operand expected (error token is "/bin/sh + 0") +./errors.tests: line 290: trap: NOSIG: invalid signal specification +./errors.tests: line 293: trap: -s: invalid option trap: usage: trap [-Plp] [[action] signal_spec ...] -./errors.tests: line 307: return: can only `return' from a function or sourced script -./errors.tests: line 311: break: 0: loop count out of range -./errors.tests: line 315: continue: 0: loop count out of range -./errors.tests: line 320: builtin: -x: invalid option +./errors.tests: line 299: return: can only `return' from a function or sourced script +./errors.tests: line 303: break: 0: loop count out of range +./errors.tests: line 307: continue: 0: loop count out of range +./errors.tests: line 312: builtin: -x: invalid option builtin: usage: builtin [shell-builtin [arg ...]] -./errors.tests: line 323: builtin: bash: not a shell builtin -./errors.tests: line 327: bg: no job control -./errors.tests: line 328: fg: no job control +./errors.tests: line 315: builtin: bash: not a shell builtin +./errors.tests: line 319: bg: no job control +./errors.tests: line 320: fg: no job control kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] -./errors.tests: line 332: kill: -s: option requires an argument -./errors.tests: line 334: kill: S: invalid signal specification -./errors.tests: line 336: kill: `': not a pid or valid job spec +./errors.tests: line 324: kill: -s: option requires an argument +./errors.tests: line 326: kill: S: invalid signal specification +./errors.tests: line 328: kill: `': not a pid or valid job spec kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] -./errors.tests: line 340: kill: SIGBAD: invalid signal specification -./errors.tests: line 342: kill: BAD: invalid signal specification -./errors.tests: line 344: kill: @12: arguments must be process or job IDs -./errors.tests: line 347: unset: BASH_LINENO: cannot unset -./errors.tests: line 347: unset: BASH_SOURCE: cannot unset -./errors.tests: line 350: set: trackall: invalid option name -./errors.tests: line 351: set: -q: invalid option +./errors.tests: line 332: kill: SIGBAD: invalid signal specification +./errors.tests: line 334: kill: BAD: invalid signal specification +./errors.tests: line 336: kill: @12: arguments must be process or job IDs +./errors.tests: line 339: unset: BASH_LINENO: cannot unset +./errors.tests: line 339: unset: BASH_SOURCE: cannot unset +./errors.tests: line 342: set: trackall: invalid option name +./errors.tests: line 343: set: -q: invalid option set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...] -./errors.tests: line 352: set: -i: invalid option +./errors.tests: line 344: set: -i: invalid option set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...] -./errors.tests: line 356: xx: readonly variable +./errors.tests: line 348: xx: readonly variable 1 ./errors1.sub: line 14: .: -i: invalid option .: usage: . filename [arguments] @@ -308,6 +302,34 @@ errors: line 3: break: too many arguments after break: 2 errors: line 3: continue: too many arguments after continue: 2 +bash: line 1: readonly: `non-identifier': not a valid identifier +after: 1 +bash: line 1: export: `non-identifier': not a valid identifier +after: 1 +bash: line 1: readonly: `non-identifier': not a valid identifier +bash: line 1: readonly: `invalid+ident': not a valid identifier +after: 1 +bash: line 1: export: `non-identifier': not a valid identifier +bash: line 1: export: `invalid+ident': not a valid identifier +after: 1 +sh: line 1: readonly: `non-identifier': not a valid identifier +sh: line 1: export: `non-identifier': not a valid identifier +sh: line 1: readonly: `non-identifier': not a valid identifier +sh: line 1: export: `non-identifier': not a valid identifier +bash: line 1: readonly: `non-identifier': not a valid identifier +command: 1 +bash: line 1: export: `non-identifier': not a valid identifier +command: 1 +sh: line 1: readonly: `non-identifier': not a valid identifier +command: 1 +sh: line 1: export: `non-identifier': not a valid identifier +command: 1 +bash: line 1: export: `AA[4]': not a valid identifier +array: 1 +bash: line 1: readonly: `AA[4]': not a valid identifier +array: 1 +sh: line 1: export: `AA[4]': not a valid identifier +sh: line 1: readonly: `AA[4]': not a valid identifier bash: line 1: return: can only `return' from a function or sourced script after return bash: line 1: return: can only `return' from a function or sourced script @@ -316,4 +338,4 @@ sh: line 1: unset: `a-b': not a valid identifier sh: line 1: /nosuchfile: No such file or directory sh: line 1: trap: SIGNOSIG: invalid signal specification after trap -./errors.tests: line 398: `!!': not a valid identifier +./errors.tests: line 393: `!!': not a valid identifier diff --git a/tests/errors.tests b/tests/errors.tests index 576746d1b..c8a3b7e5b 100644 --- a/tests/errors.tests +++ b/tests/errors.tests @@ -156,14 +156,6 @@ hash -d set +o hashall hash -p ${THIS_SH} ${THIS_SH##*/} -# bad identifiers to declare/readonly/export -export AA[4] -readonly AA[4] -export invalid-var=4 -readonly invalid-var=4 -export invalid-var -readonly invalid-var - declare -a AA unset AA[-2] @@ -376,6 +368,9 @@ ${THIS_SH} ./errors9.sub # invalid numeric arguments and too many arguments ${THIS_SH} ./errors10.sub +# invalid identifiers to readonly/export +${THIS_SH} ./errors11.sub + ${THIS_SH} -c 'return ; echo after return' bash ${THIS_SH} -o posix -c 'return ; echo after return' bash diff --git a/tests/errors11.sub b/tests/errors11.sub new file mode 100644 index 000000000..28d3e0092 --- /dev/null +++ b/tests/errors11.sub @@ -0,0 +1,42 @@ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +: ${THIS_SH:=./bash} + +${THIS_SH} -c 'readonly non-identifier ; echo after: $?' bash +${THIS_SH} -c 'export non-identifier ; echo after: $?' bash + +${THIS_SH} -c 'readonly non-identifier invalid+ident ; echo after: $?' bash +${THIS_SH} -c 'export non-identifier invalid+ident ; echo after: $?' bash + +${THIS_SH} -o posix -c 'readonly non-identifier ; echo after: $?' sh +${THIS_SH} -o posix -c 'export non-identifier ; echo after: $?' sh + +${THIS_SH} -o posix -c 'readonly non-identifier invalid+ident ; echo after: $?' sh +${THIS_SH} -o posix -c 'export non-identifier invalid+ident ; echo after: $?' sh + +${THIS_SH} -c 'command readonly non-identifier ; echo command: $?' bash +${THIS_SH} -c 'command export non-identifier ; echo command: $?' bash + +${THIS_SH} -o posix -c 'command readonly non-identifier ; echo command: $?' sh +${THIS_SH} -o posix -c 'command export non-identifier ; echo command: $?' sh + +# invalid array references + +${THIS_SH} -c 'export AA[4] ; echo array: $?' bash +${THIS_SH} -c 'readonly AA[4] ; echo array: $?' bash + +${THIS_SH} -o posix -c 'export AA[4] ; echo array: $?' sh +${THIS_SH} -o posix -c 'readonly AA[4] ; echo array: $?' sh + +