]>
Commit | Line | Data |
---|---|---|
05d9462c CR |
1 | This is a terse description of the new features added to bash-4.4 since |
2 | the release of bash-4.3. As always, the manual page (doc/bash.1) is | |
3 | the place to look for complete descriptions. | |
4 | ||
5 | 1. New Features in Bash | |
6 | ||
7 | a. There is now a settable configuration #define that will cause the shell | |
8 | to exit if the shell is running setuid without the -p option and setuid | |
9 | to the real uid fails. | |
10 | ||
11 | b. Command and process substitutions now turn off the `-v' option when | |
12 | executing, as other shells seem to do. | |
13 | ||
14 | c. The default value for the `checkhash' shell option may now be set at | |
15 | compile time with a #define. | |
16 | ||
17 | d. The `mapfile' builtin now has a -d option to use an arbitrary character | |
18 | as the record delimiter, and a -t option to strip the delimiter as | |
19 | supplied with -d. | |
20 | ||
21 | e. The maximum number of nested recursive calls to `eval' is now settable in | |
22 | config-top.h; the default is no limit. | |
23 | ||
24 | f. The `-p' option to declare and similar builtins will display attributes for | |
25 | named variables even when those variables have not been assigned values | |
26 | (which are technically unset). | |
27 | ||
28 | g. The maximum number of nested recursive calls to `source' is now settable | |
29 | in config-top.h; the default is no limit. | |
30 | ||
31 | h. All builtin commands recognize the `--help' option and print a usage | |
32 | summary. | |
33 | ||
34 | i. Bash does not allow function names containing `/' and `=' to be exported. | |
35 | ||
36 | j. The `ulimit' builtin has new -k (kqueues) and -P (pseudoterminals) options. | |
37 | ||
38 | k. The shell now allows `time ; othercommand' to time null commands. | |
39 | ||
40 | l. There is a new `--enable-function-import' configuration option to allow | |
41 | importing shell functions from the environment; import is enabled by | |
42 | default. | |
43 | ||
44 | m. `printf -v var ""' will now set `var' to the empty string, as if `var=""' | |
45 | had been executed. | |
46 | ||
47 | n. GLOBIGNORE, the pattern substitution word expansion, and programmable | |
48 | completion match filtering now honor the value of the `nocasematch' option. | |
49 | ||
50 | o. There is a new ${parameter@spec} family of operators to transform the | |
51 | value of `parameter'. | |
52 | ||
53 | p. Bash no longer attempts to perform compound assignment if a variable on the | |
54 | rhs of an assignment statement argument to `declare' has the form of a | |
55 | compound assignment (e.g., w='(word)' ; declare foo=$w); compound | |
56 | assignments are accepted if the variable was already declared as an array, | |
57 | but with a warning. | |
58 | ||
59 | q. The declare builtin no longer displays array variables using the compound | |
60 | assignment syntax with quotes; that will generate warnings when re-used as | |
61 | input, and isn't necessary. | |
62 | ||
63 | r. Executing the rhs of && and || will no longer cause the shell to fork if | |
64 | it's not necessary. | |
65 | ||
66 | s. The `local' builtin takes a new argument: `-', which will cause it to save | |
67 | and the single-letter shell options and restore their previous values at | |
68 | function return. | |
69 | ||
70 | t. `complete' and `compgen' have a new `-o nosort' option, which forces | |
71 | readline to not sort the completion matches. | |
72 | ||
73 | u. Bash now allows waiting for the most recent process substitution, since it | |
74 | appears as $!. | |
75 | ||
76 | v. The `unset' builtin now unsets a scalar variable if it is subscripted with | |
77 | a `0', analogous to the ${var[0]} expansion. | |
78 | ||
79 | w. `set -i' is no longer valid, as in other shells. | |
80 | ||
81 | x. BASH_SUBSHELL is now updated for process substitution and group commands | |
82 | in pipelines, and is available with the same value when running any exit | |
83 | trap. | |
84 | ||
85 | y. Bash now checks $INSIDE_EMACS as well as $EMACS when deciding whether or | |
86 | not bash is being run in a GNU Emacs shell window. | |
87 | ||
88 | z. Bash now treats SIGINT received when running a non-builtin command in a | |
89 | loop the way it has traditionally treated running a builtin command: | |
90 | running any trap handler and breaking out of the loop. | |
91 | ||
92 | aa. New variable: EXECIGNORE; a colon-separate list of patterns that will | |
93 | cause matching filenames to be ignored when searching for commands. | |
94 | ||
95 | bb. Aliases whose value ends in a shell metacharacter now expand in a way to | |
96 | allow them to be `pasted' to the next token, which can potentially change | |
97 | the meaning of a command (e.g., turning `&' into `&&'). | |
98 | ||
2b7361d5 CR |
99 | cc. `make install' now installs the example loadable builtins and a set of |
100 | bash headers to use when developing new loadable builtins. | |
101 | ||
102 | dd. `enable -f' now attempts to call functions named BUILTIN_builtin_load when | |
103 | loading BUILTIN, and BUILTIN_builtin_unload when deleting it. This allows | |
104 | loadable builtins to run initialization and cleanup code. | |
105 | ||
106 | ee. There is a new BASH_LOADABLES_PATH variable containing a list of directories | |
107 | where the `enable -f' command looks for shared objects containing loadable | |
108 | builtins. | |
109 | ||
900a813b CR |
110 | ff. The `complete_fullquote' option to `shopt' changes filename completion to |
111 | quote all shell metacharacters in filenames and directory names. | |
112 | ||
113 | gg. The `kill' builtin now has a `-L' option, equivalent to `-l', for | |
114 | compatibility with Linux standalone versions of kill. | |
115 | ||
71574d7e CR |
116 | hh. BASH_COMPAT and FUNCNEST can be inherited and set from the shell's initial |
117 | environment. | |
037a8b7f CR |
118 | |
119 | ii. inherit_errexit: a new `shopt' option that, when set, causes command | |
120 | substitutions to inherit the -e option. By default, those subshells disable | |
121 | -e. It's enabled as part of turning on posix mode. | |
122 | ||
123 | jj. New prompt string: PS0. Expanded and displayed by interactive shells after | |
124 | reading a complete command but before executing it. | |
125 | ||
126 | kk. Interactive shells now behave as if SIGTSTP/SIGTTIN/SIGTTOU are set to SIG_DFL | |
127 | when the shell is started, so they are set to SIG_DFL in child processes. | |
128 | ||
129 | ll. Posix-mode shells now allow double quotes to quote the history expansion | |
130 | character. | |
131 | ||
132 | mm. OLDPWD can be inherited from the environment if it names a directory. | |
133 | ||
134 | nn. Shells running as root no longer inherit PS4 from the environment, closing a | |
135 | security hole involving PS4 expansion performing command substitution. | |
136 | ||
137 | oo. If executing an implicit `cd' when the `autocd' option is set, bash will now | |
138 | invoke a function named `cd' if one exists before executing the `cd' builtin. | |
139 | ||
ec691667 CR |
140 | pp. Using ${a[@]} or ${a[*]} with an array without any assigned elements when |
141 | the nounset option is enabled no longer throws an unbound variable error. | |
142 | ||
05d9462c CR |
143 | 2. New Features in Readline |
144 | ||
145 | a. The history truncation code now uses the same error recovery mechansim as | |
146 | the history writing code, and restores the old version of the history file | |
147 | on error. The error recovery mechanism handles symlinked history files. | |
148 | ||
149 | b. There is a new bindable variable, `enable-bracketed-paste', which enables | |
150 | support for a terminal's bracketed paste mode. | |
151 | ||
152 | c. The editing mode indicators can now be strings and are user-settable | |
153 | (new `emacs-mode-string', `vi-cmd-mode-string' and `vi-ins-mode-string' | |
154 | variables). Mode strings can contain invisible character sequences. | |
155 | Setting mode strings to null strings restores the defaults. | |
156 | ||
157 | d. Prompt expansion adds the mode string to the last line of a multi-line | |
158 | prompt (one with embedded newlines). | |
159 | ||
160 | e. There is a new bindable variable, `colored-completion-prefix', which, if | |
161 | set, causes the common prefix of a set of possible completions to be | |
162 | displayed in color. | |
163 | ||
164 | f. There is a new bindable command `vi-yank-pop', a vi-mode version of emacs- | |
165 | mode yank-pop. | |
166 | ||
167 | g. The redisplay code underwent several efficiency improvements for multibyte | |
168 | locales. | |
169 | ||
170 | h. The insert-char function attempts to batch-insert all pending typeahead | |
171 | that maps to self-insert, as long as it is coming from the terminal. | |
172 | ||
173 | i. rl_callback_sigcleanup: a new application function that can clean up and | |
174 | unset any state set by readline's callback mode. Intended to be used | |
175 | after a signal. | |
037a8b7f CR |
176 | |
177 | j. If an incremental search string has its last character removed with DEL, the | |
178 | resulting empty search string no longer matches the previous line. | |
179 | ||
180 | k. If readline reads a history file that begins with `#' (or the value of | |
79eedac4 CR |
181 | the history comment character) and has enabled history timestamps, the |
182 | history entries are assumed to be delimited by timestamps. This allows | |
183 | multi-line history entries. | |
037a8b7f | 184 | |
79eedac4 CR |
185 | l. Readline now throws an error if it parses a key binding without a |
186 | terminating `:' or whitespace. | |
ec691667 | 187 | |
79eedac4 CR |
188 | m. The default binding for ^W in vi mode now uses word boundaries specified |
189 | by Posix (vi-unix-word-rubout is bindable command name). | |
190 | ||
191 | n. rl_clear_visible_line: new application-callable function; clears all | |
192 | screen lines occupied by the current visible readline line. | |
193 | ||
194 | o. rl_tty_set_echoing: application-callable function that controls whether | |
195 | or not readline thinks it is echoing terminal output. | |
196 | ||
197 | p. Handle >| and strings of digits preceding and following redirection | |
198 | specifications as single tokens when tokenizing the line for history | |
199 | expansion. | |
200 | ||
201 | q. Fixed a bug with displaying completions when the prefix display length | |
202 | is greater than the length of the completions to be displayed. | |
203 | ||
204 | r. The :p history modifier now applies to the entire line, so any expansion | |
205 | specifying :p causes the line to be printed instead of expanded. | |
206 | ||
207 | s. New application-callable function: rl_pending_signal(): returns the signal | |
ec691667 | 208 | number of any signal readline has caught but not yet handled. |
79eedac4 CR |
209 | |
210 | t. New application-settable variable: rl_persistent_signal_handlers: if set | |
211 | to a non-zero value, readline will enable the readline-6.2 signal handler | |
212 | behavior in callback mode: handlers are installed when | |
213 | rl_callback_handler_install is called and removed removed when a complete | |
214 | line has been read. |