123
7/23/2019 Changes in Bash Version 4.2 to Bash 4.3 http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 1/123 This document details the changes between this version, bash-4.3-release, and the previous version, bash-4.3-rc2. 1. Changes to Bash a. Onl !osi"-mode shells should e"it on an assignment #ailure in the  temporar environment preceding a special builtin. This is how it$s been  documented. b. %i"ed a bug that caused a #ailed special builtin to not e"it a posi"-mode  shell i# the #ailing builtin was on the &'( o# a )) or **. c. Changed the handling o# un+uoted bacslashes in regular e"pressions to be  closer to bash-4.2. d. globstar / no longer traverses smbolic lins that resolve to  directories. This eliminates some duplicate entries. e. %i"ed a bug that caused a (0C'& trap handler to not be able to change the  (0C'& disposition. #. %i"ed a bug that caused a crash when -" was enabled and a command  contained a printable multibte wide/ character. g. %i"ed a bug that caused an interactive shell without line editing enabled  to read invalid data a#ter receiving a (00T. h. %i"ed a bug that caused command word completion to #ail i# the director in  !5T' where the completion would be #ound contained single or double +uotes. i. %i"ed a bug that caused a shell with -v enabled to print commands in /  multiple times. 2. Changes to 6eadline a. %i"ed a bug that caused 7undo$ to re#erence #reed memor or null pointers. 3. ew %eatures in Bash a. The 88 -v 99 option now understands arra re#erences #oo819/ and returns  success i# the re#erenced element has a value. ------------------------------------------------------------------------------ This document details the changes between this version, bash-4.3-rc2, and the previous version, bash-4.3-rc1. 1. Changes to Bash a. %i"ed a bug that le#t variables set b print# -v mared as invisible. b. %i"ed an o##-b-one error in a :ob control warning message. c. %i"ed a bug that caused the shell to crash a#ter declaring a namere# variable  without a value. d. %i"ed a bug that caused asnchronous commands to not set ; correctl. e. %i"ed a bug that caused out-o#-order e"ecution when e"ecuting aliases with  embedded newlines containing 7.$ commands. #. %i"ed a bug that caused error messages generated b e"pansion errors in  7#or$ commands to have the wrong line number. g. %i"ed a bug that caused the 7wait$ builtin to not be interruptible in an

Changes in Bash Version 4.2 to Bash 4.3

Embed Size (px)

Citation preview

Page 1: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 1/123

This document details the changes between this version, bash-4.3-release, andthe previous version, bash-4.3-rc2.

1. Changes to Bash

a. Onl !osi"-mode shells should e"it on an assignment #ailure in the  temporar environment preceding a special builtin. This is how it$s been  documented.

b. %i"ed a bug that caused a #ailed special builtin to not e"it a posi"-mode  shell i# the #ailing builtin was on the &'( o# a )) or **.

c. Changed the handling o# un+uoted bacslashes in regular e"pressions to be  closer to bash-4.2.

d. globstar / no longer traverses smbolic lins that resolve to  directories. This eliminates some duplicate entries.

e. %i"ed a bug that caused a (0C'& trap handler to not be able to change the  (0C'& disposition.

#. %i"ed a bug that caused a crash when -" was enabled and a command  contained a printable multibte wide/ character.

g. %i"ed a bug that caused an interactive shell without line editing enabled  to read invalid data a#ter receiving a (00T.

h. %i"ed a bug that caused command word completion to #ail i# the director in  !5T' where the completion would be #ound contained single or double +uotes.

i. %i"ed a bug that caused a shell with -v enabled to print commands in /  multiple times.

2. Changes to 6eadline

a. %i"ed a bug that caused 7undo$ to re#erence #reed memor or null pointers.

3. ew %eatures in Bash

a. The 88 -v 99 option now understands arra re#erences #oo819/ and returns  success i# the re#erenced element has a value.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.3-rc2, and theprevious version, bash-4.3-rc1.

1. Changes to Bash

a. %i"ed a bug that le#t variables set b print# -v mared as invisible.

b. %i"ed an o##-b-one error in a :ob control warning message.

c. %i"ed a bug that caused the shell to crash a#ter declaring a namere# variable  without a value.

d. %i"ed a bug that caused asnchronous commands to not set ; correctl.

e. %i"ed a bug that caused out-o#-order e"ecution when e"ecuting aliases with  embedded newlines containing 7.$ commands.

#. %i"ed a bug that caused error messages generated b e"pansion errors in  7#or$ commands to have the wrong line number.

g. %i"ed a bug that caused the 7wait$ builtin to not be interruptible in an

Page 2: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 2/123

  interactive shell with :ob control enabled.

h. %i"ed a bug that caused (00T and (0<=0T to not be trappable in  asnchronous subshell commands.

i. Bash now re+uires that the value assigned to a namere# variable be a valid  shell identi#ier variable name or arra re#erence/.

:. Converting an e"isting variable to a namere# variable now turns o## the  -i>-l>-u>-c attributes.

. isplaing a namere# variable with 7declare -p$ now displas the namere#  variable and its value rather than #ollowing the namere# chain.

l. %i"ed a problem with interrupt handling that caused a second and subse+uent  (00T to be ignored b interactive shells.

m. %i"ed a bug that caused certain positional parameter and arra e"pansions  to mishandle discard/ null positional parameters and arra elements.

n. The shell no longer blocs receipt o# signals while running trap handlers

  #or those signals, and allows most trap handlers to be run recursivel  running trap handlers while a trap handler is e"ecuting/.

o. The shell now handles bacslashes in regular e"pression arguments to the  88 command$s ?@ operator slightl di##erentl, resulting in more  consistent behavior.

2. Changes to 6eadline

a. %i"ed a bug that could cause readline to crash and seg #ault attempting to  e"pand an empt histor entr.

b. %i"ed a bug that caused a bad entr in the &(ACO&O6( variable to abort all

  color processing but leave color enabled.

c. %i"ed a bug that caused displa problems with multi-line prompts containing  invisible characters on multiple lines.

d. %i"ed a bug that caused e##ects made b undoing changes to a histor line to  be discarded.

3. ew %eatures in Bash

4. ew %eatures in 6eadline

a. hen creating shared libraries on ac O( D, the pathname written into the

  librar installAname/ no longer includes the minor version number.------------------------------------------------------------------------------This document details the changes between this version, bash-4.3-rc1, and theprevious version, bash-4.3-beta2.

1. Changes to Bash

a. %i"ed a bug in bash completion that caused a tilde to be e"panded even i#  the 7dire"pand$ option was not enabled.

b. %i"ed a potential bug that could cause corrupted input in interactive shells  running without line editing and with 7ignoreeo#$ enabled.

c. %i"ed a bug that could cause #ailures when opening pipes bac to shells  created to run process substitutions.

d. %i"ed a bug that caused an assignment to TEDTO50 to re+uire TEDTO5006

Page 3: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 3/123

  to be set in order to actuall change the current te"t domain.

e. Changed the wa redirections are printed to avoid con#usion when the target  o# an output redirection is a process substitution beginning with 7F$.

2. Changes to 6eadline

a. (hared librar building is now supported on ac O( D 1G.H arwin 13/.

3. ew %eatures in Bash

a. 7cd$ has a new 7-I$ option to browse a #ile$s e"tended attributes on  sstems that support OAD5TT6.

4. ew %eatures in 6eadline

a. There are additional de#ault e bindings #or in32

------------------------------------------------------------------------------This document details the changes between this version, bash-4.3-beta2, and theprevious version, bash-4.3-beta.

1. Changes to Bash

a. %i"ed a bug that caused assignment to an unset variable using a negative  subscript to result in a segmentation #ault.

b. %i"ed a bug that caused assignment to a string variable using a negative  subscript to use the incorrect inde".

c. %i"ed a bug that caused some strings to be interpreted as invalid  e"tended globbing e"pressions when used with the help builtin.

d. %i"ed a bug that caused an attempt to trap a signal whose disposition

  cannot be changed to re#erence uninitialiJed memor.

e. Command completion now sips assignment statements preceding a command  name and completes the command.

#. %i"ed a bug that caused 7compgen -#$ in a non-interactive shell to dump  core under certain circumstances.

g. %i"ed a bug that caused the 7read -$ to misbehave when the input stream  contains G"##.

2. Changes to 6eadline

a. Changed message when an incremental search #ails to include K#ailedK in  the prompt and displa the entire search string instead o# :ust the last  matching portion.

b. %i"ed a bug that caused an arrow e tped to an incremental search prompt  to process the e se+uence incorrectl.

c. 5dditional e bindings #or arrow es on in.

3. ew %eatures in Bash

a. The help builtin now attempts substring matching as it did through  bash-4.2/ i# e"act string matching #ails.

b. The #c builtin now interprets -G as the current command line.

c. Completing director names containing shell variables now adds a trailing

Page 4: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 4/123

  slash i# the e"panded result is a director.

4. ew %eatures in 6eadline

a. rlAchangeAenvironmentL new application-settable variable that controls  whether or not 6eadline modi#ies the environment currentl readline  modi#ies onl &0E( and CO&=(/.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.3-beta, and theprevious version, bash-4.3-alpha.

1. Changes to Bash

a. %i"ed a bug in the prompt director name KtrimmingK code that caused  memor corruption and garbled the results.

b. %i"ed a bug that caused single +uotes that resulted #rom $...$ +uoting  in the replacement portion o# a double-+uoted Mword>pat>repN e"pansion  to be treated as +uote characters.

c. %i"ed a bug that caused assignment statements preceding a command word to  result in assignment statements #ollowing a declaration command to not be  e"panded lie assignment statements.

d. %i"ed a bug with variable search order in the presence o# local variables  with the same name as variables in the temporar environment supplied to  a shell #unction.

e. %i"ed a bug that caused constructs lie 12/ to be interpreted as process  substitutions even in an arithmetic conte"t.

#. %i"ed several cases where 7invisible$ variables variables with attributes  but no values, which are technicall unset/ were treated incorrectl.

g. %i"ed a bug that caused group commands in pipelines that were not the  last element to not run the ED0T trap.

h. %i"ed a bug that caused 7unset -n$ to not unset a namere# variable in  certain cases.

i. %i"ed the namere# circular re#erence checing to be less strict and onl  disallow a namere# variable with the same value as its name at the global  scope.

:. %i"ed a bug that caused trap handlers to be e"ecuted recursivel,  corrupting internal data structures.

. %i"ed a bug that could result in bash not compiling i# certain options were  not enabled.

l. %i"ed a bug that caused the arithmetic e"pansion code to attempt variable  assignments when operator precedence prohibited them.

m. ord e"pansions lie M#ooPPbarN now understand indirect variablere#erences.

n. %i"ed a bug that caused 7declare -#p name$ to not displa a #unctionde#inition.

o. %i"ed a bug that caused asnchronous child processes to modi# the stdin  #ile pointer when bash was using it to read a script, which modi#ied the  parent$s value as well.

Page 5: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 5/123

2. Changes to 6eadline

a. %i"ed a bug in vi mode that caused the arrow es to set the saved last  vi-mode command to the wrong value.

b. %i"ed a bug that caused double-+uoted strings to be scanned incorrectl  when being used as the value o# a readline variable assignment.

c. %i"ed a bug with vi mode that prevented 7.$ #rom repeating a command  entered on a previous line command/.

d. %i"ed a bug that could cause completion to core dump i# it was interrupted  b a signal.

e. 6eadline now sends the meta-e enable string to the terminal i# the  terminal has been success#ull initialiJed.

#. 6eadline now calls the signal hoo a#ter resiJing the terminal when it  receives a (00C'.

g. %i"ed a bug that could cause the histor list code to per#orm an out-o#-

  bounds arra re#erence i# the histor list is empt.

3. ew %eatures in Bash

a. (hells started to run process substitutions now run an trap set on ED0T.

b. There is now a con#igure-time option to enable the globasciiranges option  b de#ault.

c. The read builtin now checs its #irst variable argument #or validit be#ore  tring to read an input.

------------------------------------------------------------------------------

This document details the changes between this version, bash-4.3-alpha,and the previous version, bash-4.2-release.

1. Changes to Bash

a. %i"ed several bugs concerning incomplete bracet e"pressions in #ilename  generation globbing/ patterns.

b. %i"ed a bug with single +uotes and O6 in Mparam op O6N when running  in !osi" mode.

c. %i"ed a bug that caused the pattern removal and pattern substitution word  e"pansions and case statement word e"pansion to not match the empt string.

d. %i"ed a bug that caused the tJset/ #unction to not wor a#ter changing  the TQ enviroment variable.

e. %i"ed a bug that caused the 6'( o# an assignment statement to undergo  word splitting when it contained an un+uoted I.

#. %i"ed bugs that caused the shell to not react to a (00T sent while  waiting #or a child process to e"it.

g. Bash doesn$t tr to run things in a signal handler conte"t when it gets a  signal (00T>(0'=!>etc/ while reading input using readline but still  be responsive to terminating signals.

h. %i"ed a bug that caused bash to go into an in#inite loop i# a #ilename  to be matched contained an invalid multibte character.

Page 6: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 6/123

i. %i"ed a bug that caused !(4 to end up being truncated i# it is longer  than 12R btes.

:. %i"ed a bug that caused brace e"pansion to not sip over double-+uoted  command substitution.

. (stem-speci#ic updates #orL S!!, '!>=D, ac O( D

l. %i"ed a bug in displaing commands that caused redirections to be associated  with the wrong part o# the command.

m. %i"ed the coproc cleanup to unset the appropriate shell variables when a  coproc terminates.

n. %i"ed a bug that caused 7#c$ to dump core due to incorrect calculation o#  the last histor entr.

o. 5dded worarounds #or %reeB($s implementation o# #accessat>eaccess and  7test -"$.

p. %i"ed a bug that caused the shell to not match patterns containing

  control-5.

+. %i"ed a bug that could result in doubled error messages when the 7print#$  builtin got a write error.

r. %i"ed a bug that caused the shell to not correctl e"pand words containing  multiple consecutive +uoted empt strings KKKKKKaa/.

s. %i"ed a bug that caused the shell to not correctl parse multi-line  process substitutions containing comments and +uoted strings.

t. %i"ed a problem with the bash malloc$s internal idea o# the top o# the  memor heap that resulted in incorrect decisions to tr to reduce the

  brea and give memor bac to the ernel.

u. There are changes to the e"pansions pe#ormed on compound arra assignments,  in an e##ort to mae #oo? 8ind19?bar 8ind29?baJ / identical to  #oo8ind19?bar #oo8ind29?baJ.

v. Bash now reports an error i# 7read -a name$ is used when 7name$ is an  e"isting associative arra.

w. %i"ed a bug that allowed an attempted assignment to a readonl variable  in an arithmetic e"pression to not return #ailure.

". %i"ed several bugs that caused completion #unctions to be invoed even when

  the cursor was be#ore the #irst word in the command.

. %i"ed a bug that caused parsing a command substitution to overwrite the  parsing state associated with the complete input line.

J. %i"ed several bugs with the built-in snprint# replacement and #ield widths  and #loating point.

aa. %i"ed a bug that caused incorrect o##set calculations and input bu##er  corruption when reading #iles longer than 231 btes.

bb. %i"ed several bugs where bash per#ormed arithmetic evaluation in conte"ts  where evaluation is suppressed.

cc. %i"ed a bug that caused bash to close %0%Os used #or process substitution  too earl when a shell #unction was e"ecuting, but protect against using  all #ile descriptors when the shell #unctions are invoed inside loops.

Page 7: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 7/123

dd. 5dded checs #or printable and non-printable/ multibte characters #or  use in error messages.

ee. %i"ed a bug that caused O operate-and-get-ne"t/ to not wor correctl  at the end o# the histor list.

##. %i"ed a bug that caused command-oriented histor to incorrectl combine  here documents into one line.

gg. %i"ed a bug that caused importing ('E&&O!T( #rom the environment into a  !osi"-mode shell to print an error message and re#use to parse it.

hh. %i"ed a bug that caused the shell to delete an e"tra histor entr when  using 7histor -s$.

ii. %i"ed a bug that caused #loating-point e"ceptions and over#low errors  #or the > and U arithmetic operators when using 0T5DA0 and -1.

::. %i"ed a bug that caused parsing errors when reading an arithmetic #or  loop inside a command substitution.

. %i"ed a bug that caused a readonl #unction to be unset when unset was  called without the -# or -v option.

ll. %i"ed several bugs in the code that +uotes characters special to regular  e"pressions when used in a +uoted string on the 6'( o# the ?@ operator  to the 88 command.

mm. %i"ed a bug that caused redirections to #ail because the #ile descriptor  limit was set to a value less than 1G.

nn. %i"ed a bug that caused the 7read$ builtin to e"ecute code in a signal  handler conte"t i# read timed out.

oo. %i"ed a bug that caused e"tended globbing patterns to not match #iles  beginning with 7.$ correctl when a 7.$ was e"plicitl supplied in the  pattern.

pp. %i"ed a bug that caused e se+uences longer than two characters to not  wor when used with 7bind -"$.

++. %i"ed a bug that resulted in rede#ined #unctions having the wrong source  #ile names in B5('A(O=6CE.

rr. %i"ed a bug that caused the read builtin to assign null strings to variables  when using 7read -$, which caused core dumps when re#erenced

ss. %i"ed a bug that caused 7bash -m script$ to not enable :ob control while  running the script.

tt. %i"ed a bug that caused 7print# -v var$ to dump core when used with the  Ub #ormat code.

uu. %i"ed a bug that caused the shell to e"it with the wrong status i# -e was  active and the shell e"ited on a substitution error.

vv. %i"ed a bug that caused the shell to seg #ault i# an arra variable with  the same name as an e"isting associative arra was implicitl created b  an assignment declare a8n9?b/.

ww. %i"ed a bug that caused a redirection to misbehave i# the number speci#ied  #or a #ile descriptor over#lows an intma"At.

Page 8: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 8/123

"". %i"ed several bugs with the handling o# valid and invalid unicode character  values when used with the Vu and V= escape se+uences to print# and $...$.

. %i"ed a bug that caused tildes to not be escaped in e"panded #ilenames,  maing them sub:ect to later e"pansion.

JJ. hen using the pattern substitution word e"pansion, bash now runs the  replacement string through +uote removal, since it allows +uotes in that  string to act as escape characters. This is not bacwards compatible, so  it can be disabled b setting the bash compatibilit mode to 4.2.

aaa. %i"ed the rest o# the cases where the shell runs non-allowed code in a  signal handler conte"t.

bbb. %i"ed a bug that caused spurious E& characters V1WW/ to appear in  double-+uoted e"pansion where the 6'( is evaluated to the empt string.

ccc. %i"ed a bug that caused the use o# the shell$s internal random number  generator #or temporar #ile names to perturb the random number  se+uence.

ddd. %i"ed several bugs that caused 7declare -g$ to not set the right global  variables or to misbehave when declaring global inde"ed arras.

eee. %i"ed a logic bug that caused e"tended globbing in a multibte locale to  cause #ailures when using the pattern substititution word e"pansions.

###. %i"ed a bug that caused the 7lastpipe$ option to corrupt the #ile  descriptor used to read the script.

ggg. %i"ed a bug that causes the shell to delete E& characters in the  e"panded value o# variables used in the same +uoted string as variables  that e"pand to nothing.

hhh. %i"ed a bug that caused the shell to assign the wrong value #rom an  assignment lie "?W // when 7"$ was an e"isting arra variable.

iii. %i"ed a bug that caused the shell to misbehave when generating se+uences  and the boundar values over#low an intma"At.

:::. %i"ed a bug caused e"pansion errors i# an e"pansion o# KIK appeared  ne"t to another e"pansion e.g.. KMINM"NK/.

. %i"ed a potential bu##er over#low bug when per#orming >dev>#d e"pansion.

lll. %i"ed a bug that resulted in an e"tra semicolon being added to compound  assignments when the were added to the histor list.

mmm. %i"ed a bug that caused map#ile to read one e"tra line #rom the input.

nnn. %i"ed a bug that caused the mail checing code to use uninitialiJed  values.

ooo. %i"ed a bug that prevented histor timestamps #rom being saved i# the  histor comment character is unset.

ppp. %i"ed a bug that caused the case-modi#ing e"pansions to not wor with  multibte characters.

+++. %i"ed a bug that caused the edit-and-e"ecute bindable readline command

  to see the wrong data i# invoed in the middle o# a multi-line +uoted  string.

rrr. %i"ed a bug that resulted in the shell returning the wrong e"it status

Page 9: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 9/123

  #or a bacground command on sstems that reccle !0s ver +uicl.

sss. %i"ed a bug that caused asnchronous group commands to not run an ED0T  trap de#ined in the bod o# the command.

ttt. %i"ed a bug that caused 7eval K... X returnK$ to not clean up properl.

uuu. %i"ed a bug that caused the shell to dump core i# 7read$ reads an escaped  0%( whitespace character.

vvv. %i"ed a bug that caused B5('ACO5 to be set to an incorrect value when  e"ecuting a .../ subshell.

www. %i"ed a couple o# pointer aliasing bugs with the toen string in arithmetic  evaluation.

""". %i"ed a bug with parsing multi-line command substitutions when reading  the 7do$ eword #ollowed b whitespace.

. %i"ed a bug that caused the shell to seg #ault i# the time given to the  print# U.../T #ormat over#lowed the value accepted b localtime3/.

JJJ. %i"ed a problem with displaing help topics in two columns when the  translated te"t contained multibte characters.

aaaa. %i"ed a bug with the e"tended globbing pattern matcher where a 7$ was  #ollowed b a negated e"tended glob pattern.

bbbb. %i"ed a race condition with short-lived coproc creation and reaping that  caused the child process to be reaped be#ore the various coproc shell  variables were initialiJed.

cccc. %i"ed a bug where turning o## 7erre"it$ in command substitution subshells  was not re#lected in ('E&&O!T(.

dddd. !artiall #i"ed an inconsistenc in how the shell treated shell  #unctions run #rom an ED0T trap.

eeee. %i"ed a bug in how the shell invalidated %0%Os used #or process  substitution when e"ecuting a pipeline once rather than in ever child/.

####. %i"ed a bug that occurred when e"panding a special variable I, /  within double +uotes and the e"pansion resulted in an empt string.

gggg. %i"ed bugs with e"ecuting a (0C'& trap handler to mae sure that it$s  e"ecuted once per e"ited child.

hhhh. %i"ed a bug that caused 7declare$ and 7test$ to #ind variables that  had been given attributes but not assigned values. (uch variables are  not set.

iiii. %i"ed a bug that caused commands in process substitutions to not loo in  the local temporar environment when per#orming word e"pansions.

::::. %i"ed several problems with globstar e"pansions >/ returning null  #ilenames and multiple instances o# the same pathname.

. %i"ed an oversight that did not allow the e"it status o# 7coproc$ to  be inverted using 7Y$.

llll. %i"ed a bug that caused the -e option to be re-enabled using 7set -e$  even when e"ecuting in a conte"t where -e is ignored.

mmmm. %i"ed a mostl theoretical/ bug with input lines longer than (0QEA5D.

Page 10: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 10/123

nnnn. %i"ed a bug that could result in double evaluation o# command  substitutions when the appear in #ailed redirections.

oooo. %i"ed a bug that could cause seg #aults during 7map#ile$ callbacs i#  the callbac unsets the arra variable map#ile is using.

pppp. %i"ed several problems with variable assignments using MvarL?valueN  when the variable assignment is supposed to have side e##ects.

++++. %i"ed a bug that caused a #ailure o# an assignment statement preceding a  builtin caused the ne"t invocation o# a special builtin to e"it the shell.

rrrr. %i"ed several problems with 0%( when it appears in the temporarenvironment  and is used in redirections.

ssss. %i"ed a problem that caused 0%( changes using M0%(L?valueN to modi#  how preceding e"pansions were split.

tttt. %i"ed a problem that caused subshells to not run an ED0T trap the set.

uuuu. %i"ed a problem that caused shells started in posi" mode to attempt to  import shell #unctions with invalid names #rom the environment. e now  print a warning.

vvvv. ored around a ernel problem that caused (0C'& to interrupt open2/  on a %0%O used #or process substitution, even i# the (0C'& handler was  installed with the (5A6E(T56T #lag.

wwww. %i"ed a problem that resulted in inconsistent e"pansion o# and Ma89N.

"""". %i"ed a problem that caused 7read -t$ to crash when interrupted b  (00T.

. %i"ed a problem that caused pattern removal to #ail randoml because the  pattern matcher read beond the end o# a string.

JJJJ. %i"ed a bug that caused core dumps when shell #unctions tried to create  local shadow copies o# special variables lie 6O=!(.

aaaaa. %i"ed a bug that caused (0TE6 to be occasionall lost b children o#  interactive shells when it arrived be#ore the child process reset the  handler #rom (0A%&.

bbbbb. %i"ed a bug that caused redirections lie )n- to leave #ile descriptor  n closed i# e"ecuted with a builtin command.

ccccc. %i"ed a bug that caused incorrect completion +uoting when completing a  word containing a globbing character with 7show-all-i#-ambiguous$ set.

ddddd. %i"ed a bug that caused print#$s U+ #ormat speci#ier not to +uote a  tilde even i# it appeared in a location where it would be sub:ect to  tilde e"pansion.

2. Changes to 6eadline

a. %i"ed a bug that did not allow the 7dd$, 7cc$, or 7$ vi editing mode  commands to wor on the entire line.

b. %i"ed a bug that caused redispla problems with prompts longer than 12R  characters and histor searches.

c. %i"ed a bug that caused readline to tr and run code to modi# its idea

Page 11: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 11/123

  o# the screen siJe in a signal handler conte"t upon receiving a (00C'.

d. %i"ed a bug that caused the 7meta$ e to be enabled beond the duration  o# an individual call top readline/. e. 5dded a woraround #or a wcwidth bug in ac O( D that caused readline$s  redispla to mishandle Jero-width combining characters.

#. %i"ed a bug that caused readline to 7#orget$ part o# a e se+uence when  a multiple-e se+uence caused it to brea out o# an incremental search.

g. %i"ed bugs that caused readline to e"ecute code in a signal handler  conte"t i# interrupted while reading #rom the #ile sstem during completion.

h. %i"ed a bug that caused readline to 7#orget$ part o# a e se+uence when  reading an unbound multi-character e se+uence.

i. %i"ed a bug that caused 6eadline$s signal handlers to be installed beond  the bounds o# a single call to readline/.

:. %i"ed a bug that caused the 7.$ command to not redo the most recent 76$

  command in vi mode.

. %i"ed a bug that caused ignoring case in completion matches to result in  readline using the wrong match.

l. !aren matching now wors in vi insert mode.

m. %i" menu-completion to mae show-all-i#-ambiguous and menu-complete-displa-pre#i"  wor together.

n. %i"ed a bug that didn$t allow the 7cc$, 7dd$, or 7$ commands to be redone  in vi editing mode.

o. %i"ed a bug that caused the #ilename comparison code to not compare  multibte characters correctl when using case-sensitive or case-mapping  comparisons.

p. %i"ed the input reading loop to call the input hoo #unction onl when there  is no terminal input available.

+. %i"ed a bug that caused binding a macro to a multi-character e se+uence  where the se+uence and macro value share a common pre#i" to not per#orm  the macro replacement.

r. %i"ed several redispla errors with multibte characters and prompts

  containing invisible characters when using horiJontal scrolling.

s. %i"ed a bug that caused redispla errors when tring to overwrite  e"isting characters using multibte characters.

3. ew %eatures in Bash

a. The 7helptopic$ completion action now maps to all the help topics, not :ust  the shell builtins.

b. The 7help$ builtin no longer does pre#i" substring matching, so 7help read$  does not match 7readonl$.

c. The shell can be compiled to not displa a message about processes that  terminate due to (0TE6.

d. on-interactive shells now react to the setting o# checwinsiJe and set

Page 12: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 12/123

  &0E( and CO&=( a#ter a #oreground :ob e"its.

e. There is a new shell option, 7globasciiranges$, which, when set to on,  #orces globbing range comparisons to use character ordering as i# the  were run in the C locale.

#. There is a new shell option, 7dire"pand$, which maes #ilename completion  e"pand variables in director names in the wa bash-4.1 did.

g. 0n !osi" mode, the 7command$ builtin does not change whether or not a  builtin it shadows is treated as an assignment builtin.

h. The 7return$ and 7e"it$ builtins accept negative e"it status arguments.

i. The word completion code checs whether or not a #ilename containing a  shell variable e"pands to a director name and appends 7>$ to the word  as appropriate. The same code e"pands shell variables in command names  when per#orming command completion.

:. 0n !osi" mode, it is now an error to attempt to de#ine a shell #unction  with the same name as a !osi" special builtin.

. hen compiled #or strict !osi" con#ormance, histor e"pansion is disabled  b de#ault.

l. The histor e"pansion character Y/ does not cause histor e"pansion when  #ollowed b the closing +uote in a double-+uoted string.

m. 7complete$ and its siblings compgen>compopt now taes a new 7-o no+uote$  option to inhibit +uoting o# the completions.

n. (etting '0(T(0QE to a value less than Jero causes the histor list to be  unlimited setting it G Jero disables the histor list/.

o. (etting '0(T%0&E(0QE to a value less than Jero causes the histor #ile siJe  to be unlimited setting it to G causes the histor #ile to be truncated  to Jero siJe/.

p. The 7read$ builtin now sips =& btes in the input.

+. There is a new 7bind -D$ option to print all e se+uences bound to =ni"  commands.

r. hen in !osi" mode, 7read$ is interruptible b a trapped signal. 5#ter  running the trap handler, read returns 12RZsignal and throws awa an  partiall-read input.

s. The command completion code sips whitespace and assignment statements  be#ore looing #or the command name word to be completed.

t. The build process has a new mechanism #or constructing separate help #iles  that better re#lects the current set o# compilation options.

u. The -nt and -ot options to test now wor with #iles with nanosecond  timestamp resolution.

v. The shell saves the command histor in an shell #or which histor is  enabled and '0(T%0&E is set, not :ust interactive shells.

w. The shell has 7namere#$ variables and new -n>Zn/ options to declare and

  unset to use them, and a 7test -6$ option to test #or them.

". The shell now allows assigning, re#erencing, and unsetting elements o#  inde"ed arras using negative subscripts a8-19?2, echo Ma8-19N/ which

Page 13: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 13/123

  count bac #rom the last element o# the arra.

. The M"Nword redirection #eature now allows words lie Marra8ind9N and  can use variables with special meanings to the shell e.g., B5('ADT65CE%/.

J. There is a new C'0&A5D special shell variableX its value controls the  number o# e"ited child statues the shell remembers.

aa. There is a new con#iguration option --enable-dire"pand-de#ault/ that  causes the 7dire"pand$ shell option to be enabled b de#ault.

bb. Bash does not do anthing special to ensure that the #ile descriptor  assigned to D in M"N#oo remains open a#ter the bloc containing it  completes.

cc. The 7wait$ builtin has a new 7-n$ option to wait #or the ne"t child to  change status.

dd. The 7print#$ U.../T #ormat speci#ier now uses the current time i# no  argument is supplied.

ee. There is a new variable, B5('ACO!5T, that controls the current shell  compatibilit level.

##. The 7popd$ builtin now treats additional arguments as errors.

gg. The brace e"pansion code now treats a #ailed se+uence e"pansion as a  simple string and will continue to e"pand brace terms in the remainder  o# the word.

4. ew %eatures in 6eadline

a. 6eadline is now more responsive to (0'=! and other #atal signals when  reading input #rom the terminal or per#orming word completion but no

  longer attempts to run an not-allowable #unctions #rom a signal handler  conte"t.

b. There are new bindable commands to search the histor #or the string o#  characters between the beginning o# the line and the point  histor-substring-search-#orward, histor-substring-search-bacward/

c. 6eadline allows +uoted strings as the values o# variables when setting  them with 7set$. 5s a side e##ect, trailing spaces and tabs are ignored  when setting a string variable$s value.

d. The histor librar creates a bacup o# the histor #ile when writing it  and restores the bacup on a write error.

e. ew application-settable variableL rlA#ilenameAstatAhooL a #unction called  with a #ilename be#ore using it in a call to stat2/. Bash uses it to  e"pand shell variables so things lie 'OE>ownloads have a slash  appended.

#. ew bindable #unction 7print-last-bd-macro$, prints the most-recentl-  de#ined eboard macro in a reusable #ormat.

g. ew user-settable variable 7colored-stats$, enables use o# colored te"t  to denote #ile tpes when displaing possible completions colored analog  o# visible-stats/.

h. ew user-settable variable 7ese+-timout$, acts as an inter-character  timeout when reading input or incremental search strings.

i. ew application-callable #unctionL rlAclearAhistor. Clears the histor list

Page 14: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 14/123

  and #rees all readline-associated private data.

:. ew user-settable variable, show-mode-in-prompt, adds a characters to the  beginning o# the prompt indicating the current editing mode.

. ew application-settable variableL rlAinputAavailableAhooX #unction to be  called when readline needs to chec whether there is data available on its  input source. The de#ault hoo checs rlAinstream.

l. 6eadline calls an application-set event hoo rlAsignalAeventAhoo/ a#ter  it gets a signal while reading input read returns -1>E0T6 but readline  does not handle the signal immediatel/ to allow the application to handle  or otherwise note it. ot currentl called #or (0'=! or (0TE6.

m. 0# the user-settable variable 7histor-siJe$ is set to a value less than  G, the histor list siJe is unlimited.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.2-release,and the previous version, bash-4.2-rc2.

1. Changes to Bash

a. %i"ed a bug that caused some variables to be clobbered b a long:mp,  resulting in stac corruption.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.2-rc2,and the previous version, bash-4.2-rc1.

1. Changes to Bash

a. Changes to bashAdirectorAcompletionAhoo so that it$s assigned to the  readline rlAdirectorArewriteAhoo variable, which modi#ies the director

  name passed to opendir without modi#ing the director name the user  tped.

b. %i"ed bug in select builtin that caused it to not terminate correctl i#  the read timed out due to TO=T.

c. %i"ed a problem that resulted in non-repeatable se+uences o# random  numbers when 65O?G.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.2-rc1,and the previous version, bash-4.2-beta.

1. Changes to Bash

a. %i"ed a bug that caused some redirection errors to lea #ile descriptors.

b. %i"ed a bug that caused unar 7Z$ and 7-$ arithmetic operators to have a  higher precedence than unar 7Y$ and 7@$.

c. %i"ed a bug that caused simple commands in a pipeline to a##ect the e"it  status ;/ seen b subse+uent pipeline commands.

d. 5 number o# cgwin-speci#ic changes to avoid the use o# te"t-mode #iles  and #ile access, and to mae sure that Vr is handled correctl.

e. %i"ed a bug that caused the read builtin to not return #ailure i# an  attempt is made to assign to a readonl variable.

#. %i"ed a bug that caused some builtin usage messages to not be translated.

Page 15: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 15/123

g. %i"ed a bug that caused the getopts builtin to not return #ailure i# an  attempt is made to assign to a readonl variable. ow it returns 2.

h. %i"ed the cd and pwd builtins to return #ailure i# ! is readonl and  cannot be assigned to.

i. 5dded code to chec the return value o# access2/ on (olaris sstems,  since it returns success #or e"ecutable tests e.g., 7test -"$/ when  run b root, even i# the #ile permissions don$t allow e"ecution.

2. Changes to 6eadline

a. %i"ed a bug that caused director names in words to be completed to not  be de+uoted correctl.

3. ew %eatures in Bash

4. ew %eatures in 6eadline

------------------------------------------------------------------------------

This document details the changes between this version, bash-4.2-beta,and the previous version, bash-4.2-alpha.

1. Changes to Bash

a. %i"ed a bug that caused the V prompt string escape to not add a closing  =&&.

b. %i"ed a bug that caused partiall-+uoted words that were not sub:ect to  word splitting to retained +uoted =&&s.

c. 5dded considerable e##icienc speedups when pattern matching in multibte  locales b sipping multibte character #unctions where possible.

d. 5dded considerable speedups to variable e"pansion when in multibte locales.

e. %i"ed a bug that caused the e"pansion o# when there are no positional  parameters to cause the shell to dump core when used in a pattern  matching conte"t.

#. %i"ed a bug that caused variable e"pansions preceding regular builtins to  not change the shell environment during their e"ecution.

2. Changes to 6eadline

a. %i"ed a bug that made an e"plicit argument o# G to an-last-arg behave

  as i# it were a negative argument.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.2-alpha,and the previous version, bash-4.1-release.

1. Changes to Bash

a. %i"ed a bug in the parser when processing alias e"pansions containing  +uoted newlines.

b. %i"ed a memor lea in associative arra e"pansion.

c. %i"ed a bug that caused +uoted here-strings to be re+uoted when printed.

d. %i"ed a bug in arithmetic e"pansion that caused the inde" in an arra  e"pansion to be evaluated twice under certain circumstances.

Page 16: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 16/123

e. %i"ed several bugs with the e"pansion and displa o# variables that have  been given attributes but not values and are technicall unset.

#. %i"ed a bug that caused core dumps when using #ilename completion that  e"pands to a #ilename containing a globbing character.

g. %i"ed a bug that caused assignment statements preceding a special builtin  when running in !osi" mode to not persist a#ter the builtin completed  when the special builtin was e"ecuted in a shell #unction without an  local variables.

h. %i"ed a bug that caused a command to remain in the hash table even a#ter  7hash command$ did not #ind anthing i# there was alread an e"isting  hashed pathname.

i. %i"ed several bugs caused b e"ecuting unsa#e #unctions #rom a signal  handler in the cases where a signal handler is e"ecuted immediatel  rather than setting a #lag #or later e"ecution.

:. %i"ed a bug that caused some internal #lag variables to be set

  incorrectl i# 7read -t$ timed out.

. %i"ed a !osi" compatibilit issue b maing sure that a bacslash escaping  a 7N$ within a double-+uoted M...N parameter e"pansion is removed as part  o# the parameter e"pansion.

l. %i"ed a bug that caused e"ecution o# a trap to overwrite !0!E(T5T=(.

m. %i"ed a bug that caused here documents to not be displaed correctl  when attached to commands inside compound commands.

n. %i"ed a bug that caused the print# builtin to use the wrong precision  when using the 7$ modi#ier.

o. %i"ed a bug that caused an arriving (0C'& to interrupt output #unctions  lie those invoed b echo or print#.

p. Changed to use a more robust mechanism than eaccess2/ when test is  checing #ilenames #or e"ecution permission.

+. %i"ed a bug that caused spurious semicolons to be added into the command  histor in certain cases.

r. %i"ed a bug that caused the shell to #ree non-allocated memor when  unsetting element G o# an associative arra a#ter it was assigned  implicitl.

s. %i"ed a bug that could cause the shell to dump core i# using the 7v$  vi editing command on a multi-line command.

t. %i"ed a bug that le#t %0%Os opened b process substitutions open long  enough to potentiall cause #ile descriptor e"haustion when running a  shell #unction or shell builtin.

u. %i"ed a bug that caused the histor e"pansion #unctions to not recogniJe  process substitution or e"tended glob patterns as single words.

v. %i"ed a bug that caused restricted shells to set a restricted command$s  e"it status incorrectl.

w. %i"ed a bug that caused bash to ignore the wrong set o# #ilenames when  completing a command using the 7complete-#ilename$ readline command.

Page 17: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 17/123

". %i"ed a bug that caused a -!0 argument #ollowing a -s sig or -n sig to  not be interpreted as a signal speci#ication.

. Changed posi"-mode behavior o# a parse error in a 7.$ script or 7eval$  command to e"it the shell under !osi"-speci#ied conditions. !revious  versions printed a warning.

J. %i"ed a bug in V prompt e"pansion that resulted in incorrect e"pansion  in the event o# overlapping strings.

aa. %i"ed a bug that caused the L? parameter e"pansion operator to return the  wrong value as the result o# the e"pansion.

bb. hen in !osi" mode, a single +uote is not treated speciall in a  double-+uoted M...N e"pansion, unless the e"pansion operator is  P or U or the non-!osi" 7>>$, 7$, and 7,$. 0n particular, it does  not de#ine a new +uoting conte"t. This is #rom !osi" interpretation 221.

cc. %i"ed a bug that inadvertentl allowed program names containing slashes  to be entered into the command hash table.

dd. %i"ed a bug that caused the select builtin to incorrectl compute the  displa width o# the arguments in the presence o# multibte characters.

ee. %i"ed a bug that caused bash to not change the "trace #ile descriptor i#  B5('ADT65CE% was #ound in the shell environment at startup.

##. %i"ed a memor lea in the pattern removal parameter e"pansion.

gg. %i"ed a bug that caused (00T to #ail to interrupt a nested loop i# the  loop was in a pipeline.

hh. %i"ed a problem in .../ parsing that caused the parser to add an e"tra  space to a here-document delimiter i# the #irst word contained a 7>$.

ii. %i"ed a bug that caused #unctions de#ined with the 7#unction$ reserved  word to re+uire braces around the #unction bod.

::. %i"ed a bug that caused bash to dump core when a variable e"pansion being  used as an arra subscript #ailed.

. %i"ed a bug that caused bash to dump core i# the case-modi#ication  e"pansions were used on a variable with a null value.

ll. %i"ed a bug that caused partiall-+uoted strings to be split incorrectl  i# a variable with a null value was e"panded within double +uotes.

mm. The pattern substitution word e"pansion has been sped up dramaticall  when running in a locale with multibte characters.

nn. %i"ed a bug that caused histor -a to not write the correct lines to  the histor #ile i# all the new lines in the histor list were added  since the last time the histor #ile was read or written.

oo. %i"ed a bug that caused completion o# a word with an unclosed 77 command  substitution to set the prompt incorrectl.

pp. %i"ed a bug that caused e"tended globbing patterns in '0(T0O6E or  &OB0O6E to be incorrectl scanned.

++. %i"ed a bug caused b closing #ile descriptors 3-2G on shell startup. The  shell now sets them to close-on-e"ec.

rr. %i"ed a bug that caused the e"it status o# 7e"ec #ile$ to be set incorrectl

Page 18: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 18/123

  i# 7#ile$ was a director.

ss. %i"ed a bug in the 7.$ builtin to mae a non-interactive posi"-mode shell  e"it i# the #ile argument to 7.$ is not #ound. !re#i"ing e"ec with

7command$ maes the shell not e"it. !osi" re+uires this behavior.

tt. %i"ed a bug that caused 7sh -c $command e"ecX e"it 1$ to hang.

uu. %i"ed a bug in .../ command substitution parsing that caused the shell  to treat bacslash-newline incorrectl when parsing a comment.

vv. %i"ed bug that caused brace e"pansion se+uence generation to misbehave  when supplied integers greater than 231 - 1.

ww. %i"ed a bug that caused #ailure to save #ile descriptors #or redirections  to corrupt shell #ile descriptors.

"". %i"ed a bug that caused bash-#orward-shellword to not correctl handle  +uoted strings.

2. Changes to 6eadline

a. %i"ed a bug that caused the unconverted #ilename to be added to the list o#  completions when the application speci#ied #ilename conversion #unctions.

b. %i"ed a bug that caused the wrong #ilename to be passed to opendir when the  application has speci#ied a #ilename de+uoting #unction.

c. %i"ed a bug when repeating a character search in vi mode in the case where  there was no search to repeat.

d. hen show-all-i#-ambiguous is set, the completion routines no longer insert  a common match pre#i" that is shorter than the te"t being completed.

e. The #ull set o# vi editing commands ma now be used in callbac mode.

#. %i"ed a bug that caused readline to not update its idea o# the terminal  dimensions while running in 7no-echo$ mode.

h. %i"ed a bug that caused readline to dump core i# an application called  rlAprepAterminal without setting rlAinstream.

i. %i"ed a bug that caused meta-pre#i"ed characters bound to incremental  search #orward or bacward to not be recogniJed i# the were tped  subse+uentl.

:. The incremental search code treats e se+uences that map to the same

  #unctions as de#ault/ , , and [ as e+uivalent to those characters.

. %i"ed a bug in menu-complete that caused it to misbehave with large  negative argument.

l. %i"ed a bug that caused vi-mode an-last-arg to ring the bell when invoed  at the end o# the line.

3. ew %eatures in Bash

a. 7e"ec -a #oo$ now sets G to 7#oo$ in an e"ecutable shell script without a  leading PY.

b. (ubshells begun to e"ecute command substitutions or run shell #unctions or  builtins in subshells do not reset trap strings until a new trap is  speci#ied. This allows trap/ to displa the caller$s traps and the  trap strings to persist until a new trap is set.

Page 19: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 19/123

c. 7trap -p$ will now show signals ignored at shell startup, though their  disposition still cannot be modi#ied.

d. $...$, echo, and print# understand VuDDDD and V=DDDDDDDD escape se+uences.

e. declare>tpeset has a new 7-g$ option, which creates variables in the  global scope even when run in a shell #unction.

#. test>8>88 have a new -v variable unar operator, which returns success i#  7variable$ has been set.

g. !osi" parsing changes to allow 7Y time command$ and multiple consecutive  instances o# 7Y$ which toggle/ and 7time$ which have no cumulative  e##ect/.

h. !osi" change to allow 7time$ as a command b itsel# to print the elapsed  user, sstem, and real times #or the shell and its children.

:. ...// is alwas parsed as an arithmetic e"pansion #irst, instead o# as  a potential nested command substitution, as !osi" re+uires.

. 5 new %=CE(T variable to allow the user to control the ma"imum shell  #unction nesting recursive e"ecution/ level.

l. The map#ile builtin now supplies a third argument to the callbac commandL  the line about to be assigned to the supplied arra inde".

m. The print# builtin has a new U#mt/T speci#ier, which allows time values  to use str#time-lie #ormatting.

n. There is a new 7compat41$ shell option.

o. The cd builtin has a new !osi"-mandated 7-e$ option.

p. egative subscripts to inde"ed arras, previousl errors, now are treated  as o##sets #rom the ma"imum assigned inde" Z 1.

+. egative length speci#ications in the MvarLo##setLlengthN e"pansion,  previousl errors, are now treated as o##sets #rom the end o# the variable.

r. !arsing change to allow 7time -p --$.

s. !osi"-mode parsing change to not recogniJe 7time$ as a eword i# the  #ollowing toen begins with a 7-$. This means no more !osi"-mode  7time -p$. !osi" interpretation 2\W.

t. There is a new 7lastpipe$ shell option that runs the last command o# a  pipeline in the current shell conte"t. The lastpipe option has no  e##ect i# :ob control is enabled.

u. 'istor e"pansion no longer e"pands the 7Y$ variable e"pansion.

v. !osi" mode shells no longer e"it i# a variable assignment error occurs  with an assignment preceding a command that is not a special builtin.

w. on-interactive mode shells e"it i# -u is enabled and an attempt is made  to use an unset variable with the U or P e"pansions, the 7>>$, 7$, or  7,$ e"pansions, or the parameter length e"pansion.

". !osi"-mode shells use the argument passed to 7.$ as-is i# a !5T' search  #ails, e##ectivel searching the current director. !osi"-2GGR change.

4. ew %eatures in 6eadline

Page 20: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 20/123

a. The histor librar does not tr to write the histor #ilename in the  current director i# 'OE is unset. This closes a potential securit  problem i# the application does not speci# a histor #ilename.

b. ew bindable variable 7completion-displa-width$ to set the number o#  columns used when displaing completions.

c. ew bindable variable 7completion-case-map$ to cause case-insensitive  completion to treat 7-$ and 7A$ as identical.

d. There are new bindable vi-mode command names to avoid readline$s case-  insensitive matching not allowing them to be bound separatel.

e. ew bindable variable 7menu-complete-displa-pre#i"$ causes the menu  completion code to displa the common pre#i" o# the possible completions  be#ore ccling through the list, instead o# a#ter.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.1-rc,and the previous version, bash-4.1-beta.

1. Changes to Bash

a. %i"ed a bug that caused print# to not return a partial value when it  encountered an error while converting an integer argument.

b. %i"ed a bug that caused setting one o# the compat options to not  turn o## the others.

c. The undocumented/ --worde"p option is no longer included b de#ault.

d. %i"ed a bug in conditional command e"ecution that caused it to not  correctl ignore the e"it status under certain circumstances.

e. 5dded a con#igure-time chec #or correctl-woring asprint#>snprint#.

#. %i"ed some problems with line number calculation and displa when sourcing  a #ile in an interactive shell.

g. %i"ed a bug that caused the shell to crash when using 7declare -5 #oo?bar$.

h. %i"ed a bug that caused an o##-b-one error when calculating the directories  to displa with the !6O!TA06T60 option.

2. Changes to 6eadline

a. %i"ed a bug that caused applications using the callbac inter#ace to not  react to (00T or other signals/ until another character arrived.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.1-beta,and the previous version, bash-4.1-alpha.

1. Changes to Bash

a. %i"ed a bug in map#ile that caused the shell to crash i# it was passed the  name o# an associative arra.

b. %i"ed a bug that caused the shell to incorrectl split case patterns i#

  the contained characters in 0%(.

c. %i"ed a bug that caused the shell to set ; to the wrong value when using  a construct ending with a variable assignment with set -" enabled and !(4

Page 21: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 21/123

  containing a command substitution.

d. %i"ed a bug that caused the shell to read commands incorrectl i# an  e"pansion error occurred under certain conditions in a user-speci#ied  subshell.

e. %i"ed a bug that caused the shell to set ; incorrectl i# a parse error  occurred in an evaluation conte"t KevalK, trap command, dot script, etc./

#. %i"ed a bug that caused the shell to attempt command substitution  completion within a single-+uoted string.

g. %i"ed a bug that caused the shell to insert an e"tra single +uote during  word completion.

h. %i"ed a bug that caused the shell to crash i# invoed with the environment  variable E5C( having a null value.

i. %i"ed a bug that caused bash to incorrectl report the presence o# new  mail in a 7maildir$ environment.

:. %i"ed a bug that caused the shell to not recogniJe a here-document ending  delimiter inside a command substitution.

. %i"ed a bug that caused the shell to crash when a a dnamic arra variable  was assigned a scalar value.

2. Changes to 6eadline

3. ew %eatures in Bash

a. The map#ile>readarra builtin no longer stores the commands it invoes via  callbacs in the histor list.

b. There is a new 7compat4G$ shopt option.

c. The and F operators to 88 do string comparisons using the current locale  onl i# the compatibilit level is greater than 4G set to 41 b de#ault/.

4. ew %eatures in 6eadline

------------------------------------------------------------------------------This document details the changes between this version, bash-4.1-alpha,and the previous version, bash-4.G-release.

1. Changes to Bash

a. %i"ed bugs in the parser involving new parsing o# the commands contained  in command substitution when the substitution is read.

b. %i"ed a bug that caused the shell to dump core when per#orming programmable  completion using a shell #unction.

c. %i"ed a bug in 7map#ile$ that caused it to invoe callbacs at the wrong  time.

d. %i"ed a bug that caused the shell to dump core when listing :obs in the  7e"it$ builtin.

e. %i"ed several bugs encountered when reading subscripts in associative

  arra assignments and e"pansions.

#. %i"ed a bug that under some circumstances caused an associative arra to  be converted to an inde"ed arra.

Page 22: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 22/123

g. %i"ed a bug that caused snta" errors and (00T interrupts to not set  ; to a value F 12R.

h. %i"ed a bug that caused the shell to remove %0%Os associated with process  substitution inside shell #unctions.

i. %i"ed a bug that caused terminal attributes to not be reset when the  7read$ builtin timed out.

:. %i"ed a bug in brace e"pansion that caused unwanted Jero padding o# the  e"panded terms.

. %i"ed a bug that prevented the *) construct #rom woring as intended when  used with a simple command with additional redirections.

l. %i"ed a bug with the case statment X) terminator that caused the shell to  dere#erence a =&& pointer.

m. %i"ed a bug that caused assignment statements or redirections preceding  a simple command name to inhibit alias e"pansion.

n. %i"ed the behavior o# 7set -u$ to con#orm to the latest !osi"interpretationL  ever e"pansion o# an unset variable e"cept I and will cause the  shell to e"it.

o. %i"ed a bug that caused double-+uoted e"pansions o# inside word  e"pansions lie M"PN to not e"pand properl when 0%( is empt.

p. %i"ed a bug that caused traps to set &0EO to the wrong value when the  e"ecute.

+. %i"ed a bug that caused o##-b-one errors when computing histor lines in

  the 7#c$ builtin.

r. %i"ed a bug that caused some terminating signals to not e"it the shell  +uicl enough, #orcing the ernel to send the signal e.g., (0(E]/  multiple times.

s. %i"ed a bug that caused the shell to attempt to add empt lines to the  histor list when reading here documents.

t. ade some internal changes that dramaticall speeds up se+uential inde"ed  arra access.

u. %i"ed a bug that caused the shell to write past the end o# a string when

  completing a double-+uoted string ending in a bacslash.

v. %i"ed a bug that caused the shell to replace too man characters when a  pattern match was null in a M#oo>>barN e"pansion.

w. %i"ed bugs in the e"pansion o# that caused duplicate director names  and the contents o# the current director to be omitted.

". %i"ed a bug that caused ; to not be set correctl when re#erencing an  unset variable with set -u and set -e enabled.

. %i"ed a bug caused b e"ecuting an e"ternal program #rom the EB= trap  while a pipeline was running. The e##ect was to disturb the pipeline

  state, occasionall causing it to hang.

J. %i"ed a bug that caused the glob e"pansion to dump core i# it  encountered an unsearchable director.

Page 23: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 23/123

aa. %i"ed a bug that caused 7command -v$ and 7command -]$ to not honor the  path set b the -p option.

bb. %i"ed a bug that caused brace e"pansion to tae place too soon in some  compound arra assignments.

cc. %i"ed a bug that caused programmable completion #unctions$ changes to  6E5&0EA!O0T to not be re#lected bac to readline.

dd. %i"ed a bug that caused the shell to dump core i# a trap was e"ecuted  during a shell assignment statement.

ee. %i"ed an o##-b-one error when computing the number o# positional  parameters #or the MILGLnN e"pansion.

##. %i"ed a problem with setting CO!ACO6 #or programmable completion  #unctions that could leave it set to -1.

gg. %i"ed a bug that caused the E66 trap to be triggered in some cases where  7set -e$ would not have caused the shell to e"it.

hh. %i"ed a bug that caused changes made b 7compopt$ to not persist past the  completion #unction in which compopt was e"ecuted.

ii. %i"ed a bug that caused the list o# hostname completions to not be cleared  when 'O(T5E was unset.

::. %i"ed a bug that caused variable e"pansion in here documents to loo in  an temporar environment.

. Bash and readline can now convert #ile names between precomposed and  decomposed =nicode on ac O( D KeboardK and #ile sstem #orms,  respectivel/. This a##ects #ilename completion using new

  rlA#ilenameArewriteAhoo/, globbing, and readline redispla.

ll. The E66 and ED0T traps now see a non-Jero value #or ; when a parser  error a#ter set -e has been enabled causes the shell to e"it.

mm. %i"ed a bug that in brace e"pansion that caused Jero-pre#i"ed terms to  not contain the correct number o# digits.

nn. %i"ed a bug that caused the shell to #ree non-allocated memor when  unsetting an associative arra which had had a value implicitl assigned  to inde" KGK.

oo. %i"ed a memor lea in the MYpre#i"IN e"pansion.

pp. %i"ed a bug that caused print# to not correctl report all write errors.

++. %i"ed a bug that caused single and double +uotes to act as delimiters  when splitting a command line into words #or programmable completion.

rr. %i"ed a bug that caused globbing that caused >path> to match ever  director, not :ust those matching 7path$.

ss. %i"ed a bug that caused the shell to dump core when running 7help$ without  arguments i# the terminal width was #ewer than W characters.

2. Changes to 6eadline

a. The (00C' signal handler now avoids calling the redispla code i#  one arrives while in the middle o# redispla.

Page 24: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 24/123

b. Changes to the timeout code to mae sure that timeout values greater  than one second are handled better.

c. %i"ed a bug in the redispla code that was triggered b a prompt  containing invisible characters e"actl the width o# the screen.

d. %i"ed a bug in the redispla code encountered when running in horiJontal  scroll mode.

e. %i"ed a bug that prevented menu completion #rom properl completing  #ilenames.

#. %i"ed a redispla bug caused b a multibte character causing a line to  wrap.

g. %i"ed a bug that caused e se+uences o# two characters to not be  recogniJed when a longer se+uence identical in the #irst two characters  was bound.

h. %i"ed a bug that caused histor e"pansion to be attempted on $...$  single-+uoted strings.

i. %i"ed a bug that caused incorrect redispla when the prompt contained  multibte characters in an 7invisible$ se+uence braceted b V8 and  V9.

:. %i"ed a bug that caused histor e"pansion to short-circuit a#ter  encountering a multibte character.

3. ew %eatures in Bash

a. 'ere-documents within .../ command substitutions ma once more be  delimited b the closing right paren, instead o# re+uiring a newline.

b. Bash$s #ile status checs e"ecutable, readable, etc./ now tae #ile  sstem 5C&s into account on #ile sstems that support them.

c. Bash now passes environment variables with names that are not valid  shell variable names through into the environment passed to child  processes.

d. The 7e"ecute-uni"-command$ readline #unction now attempts to clear and  reuse the current line rather than move to a new one a#ter the command  e"ecutes.

e. 7print# -v$ can now assign values to arra indices.

#. ew 7complete -E$ and 7compopt -E$ options that wor on the KemptK  completionL completion attempted on an empt command line.

g. ew complete>compgen>compopt - option to de#ine a 7de#ault$ completionL  a completion to be invoed on command #or which no completion has been  de#ined. 0# this #unction returns 124, programmable completion is  attempted again, allowing a user to dnamicall build a set o# completions  as completion is attempted b having the de#ault completion #unction  install individual completion #unctions each time it is invoed.

h. hen displaing associative arras, subscripts are now +uoted.

i. Changes to dabbrev-e"pand to mae it more 7emacs-lie$L no space appended

  a#ter matches, completions are not sorted, and most recent histor entries  are presented #irst.

:. The 88 and commands are now sub:ect to the setting o# 7set -e$ and the

Page 25: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 25/123

  E66 trap.

. The source>. builtin now removes =& btes #rom the #ile be#ore attempting  to parse commands.

l. There is a new con#iguration option in con#ig-top.h/ that #orces bash to  #orward all histor entries to sslog.

m. 5 new variable B5('O!T( to e"port shell options settable using 7shopt$ to  child processes.

n. There is a new con#gure option that #orces the e"tglob option to be  enabled b de#ault.

o. ew variable B5('ADT65CE%X when set to an integer bash will write "trace  output to that #ile descriptor.

p. 0# the optional le#t-hand-side o# a redirection is o# the #orm MvarN, the  shell assigns the #ile descriptor used to var or uses var as the #ile  descriptor to move or close, depending on the redirection operator.

+. The and F operators to the 88 conditional command now do string  comparison according to the current locale.

r. !rogrammable completion now uses the completion #or 7b$ instead o# 7a$  when completion is attempted on a line lieL a b c.

s. %orce e"tglob on temporaril when parsing the pattern argument to  the ?? and Y? operators to the 88 command, #or compatibilit.

t. Changed the behavior o# interrupting the wait builtin when a (0C'& is  received and a trap on (0C'& is set to be !osi"-mode onl.

u. The read builtin has a new 7- nchars$ option, which reads e"actl C'56(

  characters, ignoring delimiters lie newline.

4. ew %eatures in 6eadline

a. ew bindable #unctionL menu-complete-bacward.

b. 0n the vi insertion emap, C-n is now bound to menu-complete b de#ault,  and C-p to menu-complete-bacward.

c. hen in vi command mode, repeatedl hitting E(C now does nothing, even  when E(C introduces a bound e se+uence. This is closer to how  historical vi behaves.

d. ew bindable #unctionL sip-csi-se+uence. Can be used as a de#ault to  consume e se+uences generated b es lie 'ome and End without having  to bind all es.

e. ew application-settable #unctionL rlA#ilenameArewriteAhoo. Can be used  to rewite or modi# #ilenames read #rom the #ile sstem be#ore the are  compared to the word to be completed.

#. ew bindable variableL sip-completed-te"t, active when completing in the  middle o# a word. 0# enabled, it means that characters in the completion  that match characters in the remainder o# the word are KsippedK rather  than inserted into the line.

g. The pre-readline-\.G version o# menu completion is available as  Kold-menu-completeK #or users who do not lie the readline-\.G version.

h. ew bindable variableL echo-control-characters. 0# enabled, and the

Page 26: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 26/123

  tt EC'OCT& bit is set, controls the echoing o# characters corresponding  to eboard-generated signals.

i. ew bindable variableL enable-meta-e. Controls whether or not readline  sends the smm>rmm se+uences i# the terminal indicates it has a meta e  that enables eight-bit characters.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.G-release,and the previous version, bash-4.G-rc1.

1. Changes to Bash

a. Changed the message printed when setlocale3/ #ails to onl include the  strerror error te"t i# the call changes errno.

b. Changed trap command e"ecution to reset the line number be#ore running a  trap e"cept EB= and 6ET=6 traps/.

c. %i"ed behavior o# case-modi#iing word e"pansions to not wor on  individual words within a variable$s value.

d. %i"ed a bug that caused map#ile to not be interruptible when run in an  interactive shell.

e. %i"ed a bug that caused map#ile to not run callbacs #or the #irst line  read.

#. %i"ed a bug that caused map#ile to not honor EO% tped in an interactive  shell.

g. %i"ed the coprocess reaping code to not run straight #rom a signal handler.

h. %i"ed a bug that caused print# -b to ignore the #irst U conversion speci#ier

  in the #ormat string on \4-bit sstems.

i. %i"ed a bug that caused incorrect word splitting when 7L$, 7?$, or 7@$  appeared in 0%(.

:. %i"ed a bug that caused data corruption in the programmable completion code  when a shell #unction called #rom a completion aborted e"ecution.

. %i"ed a bug that caused the C!= usage reported b the 7time$ builtin to be  capped at 1GGU.

l. Changed behavior o# shell when -e option is in e##ect to re#lect consensus  o# !osi" shell standardiJation woring group.

m. %i"ed a bug introduced in bash-4.G-alpha that caused redirections to not  be displaed b 7tpe$ or 7declare$ when appearing in #unctions under  certain circumstances.

2. Changes to 6eadline

a. %i"ed a bug that caused Y.../ e"tended glob patterns to inhibit later  histor e"pansion.

b. 6ewored the signal handling to avoid calling disallowed #unctions #rom a  signal handler.

3. ew %eatures in Bash

a. 7readarra$ is now a snonm #or 7map#ile$.------------------------------------------------------------------------------

Page 27: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 27/123

This document details the changes between this version, bash-4.G-rc1,and the previous version, bash-4.G-beta2.

1. Changes to Bash

a. %i"ed a bug that caused parsing errors when a /-stle command  substitution was #ollwed immediatel b a +uoted newline.

b. %i"ed a bug that caused e"tended shell globbing patterns beginning with  7$ to not wor when used with pattern substitution word e"pansions. ------------------------------------------------------------------------------This document details the changes between this version, bash-4.G-beta2,and the previous version, bash-4.G-beta.

1. Changes to Bash

a. %i"ed a bug that caused #ailed word e"pansions to set ; but not  !0!E(T5T=(.

b. Changed #ilename completion to +uote the tilde in a #ilename with a

  leading tilde that e"ists in the current director.

c. %i"ed a bug that caused a #ile descriptor lea when per#orming  redirections attached to a compound command.

d. %i"ed a bug that caused e"pansions o# I and to not e"it the shell i#  the -u option was enabled and there were no posititional parameters.

e. %i"ed a bug that resulted in bash not terminating immediatel i# a  terminating signal was received while per#orming output.

#. %i"ed a bug that caused the shell to crash a#ter creating 2^\ process  substitutions during word completion.

2. Changes to 6eadline

a. %i"ed a bug that caused redispla errors when using prompts with invisible  characters and numeric arguments to a command in a multibte locale.

b. %i"ed a bug that caused redispla errors when using prompts with invisible  characters spanning more than two phsical screen lines.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.G-beta,and the previous version, bash-4.G-alpha.

1. Changes to Bash

a. %i"ed a tpo that caused a variable to be used be#ore initialiJation  while parsing !osi"-stle command substitutions.

b. %i"ed a bug that caused stra ; when the e"pansion o# a parameter used  as part o# a pattern removal e"pansion is empt, but part o# a non-  empt string.

c. %i"ed a bug that could cause strings not converted to numbers b strtol  to be treated as i# the conversion had been success#ul.

d. The 7return$ builtin now accepts no options and re+uires a 7--$ be#ore

  a negative return value, as !osi" re+uires.

e. %i"ed a bug that caused local variables to be created with the empt  string #or a value rather than no value.

Page 28: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 28/123

#. Changed behavior so the shell now acts as i# it received an interrupt  when a pipeline is illed b (00T while e"ecuting a list.

g. %i"ed a bug that caused 7declare var$ and 7tpeset var$ to initialiJe  7var$ to the empt string.

h. Changed 7bind$ builtin to print a warning but proceed i# invoed when  line editing is not active.

i. %i"ed a bug that caused the shell to e"it when the 7erre"it$ option is  set and a command in a pipeline returns a non-Jero e"it status.

:. %i"ed a bug that caused the shell to not run the e"it trap in a command  run with 7bash -c$ under some circumstances.

. %i"ed a bug that caused parser errors to occasionall not set ; when  running commands with 7eval$.

l. %i"ed a bug that caused stra control characters when evaluating compound  arra assignments containing $V"W#$ escapes.

m. %i"ed a bug that caused redirections involving #ile descriptor 1G as the  target to behave incorrectl.

n. %i"ed a bug that could cause memor to be #reed multiple times when  assigning to CO!AO6B6E5_(.

o. %i"ed a bug that could cause =&& pointer dere#erences when CO!AO6B6E5_(  was unset.

2. Changes to 6eadline

3. ew %eatures in Bash

a. 5 value o# G #or the -t option to 7read$ now returns success i# there is  input available to be read #rom the speci#ied #ile descriptor.

b. C!5T' and &OB0O6E are ignored when the shell is running in privileged  mode.

c. ew bindable readline #unctions shell-#orward-word and shell-bacward-word,  which move #orward and bacward words delimited b shell metacharacters  and honor shell +uoting.

d. ew bindable readline #unctions shell-bacward-ill-word and shell-ill-word  which ill words bacward and #orward, but use the same word boundaries

  as shell-#orward-word and shell-bacward-word.

4. ew %eatures in 6eadline

a. 0# the ernel supports it, readline displas special characters  corresponding to a eboard-generated signal when the signal is received.

------------------------------------------------------------------------------This document details the changes between this version, bash-4.G-alpha,and the previous version, bash-3.2-release.

1. Changes to Bash

a. %i"ed several bugs in old-stle 77 command substitution parsing, including  comment parsing and +uoted string handling.

b. %i"ed problems parsing arguments to the 88 command$s ?@ regular e"pression

Page 29: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 29/123

  matching operatorL metacharacter and whitespace parsing.

c. %i"ed a bug that caused the shell to inappropriatel reuse high-numbered  #ile descriptors it used internall.

d. %i"ed a bug in pattern replacement word e"pansions that caused a 7>$ as  the #irst character o# an e"panded pattern to be mistaen #or a global  replacement speci#ier.

e. %i"ed several problems with the asprint# and snprint# replacement #unctions  that caused hangs and crashes.

#. %i"ed a bug in the calculation o# the current and previous :ob that caused  it to re#er to incorrect :obs.

g. %i"ed a bug in the chec #or the validit o# a hashed command pathname that  caused unnecessar hash table deletions and additions.

h. %i"ed a bug that caused child processes to inherit the wrong value #or Y.

i. %i"ed a bug that caused 7.$ to #ail to read and e"ecute commands #rom non-

  regular #iles such as devices or named pipes.

:. %i"ed a bug in print# #ormatting #or the U" and UD e"pansions that occurred  on some sstems.

. %i"ed a bug that caused the shell to crash when creating temporar #iles i#  T!06 named a non-writable director.

l. %i"ed a bug that caused the shell to ignore T!06 when creating temporar  #iles under some circumstances.

m. %i"ed a bug that caused named pipes created b process substitution to not  be cleaned up.

n. %i"ed a bug that caused '0(TT0E%O65T to not be honored when it appeared  in the initial shell environment.

o. %i"ed several bugs in the e"pansion o# and I +uoted and un+uoted/  when 0%( is null or contains non-whitespace charactersX the same changes  appl to arras subscripted with or I.

p. %i"ed several problems with pattern substitution e"pansions on the  positional parameters and arras subscripted with or I that occurred  when 0%( was set to the empt string.

+. ade a change to the de#ault locale initialiJation code that should

  result in better behavior #rom the locale-aware librar #unctions.

r. %i"ed a bug that caused compacting the :obs list to drop :obs.

s. %i"ed a bug that caused :umps bac to the top-level processing loop #rom  a builtin command to leave the shell in an inconsistent state.

t. %i"ed a bug that caused characters that would be escaped internall to be  doubled when escaped with a bacslash.

u. %i"ed the initialiJation o# mailbo"es to not cause maildirs to be read  and stat2/ called #or ever message #ile/ at shell startup.

v. %i"ed a bug that caused the shell to not displa !(2 when the read builtin  reads a line continued with a bacslash.

w. %i"ed a bug that caused errors in word splitting when 0%( contained

Page 30: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 30/123

  characters used #or internal +uoting.

". %i"ed bugs that caused problems with output #rom shell builtins not being  completel displaed on some sstems.

. %i"ed a bug that caused output to be lost when a redirection is acting on  the shell$s output #ile descriptor.

J. %i"ed bugs caused b shell builtins not checing #or all write errors.

aa. %i"ed a problem that caused the shell to dump core i# e"pansions on the  pattern passed to the pattern removal word e"pansions resulted in e"pansion  errors.

bb. %i"ed a bug that caused bash to loop in#initel a#ter creating and  waiting #or 4GH\ :obs.

cc. %i"ed a bug that caused bash to lose the status o# a bacground :ob under  certain circumstances.

dd. %i"ed a bug that caused bash to not loo in the temporar environment

  when per#orming variable looup under certain circumstances.

ee. %i"ed a bug that caused bash to close #ile descriptors greater than 1G  when the were used in redirections.

##. %i"ed a problem that caused the shell to attempt to read #rom the standard  input when called as 7bash -i script$.

gg. %i"ed a memor lea and variable initialiJation problems when the -v option  was supplied to 7print#$ that could cause incorrect results.

hh. %i"ed a bug that caused the 7read$ builtin to count btes when the -n option  was supplied, rather than possibl multibte/ characters.

ii. %i"ed a bug when displaing a #unction due to not converting the #unction  to an e"ternal #orm.

::. Changed :ob control initialiJation to ensure that the shell has a tt  as its controlling terminal be#ore enabling :ob control.

. %i"ed a bug with the 7test$ builtin that caused it to misinterpret  arguments beginning with 7-$ but containing more than one character.

ll. %i"ed bug that could cause the shell to dump core in certain cases where  a command sets the (00T disposition to the de#ault.

mm. %i"ed a bug in the pattern replacement a##ecting both word e"pansion  and the 7#c$ builtin/ that occurred when the pattern and replacement  strings were empt.

nn. %i"ed a bug that caused an arithmetic evaluation error to disable all  #urther evaluation.

oo. %i"ed a bug in pathname e"pansion that caused it to interpret bacslashes  in the pathname as +uoting characters.

pp. %i"ed a bug in the replacement getcwd/ implementation that could cause  memor to be overwritten.

++. hen in !osi" mode, the 7ulimit$ builtin now uses a bloc siJe o# ^12 #or  the 7-c$ and 7-#$ options.

rr. Brace e"pansion now allows process substitutions to pass through unchanged.

Page 31: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 31/123

ss. %i"ed a problem in the command name completion code to avoid +uoting  escaped special characters twice when the command name begins with a tilde.

tt. %i"ed a problem in the print# builtin that resulted in single-bte  output #or the K$K escape, even when using multibte characters.

uu. %i"ed a bug that caused the #ailure e"it status to be lost when redirections  attached to a compound command #ailed.

vv. %i"ed a bug that caused the internal random number generator to not be  re-seeded correctl when creating a subshell.

ww. %i"ed a bug that could cause the bash replacement getcwd to overwrite  memor.

"". %i"ed a bug that caused the shell to not receive (00T i# it was sent  while the shell was waiting #or a command substitution to terminate, and  mae sure the e"it status is correct when it does.

. %i"ed a bug that resulted in the second and subse+uent children spawned

  b a shell begun to run a command substitution being placed into the  wrong process group.

JJ. %i"ed a bug that caused the results o# success#ul tilde e"pansion to be  sub:ect to pathname e"pansion and word splitting.

aaa. %i"ed a bug that could cause the shell to hang i# it encountered an  error that caused it to :ump bac to the top processing loop during a  command substitution or 7eval$ command.

bbb. %i"ed a bug that caused the 7read$ builtin to use the tt$s attributes  instead o# those o# the #ile descriptor passed with the -u option when  processing the -n and -d options.

ccc. %i"ed a bug that caused incorrect e"pansion o# Marra8I9L#ooN i# the  #irst character o# 0%( was not whitespace.

ddd. %i"ed a bug that occurred when scanning #or the ending delimiter o# a  Mparameter>pat>subN e"pansion.

eee. %i"ed a bug that caused the shell to inappropriatel e"pand command  substitutions in words when e"panding director names #or completion.

###. %i"ed a bug that caused the 7#c$ builtin to loo too #ar bac in the  histor list under certain circumstances.

ggg. %i"ed a bug that caused a shell running in !osi" mode to search ! #or  a #ile speci#ied as an argument to source>. when the #ile was not #ound  in !5T'.

hhh. %i"ed a bug that caused the shell to modi# the case o# a command word  #ound via command completion when the shell was per#orming case-  insensitive completion.

iii. %i"ed a bug that caused the shell to search !5T' #or an argument to  source>. even when it contained a 7>$.

:::. %i"ed a bug that caused brace e"pansion to misorder e"pansions when the  locale did not have a collating order lie a5bBcC...JQ.

. %i"ed a bug that did not allow 7set Zo histor$ to have an e##ect when  run in a startup #ile or #rom a sourced #ile.

Page 32: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 32/123

lll. %i"ed a bug with the precedence o# the ;L conditional arithmetic operator.

mmm. %i"ed a bug that caused side e##ects o# temporar variable assignments  to persist in the shell environment.

nnn. %i"ed a bug that caused the terminal to be le#t in non-canonical mode  when using editing commands that invoe the an editor on the current  command line.

ooo. %i"ed a bug that caused globbing characters and characters in 0%( to not  be +uoted appropriatel when displaing assignment statements.

ppp. %i"ed a bug that caused the 7-e$ option to be inherited when sourcing a  #ile or evaluating a command with 7eval$ even i# the return value o# the  command was supposed to be ignored.

+++. %i"ed a bug that caused the shell to attempt to created variables with  invalid names i# such names appeared in the initial environment.

rrr. %i"ed a bug with +uote removal in strings where the #inal character is a  bacslash.

sss. %i"ed a bug that caused the e##ects o# special variables to persist even  when the variables were unset as part o# the shell reinitialiJing itsel#  to e"ecute a shell script.

ttt. %i"ed a bug that caused the histor to not be saved a#ter 7histor -c$ or  7histor -d$ was e"ecuted until a su##icient number o# commands had been  saved to the histor.

uuu. Bash now parses command substitutions according to !osi" rulesL parsing  the command contained in / to #ind the closing delimiter.

vvv. %i"ed a bug that caused traps on (0C'& set in a (0C'& handler to

  not persist.

www. %i"ed a bug that didn$t allow (0C'& to interrupt the 7wait$ builtin  as !osi" speci#ies.

""". 0nvalid numeric arguments to shell builtins no longer cause the shell to  short-circuit an e"ecuting compound command.

. %i"ed a bug that caused the e"it status to be lost when 7brea$ was  used to short-circuit a loop$s e"ecution.

JJJ. %i"ed a bug that caused stra ; characters to be le#t in e"pansions o#  KMarra89NK.

aaaa. Bash now prints better error messages #or here documents terminated b  EO% and #or identi#ing the incorrect toen in an invalid arithmetic  e"pression.

bbbb. %i"ed a bug in the variable length word e"pansion that caused it to  incorrectl calculate the number o# multibte characters.

cccc. %i"ed a race condition that could result in the top-level shell setting  the terminal$s process group to an incorrect value i# the process  group was changed b a child o# a child o# the shell.

dddd. %i"ed a bug that caused here documents belonging to commands within a

  compound command to be displaed in a sntactiall-incorrect #orm, which  prevented them #rom being re-read as input.

eeee. The shell displas more warnings about #ailures to set the locale.

Page 33: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 33/123

####. %i"ed a bug that caused the bod o# a here-document to not be saved to  the histor list.

gggg. %i"ed a bug that caused con#igure to incorrectl conclude that %reeB(  had >dev>#d available, resulting in problems with process substitution.

2. Changes to 6eadline

a. %i"ed a number o# redispla errors in environments supporting multibtecharacters.

b. %i"ed bugs in vi command mode that caused motion commands to inappropriatel  set the mar.

c. hen using the arrow es in vi insertion mode, readline allows movement  beond the current end o# the line unlie command mode/.

d. %i"ed bugs that caused readline to loop when the terminal has been taen  awa and reads return -1>E0O.

e. %i"ed bugs in redispla occurring when displaing prompts containing  invisible characters.

#. %i"ed a bug that caused the completion append character to not be reset to  the de#ault a#ter an application-speci#ied completion #unction changed it.

g. %i"ed a problem that caused incorrect positioning o# the cursor while in  emacs editing mode when moving #orward at the end o# a line while using  a locale supporting multibte characters.

h. %i"ed an o##-b-one error that caused readline to drop ever ^11th  character o# bu##ered input.

i. %i"ed a bug that resulted in (0TE6 not being caught or cleaned up.

:. %i"ed redispla bugs caused b multiline prompts with invisible characters  or no characters #ollowing the #inal newline.

. %i"ed redispla bug caused b prompts consisting solel o# invisible  characters.

l. %i"ed a bug in the code that bu##ers characters received ver +uicl in  succession which caused characters to be dropped.

m. %i"ed a bug that caused readline to re#erence uninitialiJed data structures  i# it received a (00C' be#ore completing initialJation.

n. %i"ed a bug that caused the vi-mode 7last command$ to be set incorrectl  and there#ore unrepeatable.

o. %i"ed a bug that caused readline to disable echoing when it was being used  with an output #ile descriptor that was not a terminal.

p. 6eadline now blocs (00T while manipulating internal data structures  during redispla.

+. %i"ed a bug in redispla that caused readline to seg#ault when pasting a  ver long line over 13G,GGG characters/.

r. %i"ed bugs in redispla when using prompts with no visible printing  characters.

3. ew %eatures in Bash

Page 34: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 34/123

a. hen using substring e"pansion on the positional parameters, a starting  inde" o# G now causes G to be pre#i"ed to the list.

b. The 7help$ builtin now prints its columns with entries sorted verticall  rather than horiJontall.

c. There is a new variable, B5('!0, which alwas returns the process id o#  the current shell.

d. There is a new 7autocd$ option that, when enabled, causes bash to attempt  to 7cd$ to a director name that is supplied as the #irst word o# a  simple command.

e. There is a new 7chec:obs$ option that causes the shell to chec #or and  report an running or stopped :obs at e"it.

#. The programmable completion code e"ports a new CO!AT[!E variable, set to  a character describing the tpe o# completion being attempted.

g. The programmable completion code e"ports a new CO!A_E[ variable, set to

  the character that caused the completion to be invoed e.g., T5B/.

h. 0# creation o# a child process #ails due to insu##icient resources, bash  will tr again several times be#ore reporting #ailure.

i. The programmable completion code now uses the same set o# characters as  readline when breaing the command line into a list o# words.

:. The bloc multiplier #or the ulimit -c and -# options is now ^12 when in  !osi" mode, as !osi" speci#ies.

. Changed the behavior o# the read builtin to save an partial input received  in the speci#ied variable when the read builtin times out. This also

  results in variables speci#ied as arguments to read to be set to the empt  string when there is no input available. hen the read builtin times out,  it returns an e"it status greater than 12R.

l. The shell now has the notion o# a 7compatibilit level$, controlled b  new variables settable b 7shopt$. (etting this variable currentl  restores the bash-3.1 behavior when processing +uoted strings on the rhs  o# the 7?@$ operator to the 788$ command.

m. The 7ulimit$ builtin now has new -b socet bu##er siJe/ and -T number  o# threads/ options.

n. The -p option to 7declare$ now displas all variable values and attributes

  or #unction values and attributes i# used with -#/.

o. There is a new 7compopt$ builtin that allows completion #unctions to modi#  completion options #or e"isting completions or the completion currentl  being e"ecuted.

p. The 7read$ builtin has a new -i option which inserts te"t into the repl  bu##er when using readline.

+. 5 new 7-E$ option to the complete builtin allows control o# the de#ault  behavior #or completion on an empt line.

r. There is now limited support #or completing command name words containing

  globbing characters.

s. Changed #ormat o# internal help documentation #or all builtins to roughl  #ollow man page #ormat.

Page 35: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 35/123

t. The 7help$ builtin now has a new -d option, to displa a short description,  and a -m option, to print help in#ormation in a man page-lie #ormat.

u. There is a new 7map#ile$ builtin to populate an arra with lines #rom a  given #ile.

v. 0# a command is not #ound, the shell attempts to e"ecute a shell #unction  named 7commandAnotA#oundAhandle$, suppling the command words as the  #unction arguments.

w. There is a new shell optionL 7globstar$. hen enabled, the globbing code  treats 7$ speciall -- it matches all directories and #iles within  them, when appropriate/ recursivel.

". There is a new shell optionL 7dirspell$. hen enabled, the #ilename  completion code per#orms spelling correction on director names during  completion.

. The 7-t$ option to the 7read$ builtin now supports #ractional timeout  values.

J. Brace e"pansion now allows Jero-padding o# e"panded numeric values and  will add the proper number o# Jeroes to mae sure all values contain the  same number o# digits.

aa. There is a new bash-speci#ic bindable readline #unctionL 7dabbrev-e"pand$.  0t uses menu completion on a set o# words taen #rom the histor list.

bb. The command assigned to a e se+uence with 7bind -"$ now sets two new  variables in the environment o# the e"ecuted commandL 6E5&0EA&0EAB=%%E6  and 6E5&0EA!O0T. The command can change the current readline line  and cursor position b modi#ing 6E5&0EA&0EAB=%%E6 and 6E5&0EA!O0T,  respectivel.

cc. There is a new )FF redirection operator, which appends the standard output  and standard error to the named #ile.

dd. The parser now understands 7*)$ as a snonm #or 72F)1 *$, which redirects  the standard error #or a command through a pipe.

ee. The new 7X)$ case statement action list terminator causes e"ecution to  continue with the action associated with the ne"t pattern in the  statement rather than terminating the command.

##. The new 7XX)$ case statement action list terminator causes the shell to  test the ne"t set o# patterns a#ter completing e"ecution o# the current

  action, rather than terminating the command.

gg. The shell understands a new variableL !6O!TA06T60. hen set to an  integer value greater than Jero, prompt e"pansion o# Vw and V will  retain onl that number o# trailing pathname components and replace  the intervening characters with 7...$.

hh. There are new case-modi#ing word e"pansionsL uppercase 89/ and  lowercase ,8,9/. The can wor on either the #irst character or  arra element, or globall. The accept an optional shell pattern  that determines which characters to modi#. There is an optionall-  con#igured #eature to include capitaliJation operators.

ii. The shell provides associative arra variables, with the appropriate  support to create, delete, assign values to, and e"pand them.

::. The 7declare$ builtin now has new -l convert value to lowercase upon

Page 36: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 36/123

  assignment/ and -u convert value to uppercase upon assignment/ options.  There is an optionall-con#igurable -c option to capitaliJe a value at  assignment.

. There is a new 7coproc$ reserved word that speci#ies a coprocessL an  asnchronous command run with two pipes connected to the creating shell.  Coprocs can be named. The input and output #ile descriptors and the  !0 o# the coprocess are available to the calling shell in variables  with coproc-speci#ic names.

4. ew %eatures in 6eadline

a. 5 new variable, rlAsortAcompletionAmatchesX allows applications to inhibit  match list sorting but bewareL some things don$t wor right i#  applications do this/.

b. 5 new variable, rlAcompletionAinvoingAeX allows applications to discover  the e that invoed rlAcomplete or rlAmenuAcomplete.

c. The #unctions rlAblocAsigint and rlAreleaseAsigint are now public and  available to calling applications who want to protect critical sections

  lie redispla/.

d. The #unctions rlAsaveAstate and rlArestoreAstate are now public and  available to calling applicationsX documented rest o# readline$s state  #lag values.

e. 5 new user-settable variable, 7histor-siJe$, allows setting the ma"imum  number o# entries in the histor list.

#. There is a new implementation o# menu completion, with several improvements  over the oldX the most notable improvement is a better 7completions  browsing$ mode.

g. The menu completion code now uses the rlAmenuAcompletionAentrA#unction  variable, allowing applications to provide their own menu completion  generators.

h. There is support #or replacing a pre#i" o# a pathname with a 7...$ when  displaing possible completions. This is controllable b setting the  7completion-pre#i"-displa-length$ variable. atches with a common pre#i"  longer than this value have the common pre#i" replaced with 7...$.

i. There is a new 7revert-all-at-newline$ variable. 0# enabled, readline will  undo all outstanding changes to all histor lines when 7accept-line$ is  e"ecuted.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.2-release,and the previous version, bash-3.2-beta.

1. Changes to Bash

a. %i"ed a bug that caused the temporar environment passed to a command to  a##ect the shell$s environment under certain circumstances.

b. %i"ed a bug in the print# builtin that caused the U+ #ormat speci#ier to  ignore empt string arguments.

c. 0mproved multibte character environment detection at con#iguration time.

d. %i"ed a bug in the read builtin that le#t spurious escape characters in the  input a#ter processing bacslashes when assigning to an arra variable.

Page 37: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 37/123

2. Changes to 6eadline

a. %i"ed a redispla bug that occurred in multibte-capable locales when the  prompt was one character longer than the screen width.------------------------------------------------------------------------------This document details the changes between this version, bash-3.2-beta,and the previous version, bash-3.2-alpha.

1. Changes to Bash

a. Changed the le"ical analJer to treat locale-speci#ic blan characters as  white space.

b. %i"ed a bug in command printing to avoid con#usion between redirections and  process substitution.

c. %i"ed problems with cross-compiling originating #rom inherited environment  variables.

d. 5dded write error reporting to print# builtin.

e. %i"ed a bug in the variable e"pansion code that could cause a core dump in  a multi-bte locale.

#. %i"ed a bug that caused substring e"pansion o# a null string to return  incorrect results.

g. B5('ACO5 now retains its previous value while e"ecuting commands as the  result o# a trap, as the documentation states.

2. Changes to 6eadline

a. %i"ed a bug with prompt redispla in a multi-bte locale to avoid redrawing  the prompt and input line multiple times.

b. %i"ed histor e"pansion to not be con#used b here-string redirection.

c. 6eadline no longer treats read errors b converting them to newlines, as  it does with EO%. This caused partial lines to be returned #rom readline/.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.2-alpha,and the previous version, bash-3.1-release.

1. Changes to Bash

a. %i"ed a source bug that caused the minimal con#iguration to not compile.

b. %i"ed memor leas in error handling #or the 7read$ builtin.

c. Changed the 88 and compound commands to set !0!E(T5T=( with their e"it  status.

d. %i"ed some parsing problems with compound arra assignments.

e. 5dded additional con#iguration changes #orL etB( incomplete multibte  character support/

#. %i"ed two bugs with local arra variable creation when shadowing a variable  o# the same name #rom a previous conte"t.

g. %i"ed the 7read$ builtin to restore the correct set o# completion #unctions  i# a timeout occurs.

Page 38: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 38/123

h. 5dded code to de#er the initialiJation o# '0(T(0QE and its sti#ling o# the  histor list/ until the histor #ile is loaded, allowing a startup #ile to  override the de#ault value.

i. Tightened up the arithmetic e"pression parsing to produce better error  messages when presented with invalid operators.

:. %i"ed the cross-compilation support to build the signal list at shell  invocation rather than compile time i# cross-compiling.

. %i"ed multibte support #or non-gcc compilers or compilers that do not  allow automatic arra variable siJing based on a non-constant value/.

l. (everal #i"es to the code that manages the list o# terminated :obs and  their e"it statuses, and the list o# active and recentl-terminated :obs  to avoid pid aliasing>wraparound and allocation errors.

m. %i"ed a problem that allowed scripts to die due to (00T while waiting  #or children, even when started in the bacground or otherwise ignoring  (00T.

n. %i"ed a bug that caused shells invoed as ->bin>bash #rom not being  recogniJed as login shells.

o. %i"ed a problem that caused shells in the bacground to give the terminal  to a process group other than the #oreground shell process group.

p. %i"ed a problem with e"tracting the 7varname$ in MPvarnameN.

+. %i"ed the code that handles (0<=0T to not e"it immediatel -- thereb  calling #unctions that ma not be called in a signal handler conte"t --  but set a #lag and e"it a#terward lie (00T/.

r. Changed the brace e"pansion code to sip over braces that don$t begin a

  valid matched brace e"pansion construct.

s. %i"ed 7tpeset$ and 7declare$ to not re+uire that their shell #unction  operands to be valid shell identi#iers.

t. Changed 7test$ to use access2/ with a temporar uid>euid swap when testing  #ile attributes and running setuid, and access2/ in most other cases.

u. Changed completion code to not attempt command name completion on a line  consisting solel o# whitespace when noAemptAcommandAcompletion is set.

v. The 7hash$ builtin now prints nothing in posi" mode when the hash table is  empt, and prints a message to that e##ect to stdout instead o# stderr

  when not in posi" mode.

w. %i"ed a bug in the e"tended pattern matching code that caused it to #ail to  match periods with certain patterns.

". %i"ed a bug that caused the shell to dump core when per#orming #ilename  generation in directories with thousands o# #iles.

. 6eturned to the original Bourne shell rules #or parsing 77L no recursive  parsing o# embedded +uoted strings or M...N constructs.

J. The inheritence o# the EB=, 6ET=6, and E66 traps is now dependent onl  on the settings o# the 7#unctrace$ and 7errtrace$ shell options, rather

  than whether or not the shell is in debugging mode.

aa. %i"ed a problem with 'OE being converted to @ in the e"pansion o#  members o# the 06(T5C_ arra.

Page 39: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 39/123

bb. %i"ed a problem with +uoted arguments to arithmetic e"pansions in certain  constructs.

cc. The command word completion code now no longer returns matching directories  while searching !5T'.

dd. %i"ed a bug with Jero-padding and precision handling in snprint#/  replacement.

ee. %i"ed a bug that caused the command substitution code not to tae embedded  shell comments into account.

##. %i"ed a bug that caused .../X...// to be misinterpreted as an  arithmetic substitution.

gg. %i"ed a bug in the prompt e"pansion code that inappropriatel added a  VGG1 be#ore a VGG2 under certain circumstances.

hh. %i"ed a bug that caused 7unset &5$ to not properl reset the locale  previous versions would set the locale bac to what it was when bash

  was started rather than the sstem$s KnativeK locale/.

ii. %i"ed a bug that could cause #ile descriptors F 1G to not be closed even  when closed e"plicitl b a script.

::. %i"ed a bug that caused single +uotes to be stripped #rom 5(0-C +uoting  inside double-+uoted command substitutions.

. %i"ed a bug that could cause core dumps when 7return$ was e"ecuted as the  last element o# a pipeline inside a shell #unction.

ll. %i"ed a bug that caused EB= trap strings to overwrite commands stored in  the :obs list.

2. Changes to 6eadline

a. %i"ed a problem that caused segmentation #aults when using readline in  callbac mode and tping consecutive E& characters on an empt line.

b. %i"ed several redispla problems with multibte characters, all having to  do with the di##erent code paths and variable meanings between single-bte  and multibte character redispla.

c. %i"ed a problem with e se+uence translation when presented with the  se+uence V-VC-".

d. %i"ed a problem that prevented the 7a$ command in vi mode #rom being  undone and redone properl.

e. %i"ed a problem that prevented empt inserts in vi mode #rom being undone  properl.

#. %i"ed a problem that caused readline to initialiJe with an incorrect idea  o# whether or not the terminal can autowrap.

g. %i"ed output o# e bindings lie bash 7bind -p$/ to honor the setting o#  convert-meta and use Ve where appropriate.

h. Changed the de#ault #ilename completion #unction to call the #ilename

  de+uoting #unction i# the director completion hoo isn$t set. This means  that an director completion hoos need to de+uote the director name,  since application-speci#ic hoos need to now how the word was +uoted,  even i# no other changes are made.

Page 40: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 40/123

i. %i"ed a bug with creating the prompt #or a non-interactive search string  when there are non-printing characters in the primar prompt.

:. %i"ed a bug that caused prompts with invisible characters to be redrawn  multiple times in a multibte locale.

. %i"ed a bug that could cause the e se+uence scanning code to return the  wrong #unction.

l. %i"ed a problem with the callbac inter#ace that caused it to #ail when  using multi-character eboard macros.

m. %i"ed a bug that could cause a core dump when an edited histor entr was  re-e"ecuted under certain conditions.

n. %i"ed a bug that caused readline to re#erence #reed memor when attmpting  to displa a portion o# the prompt.

3. ew %eatures in Bash

a. Changed the parameter pattern replacement #unctions to not anchor the  pattern at the beginning o# the string i# doing global replacement - that  combination doesn$t mae an sense.

b. hen running in 7word e"pansion onl$ mode --worde"p option/, inhibit  process substitution.

c. &oadable builtins now wor on acO( D 1G.8349.

d. (hells running in posi" mode no longer set 'OE, as !O(0D re+uires.

e. The code that checs #or binar #iles being e"ecuted as shell scripts now  checs onl #or =& rather than an non-printing character.

#. <uoting the string argument to the 88 command$s ?@ operator now #orces  string matching, as with the other pattern-matching operators.

4. ew %eatures in 6eadline

a. Calling applications can now set the eboard timeout to G, allowing  poll-lie behavior.

b. The value o# ([(A0!=T6C con#igurable at compilation time/ is now used as  the de#ault last-ditch startup #ile.

c. The histor #ile reading #unctions now allow windows-lie VrVn line

  terminators.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.1-release,and the previous version, bash-3.1-rc2.

1. Changes to 6eadline

a. (everal changes to the multibte redispla code to #i" problems with  prompts containing invisible characters.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.1-rc2,

and the previous version, bash-3.1-rc1.

1. Changes to Bash

Page 41: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 41/123

a. %i"ed a bug that caused a EB= trap to overwrite a command string that$s  eventuall attached to a bacground :ob.

b. Changed some code so that #ilenames with leading tildes with spaces in the  name aren$t tilde-e"panded b the bash completion code.

c. %i"ed a bug that caused the pushd builtin to #ail to change to  directories with leading 7-$.

d. %i"ed a small memor lea in the programmable completion code.

2. Changes to 6eadline

a. %i"ed a redispla bug caused b moving the cursor verticall to a line  with invisible characters in the prompt in a multibte locale.

b. %i"ed a bug that could cause the terminal special chars to be bound in the  wrong emap in vi mode.

3. ew %eatures in Bash

a. 0# compiled #or strict !O(0D con#ormance, &0E( and CO&=( ma now  override the true terminal siJe.

4. ew %eatures in 6eadline

a. 5 new e"ternal application-controllable variable that allows the &0E(  and CO&=( environment variables to set the window siJe regardless o#  what the ernel returns.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.1-rc1,and the previous version, bash-3.1-beta1.

1. Changes to Bash

a. %i"ed a bug that could cause core dumps due to accessing the current  pipeline while in the middle o# modi#ing it.

b. %i"ed a bug that caused pathnames with bacslashes still +uoting characters  to be passed to opendir/.

c. Command word completion now obes the setting o# completion-ignore-case.

d. %i"ed a problem with redirection that caused #ile descriptors greater than  2 to be inappropriatel mared as close-on-e"ec.

e. 0n !osi" mode, a#ter 7wait$ is called to wait #or a particular process  e"plicitl, that process is removed #rom the list o# processes nown to  the shell, and subse+uent attempts to wait #or it return errors.

#. %i"ed a bug that caused e"tended pattern matching to incorrectl scan  bacslash-escaped pattern characters.

g. %i"ed a snchroniJation problem that could cause core dumps when handling  a (00C'.

h. %i"ed a bug that caused an unmatched bac+uote to be accepted without an  error when processing here documents.

i. %i"ed a small memor lea in the 7cd$ builtin.

:. %i" #or acO( D so it gets the values #or the 'O(TT[!E, 5C'T[!E, and  O(T[!E variables at build time, to support universal binaries.

Page 42: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 42/123

. %i"ed a bug that could cause an e"it trap to return the e"it status o#  the trap command rather than the status as it was be#ore the trap was  run as the shell$s e"it status.

2. ew %eatures in Bash

3. Changes to 6eadline

a. %i"ed a bug that caused reversing the incremental search direction to  not wor correctl.

b. %i"ed the vi-mode 7=$ command to onl undo up to the #irst time insert mode  was entered, as !osi" speci#ies.

c. %i"ed a bug in the vi-mode 7r$ command that le#t the cursor in the wrong  place.

4. ew %eatures in 6eadline

a. ew application-callable au"iliar #unction, rlAvariableAvalue, returns

  a string corresponding to a readline variable$s value.

b. hen parsing inputrc #iles and variable binding commands, the parser  strips trailing whitespace #rom values assigned to boolean variables  be#ore checing them.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.1-beta1,and the previous version, bash-3.1-alpha1.

1. Changes to Bash

a. 5dded some sstem-speci#ic signal names.

b. %i"ed a tpo in the ulimit builtin to mae 7"$ the right option to  maniuplate the limit on #ile locs.

c. %i"ed a problem with using Z? to append to inde" G o# an arra variable  when not using subscript snta".

d. 5 #ew changes to con#igure.in to remove calls to obsolete or outdated  macros.

e. ae sure changes to variables bash handles speciall e.g., &CA5&&/ are  made when the variable is set in the temporar environment to a command.

#. ae sure changes to variables bash handles speciall e.g., &CA5&&/ are  made when the variable is modi#ied using 7print# -v$.

g. The e"port environment is now remade on cgwin when 'OE is changed, so  &&s bash is lined against pic up the new value. This #i"es problems  with tilde e"pansion when lining against and alread-installed readline.

h. (mall #i" to the logic #or per#orming tilde e"pansion in posi" mode, so  e"pansion on the right-hand side o# an assignment statement taes place.

i. %i"ed a bug that prevented redirections associated with a shell #unction  #rom being e"ecuted when in a subshell.

:. %i"ed 7source$ and 7.$ builtins to not re+uire an e"ecutable #ile when  searching !5T' #or a #ile to source.

Page 43: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 43/123

. %i"ed a bug that caused incorrect word splitting in a #unction when 0%(  was declared local, then unset.

l. %i"ed a problem with the 7ill$ builtin that prevented sending signals  to a process group under certain circumstances when providing a pid G.

m. hen in !O(0D mode, 7pwd$ now checs that the value it prints is the same  director as 7.$, even when displaing !.

n. %i"ed a problem with the 7read$ builtin when reading a script #rom standard  input and reading data #rom the same #ile.

o. %i"ed a problem with the 7tpe$ and 7command$ builtins that caused absolute  pathnames to be displaed incorrectl.

p. (ome changes to the 7bg$ builtin #or !O(0D con#ormance.

+. The 7#c$ builtin now removes the 7#c$ command that caused it to invoe an  editor on speci#ied histor entries #rom the histor entirel, rather than  simpl ignoring it.

r. hen in !O(0D mode, the 7v$ command in vi editing mode simpl invoes vi  on the current command, rather than checing %CE0T and E0TO6.

s. %i"ed a small memor lea in the pathname canonicaliJation code.

t. %i"ed a bug that caused the e"panded value o# a $...$ string to be  incorrectl re-+uoted i# it occurred within a double-+uoted M...N  parameter e"pansion.

u. 6estored de#ault emacs-mode e binding o# -T5B to dnamic-complete-histor.

v. %i"ed a bug that caused core dumps when interrupting loops running builtins

  on some sstems.

w. ae sure that some o# the #unctions bash provides replacements #or are  not cpp de#ines.

". The code that scans embedded commands #or the parser 7...7 and ...// is  now more aware o# embedded comments and their e##ect on +uoted strings.

. Changed the 7-n$ option to the 7histor$ builtin to not reset the number o#  histor lines read in the current session a#ter reading the new lines #rom  the histor #ile i# the histor is being appended when it is written to  the #ile, since the appending taes care o# the problem that the ad:ustment  was intended to solve.

J. 0mproved the error message displaed when a shell script #ails to e"ecute  because the environment and siJe o# command line arguments are too large.

aa. 5 small #i" to mae sure that '0(TC is evaluated whenever the shell is  saving commands to the histor list, not :ust when '0(T(0QE is de#ined.

2. Changes to 6eadline

a. The 7change-case$ command now correctl changes the case o# multibte  characters.

b. Changes to the shared librar construction scripts to deal with indows

  && naming conventions #or Cgwin.

c. %i"ed the redispla code to avoid core dumps resulting #rom a poorl-timed  (00C'.

Page 44: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 44/123

d. %i"ed the non-incremental search code in vi mode to dispose o# an current  undo list when coping a line #rom the histor into the current editing  bu##er.

e. The variable assignment code now ignores whitespace at the end o# lines  when assigning to boolean variables.

#. The 7C-w$ binding in incremental search now understands multibte  characters.

3. ew %eatures in Bash

a. 5 new con#iguration option, 7--enable-strict-posi"-de#ault$, which will  build bash to be !O(0D con#orming b de#ault.

4. ew %eatures in 6eadline

a. 0# the rlAcompletionA+uerAitems is set to a value G, readline never  ass the user whether or not to view the possible completions.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.1-alpha1,and the previous version, bash-3.G-release.

1. Changes to Bash

a. %i"ed a bug that caused bash to crash i# re#erencing an unset local arra.

b. %i"ed a problem that caused tilde e"pansion to not be per#ormed be#ore  attempting globbing word completion.

c. %i"ed an incompatibilit so that a #irst argument to trap that$s a valid  signal number will be trated as a signal rather than a command to e"ecute.

d. %i"ed MPwordN e"pansion to correctl compute the length o# a string  containing multibte characters.

e. %i"ed a bug that caused bash to not pass the correct #lags #or signal  disposition to child processes.

#. %i"ed a bug that caused 7#c -l$ to list one too man histor entries.

g. (ome #i"es to 7#c$ #or !O(0D con#ormance.

h. (ome #i"es to :ob status displa #or !O(0D con#ormance.

i. %i"ed a bug that caused 7command -v$ to displa output i# a command was not  #ound -- it should be silent.

:. 0n !O(0D mode, 7tpe$ and 7command -8v]9$ do not report non-e"ecutable  #iles, even i# the shell will attempt to e"ecute them.

. %i"ed a bug that caused the 7??$ operator to the 88 command to not attempt  e"tended pattern matching.

l. %i"ed the brace e"pansion code to handle characters whose value e"ceeds 12R.

m. %i"ed 7print#$ to handle strings with a leading 7VG$ whose length is  non-Jero.

n. %i"ed a couple o# problems with brace e"pansion where 7M$ was handled  incorrectl.

Page 45: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 45/123

o. %i"ed o##-b-one error when calculating the upper bound o# 7o##set$ when  processing the Marra8I9Lo##setLlengthN e"pansion.

p. (stem-speci#ic con#iguration changes #orL %reeB( ^.", 0nteri", acO( D  1G.4, &inu" 2.4Z ernels, &inu" 3." ernels, ragon#l B(, <D \.",  Cgwin

+. %i"ed a bug that caused the shell to ignore the status o# the rightmost  command in a pipeline when the 7pipe#ail$ option was enabled.

r. %i"ed a completion bug that caused core dumps when e"panding a director  name.

s. %i"ed a bug that prevented 7hash -d$ #rom removing commands #rom the hash  table.

t. %i"ed word splitting to avoid reall bad +uadratic per#ormance when  e"panding long lists.

u. %i"ed a bug that caused negative o##sets in substring e"pansion to use the  wrong values.

v. %i"ed a bug in print# that caused it to not return #ailure on write errors.

w. %i"ed a bug that caused commands in subshells to not be properl timed.

". The shell parser no longer attempts to parse a compound assignment speciall  unless in a position where an assignment statement is acceptable or parsing  arguments to a builtin that accepts assignment statements.

. %i"ed a problem that caused a 7case$ statement to be added to the histor  incorrectl as a single command i# the 7case word$ was on one line and the  7in$ on another.

J. %i"ed a problem that caused internal shell +uoting characters to be  incorrectl +uoted with bacslashes under some circumstances.

aa. The shell now per#orms correct word splitting when 0%( contains multibte  characters.

bb. The mail checing code now resets the cached #ile in#ormation i# the siJe  drops to G, even i# the times don$t change.

cc. 5 completed command name that is #ound in !5T' as well as the name o# a  director in the current director no longer has a slash appended in certain  circumstancesL a single instance #ound in !5T' when 7.$ is not in !5T',  and multiple instances #ound in !5T', even when 7.$ is in !5T'.

dd. 0ncorporated tilde e"pansion into the word e"pansion code rather than as a  separatel-called #unction, #i"ing some cases where it was per#ormed  inappropriatel e.g., a#ter the second 7?$ in an assignment statement or  in a double-+uoted parameter e"pansion/.

ee. %i"ed several bugs encountered when parsing compound assignment statements,  so that compound assignments appearing as arguments to builtins are no  longer double-e"panded.

##. %i"ed a bug in the command e"ecution code that caused asnchronous commands  containing command substitutions to not put the terminal in the wrong  process group.

gg. Bash now handles the case where the COT0=E #lag causes waitpid/ to  return -1>E0]5& at runtime as well as con#iguration time.

Page 46: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 46/123

hh. %i"ed parser to generate an error when the pipeline 7argument$ to 7Y$ or  7time$ is =&&.

ii. The shell now taes a little more care when manipulating #ile descriptors  greater than H with the 7e"ec$ builtin.

::. %i"ed a bug that caused variable assignments preceding the 7command$ builtin  preceding a special builtin to be preserved a#ter the command completed in  !O(0D mode.

. %i"ed a bug that allowed variables beginning with a digit to be created.

ll. %i"ed a bug that caused a VnewlineF to be removed when parsing a $...$  construct.

mm. 5 shell whose name begins with 7-$ will now be a restricted shell i# the  remainder o# the name indicates it should be restricted.

nn. %i"ed a bug that could cause a core dump i# %=C5E were changed or unset  during a #unction$s e"ecution.

oo. %i"ed a bug that caused e"ecuting a 7return$ in a #unction to not e"ecute  a 6ET=6 trap. The 6ET=6 trap is inherited b shell #unctions onl i#  #unction tracing is globall enabled or has been enabled #or that #unction.

pp. %i"ed cases where var8I9 was not handled e"actl lie var, when var is a  scalar variable.

++. %i"ed a bug that caused the #irst character a#ter a (00T to be discarded  under certain circumstances.

rr. %i"ed e"it status code so that a suspended :ob returns 12RZsignal as its  e"it status preventing commands a#ter it in 7))$ lists #rom being  e"ecuted/.

ss. %i"ed a bug that caused the shell parser state to be changed b e"ecuting  a shell #unction as a result o# word completion.

tt. %i"ed a long-standing bug that caused $V1WW$ characters in variable  values to be discarded when e"panded in double-+uoted strings.

uu. %i"ed a bug that caused 65O to be re-seeded multiple times in a  subshell environment.

vv. E"tensive changes to the :ob management code to avoid the pid-reuse and  pid-aliasing problems caused b retaining the e"it status o# too man :obs,  but still retain as man bacground :ob statuses as !O(0D re+uires.

ww. %i"ed a parser bug in processing VnewlineF that caused things lie

echo ^/ V echo \//

  to not wor correctl.

"". 7pwd -!$ now sets ! to a director name containing no smbolic lins  when in posi" mode, as !O(0D re+uires.

. 0n posi" mode, bash no longer sets ! to a name containing no smbolic  lins i# a director is chosen #rom C!5T'.

JJ. The word splitting code now treats an 0%( character that is not space,  tab, or newline and an ad:acent 0%( white space as a single delimiter, as  (=(v3>D!\ re+uire.

Page 47: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 47/123

aaa. The 7read$ builtin now checs whether or not the number o# #ields read is  e"actl the same as the number o# variables instead o# :ust assigning the  rest o# the line minus an trailing 0%( white space/ to the last  variable. This is what !O(0D>(=(>D! all re+uire.

bbb. %i"ed a bug that caused 7read$ to alwas chec whether or not #d G was a  pipe, even when reading #rom another #ile descriptor.

ccc. %i"ed a bug that caused short-circuiting o# e"ecution even i# the return  value was being inverted.

ddd. %i"ed a bug that caused a core dump while decoding V escapes in !(1 i#  ! was unset.

eee. %i"ed a bug in 7read$ that counted internal +uoting characters #or the  purposes o# 7read -n$.

###. %i"ed a bug so that a #unction de#inition in a pipeline causes a child  process to be #ored at the right time.

ggg. Bash will not attempt to lin against a readline librar that doesn$t  have rlAgnuAreadlineAp ?? 1.

hhh. %i"ed a bug that caused 7read$ to consume one too man characters when  reading a #i"ed number o# characters and the th character is a bacslash.

iii. %i"ed a bug that caused 7unset$ on variables in the temporar environment  to leave them set when 7unset$ completed.

:::. %i"ed a bug that caused bash to close #d 2 i# an 7e"ec$ #ailed and the  shell didn$t e"it.

. The completion code is more care#ul to not turn 7>$ or 7>>>$ into 7>>$,

  #or those sstems on which 7>>$ has special meaning.

lll. %i"ed a bug that caused command substitution in asnchronous commands to  close the wrong #ile descriptors.

mmm. The shell no longer prints status messages about terminated bacground  processes unless :ob control is active.

nnn. %i"ed a bug that prevented multiple consecutive invocations o# 7histor -s$  #rom adding all the commands to the histor list.

ooo. 5dded a couple o# changes to mae arithmetic e"pansion more consistent in  all its conte"ts still not per#ect/.

ppp. %i"ed a bug that caused the parser to occasionall not #ind the right  terminating K7K in an old-stle command substitution.

+++. %i"ed a bug that caused core dumps when the shell was reading its non-  interactive input #rom #d G and #d G was duplicated and restored using a  combination o# 7e"ec$ to save/ and redirection to restore/.

rrr. %i"ed a problem that caused loops in sourced scripts to not be cleaned  up properl when a 7return$ is e"ecuted.

sss. Change internal command substitution completion #unction to append a slash  to director names in the command.

2. Changes to 6eadline

a. %i"ed a bug that caused multiliine prompts to be wrapped and displaed

Page 48: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 48/123

  incorrectl.

b. %i"ed a bug that caused !> in emacs mode to #ail to displa the current  line correctl.

c. %i"ed a problem in computing the number o# invisible characters on the #irst  line o# a prompt whose length e"ceeds the screen width.

d. %i"ed vi-mode searching so that #ailure preserves the current line rather  than the last line in the histor list.

e. %i"ed the vi-mode 7@$ command change-case/ to have the correct behavior at  end-o#-line when manipulating multibte characters.

#. %i"ed the vi-mode 7r$ command change-char/ to have the correct behavior at  end-o#-line when manipulating multibte characters.

g. %i"ed multiple bugs in the redispla o# multibte charactersL displaing  prompts longer than the screen width containing multibte characters,

h. %i" the calculation o# the number o# phsical characters in the prompt

  string when it contains multibte characters.

i. 5 non-Jero value #or the 7rlAcompleteAsuppressAappend$ variable now causes  no 7>$ to be appended to a director name.

:. %i"ed #orward-word and bacward-word to wor when words contained  multibte characters.

. %i"ed a bug in #inding the delimiter o# a 7;$ substring when per#orming  histor e"pansion in a locale that supports multibte characters.

l. %i"ed a memor lea caused b not #reeing the timestamp in a histor entr.

m. %i"ed a bug that caused KV-"K stle e bindings to not obe the setting  o# the 7convert-meta$ variable.

n. %i"ed saving and restoring primar prompt when prompting #or incremental  and non-incremental searchesX search prompts now displa multibte  characters correctl.

o. %i"ed a bug that caused es originall bound to sel#-insert but shadowed  b a multi-character e se+uence to not be inserted.

p. %i"ed code so rlAprepAtermA#unction and rlAdeprepAtermA#unction aren$t  dere#erenced i# =&& matching the documentation/.

+. E"tensive changes to readline to add enough state so that commands  re+uiring additional characters searches, multi-e se+uences, numeric  arguments, commands re+uiring an additional speci#ier character lie  vi-mode change-char, etc./ wor without snchronousl waiting #or  additional input.

r. &ots o# changes so readline builds and runs on in.

s. 6eadline no longer tries to modi# the terminal settings when running in  callbac mode.

t. The 6eadline displa code no longer sets the location o# the last invisible  character in the prompt i# the V8V9 se+uence is empt.

3. ew %eatures in Bash

a. Bash now understands &CAT0E as a special variable so that time displa

Page 49: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 49/123

  tracs the current locale.

b. B5('A56C, B5('A56], B5('A(O=6CE, and B5('A&0EO are no longer created  as 7invisible$ variables and ma not be unset.

c. 0n !O(0D mode, i# 7"pgAecho$ option is enabled, the 7echo$ builtin doesn$t  tr to interpret an options at all, as !O(0D re+uires.

d. The 7bg$ builtin now accepts multiple arguments, as !O(0D seems to speci#.

e. %i"ed vi-mode word completion and glob e"pansion to per#orm tilde  e"pansion.

#. The 7$ mathematic e"ponentiation operator is now right-associative.

g. The 7ulimit$ builtin has new optionsL -i ma" number o# pending signals/,  -+ ma" siJe o# !O(0D message +ueues/, and -" ma" number o# #ile locs/.

h. 5 bare 7U$ once again e"pands to the current :ob when used as a :ob  speci#ier.

i. The 7Z?$ assignment operator append to the value o# a string or arra/ is  now supported #or assignment statements and arguments to builtin commands  that accept assignment statements.

:. B5('ACO5 now preserves its value when a EB= trap is e"ecuted.

. The 7gnuAerr#mt$ option is enabled automaticall i# the shell is running  in an emacs terminal window.

l. ew con#iguration optionL --single-help-strings. Causes long help te"t  to be written as a single stringX intended to ease translation.

m. The CO!AO6B6E5_( variable now causes the list o# word brea characters

  to be emptied when the variable is unset.

n. 5n un+uoted e"pansion o# when 0%( is empt now causes the positional  parameters to be concatenated i# the e"pansion doesn$t undergo word  splitting.

o. Bash now inherits A #rom the environment i# it appears there at startup.

p. ew shell optionL nocasematch. 0# non-Jero, shell pattern matching ignores  case when used b 7case$ and 788$ commands.

+. The 7print#$ builtin taes a new optionL -v var. That causes the output  to be placed into var instead o# on stdout.

r. B de#ault, the shell no longer reports processes ding #rom (0!0!E.

s. Bash now sets the e"tern variable 7environ$ to the e"port environment it  creates, so C librar #unctions that call getenv/ and can$t use the  shell-provided replacement/ get current values o# environment variables.

4. ew %eatures in 6eadline

a. The e se+uence sent b the epad 7delete$ e is now automaticall  bound to delete-char.

b. 5 negative argument to menu-complete now ccles bacward through the

  completion list.

c. 5 new bindable readline variableL bind-tt-special-chars. 0# non-Jero,  readline will bind the terminal special characters to their readline

Page 50: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 50/123

  e+uivalents when it$s called on b de#ault/.

d. ew bindable commandL vi-rubout. (aves deleted te"t #or possible  reinsertion, as with an vi-mode 7te"t modi#ication$ commandX 7D$ is bound  to this in vi command mode.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.G-release,and the previous version, bash-3.G-rc1.

1. Changes to Bash

a. %i"ed a boundar overrun that could cause segmentation #aults when the  completion code hands an incomplete construct to the word e"pansion  #unctions.

b. Changed posi" mode behavior so that an error in a variable assignment  preceding a special builtin causes a non-interactive shell to e"it.

c. Change the director e"pansion portion o# the completion code to not  e"pand embedded command substitutions i# the director name appears in

  the #ile sstem.

d. %i"ed a problem that caused 7bash -r$ to turn on restrictions be#ore  reading the startup #iles.

e. %i"ed a problem with the de#ault operation o# the 7umas$ builtin.

2. Changes to 6eadline

a. %i"ed a problem with readline saving the contents o# the current line  be#ore beginning a non-interactive search.

b. %i"ed a problem with EO% detection when using rlAeventAhoo.

c. %i"ed a problem with the vi mode 7p$ and 7!$ commands ignoring numeric  arguments.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.G-rc1,and the previous version, bash-3.G-beta1.

1. Changes to Bash

a. %i"ed a bug that caused incorrect behavior when re#erecing element G o#  an arra using arra, element G was unset, and 7set -u$ was enabled.

b. (stem-speci#ic changes #orL (CO =ni" 3.2, Tandem.

c. %i"ed a bug that caused inappropriate word splitting when a variable was  e"panded within a double-+uoted string that also included I.

d. %i"ed a bug that caused 7pwd$ to not displa anthing in phsical mode  when the #ile sstem had changed underneath the shell.

e. %i"ed a bug in the pre- and post- increment and decrement parsing in the  e"pression evaluator that caused errors when the operands and corresponding  operators were separated b whitespace.

#. %i"ed a bug that caused 7histor -p$ to add an entr to the histor list,

  counter to the documentation. _eeps the histor e"pansions invoed b  emacs-mode command line editing #rom doing that as well./

g. %i"ed a bug that could cause a core dump i# 7cd$ is ased to print out a

Page 51: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 51/123

  pathname longer than !5T'A5D characters.

h. %i"ed a bug that caused :obs to be put into the wrong process group under  some circumstances a#ter enabling :ob control with 7set -m$.

i. 7unalias$ now returns #ailure i# no alias name arguments are supplied.

:. ocumented the characters not allowed to appear in an alias name.

. is no longer e"panded as i# in double +uotes when it appears in the  bod o# a here document, as the (=( seems to re+uire.

l. The 7bashbug$ script now uses a director in T!06 #or e"clusive  access rather than tring to guess how the underling O( provides #or  secure temporar #ile creation.

m. %i"ed a #ew problems with 7cd$ and 7pwd$ when ased to operate on pathnames  longer than !5T'A5D characters.

n. %i"ed a memor lea caused when creating multiple local arra variables  with identical names.

o. %i"ed a problem with calls to getcwd/ so that bash now operates better  when the #ull pathname to the current director is longer than !5T'A5D  btes.

p. The 7trap$ builtin now reports an error i# a single non-signal argument  is speci#ied.

+. %i"ed a bug that caused 7umas$ to not wor correctl when presented  with a mas o# all Gs.

r. hen 7getopts$ reaches the end o# options, O!T56 is unset, as !O(0D  appears to speci#.

s. 0nteractive mode now depends on whether or not stdin and stderr are  connected to a ttX #ormerl it was stdin and stdout. !O(0D re+uires  this.

t. %i"ed vi-mode completion to wor more as !O(0D speci#ies e.g., doing the  right ind o# #ilename generation/.

2. Changes to 6eadline

a. %i"ed a problem that could cause readline to re#er to #reed memor when  moving between histor lines while doing searches.

b. 0mprovements to the code that e"pands and displas prompt strings  containing multibte characters.

c. %i"ed a problem with vi-mode not correctl remembering the numeric argument  to the last 7c$hange command #or later use with 7.$.

d. %i"ed a bug in vi-mode that caused multi-digit count arguments to wor  incorrectl.

e. %i"ed a problem in vi-mode that caused the last te"t modi#ication command  to not be remembered across di##erent command lines.

#. %i"ed problems with changing characters and changing case at the end o#

  the line.

3. ew %eatures in Bash

Page 52: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 52/123

a. The 7:obs$, 7ill$, and 7wait$ builtins now accept :ob control notation  even i# :ob control is not enabled.

b. The historical behavior o# 7trap$ that allows a missing 7action$ argument  to cause each speci#ied signal$s handling to be reset to its de#ault is  now onl supported when 7trap$ is given a single non-option argument.

4. ew %eatures in 6eadline

a. hen listing completions, directories have a 7>$ appended i# the  7mar-directories$ option has been enabled.

------------------------------------------------------------------------------This document details the changes between this version, bash-3.G-beta1,and the previous version, bash-3.G-alpha.

1. Changes to Bash

a. %i"es to build correctl when arras are not compiled into the shell.

b. %i"ed command substitution to run an e"it trap de#ined in the command

  substitution be#ore returningX the e"it trap is not inherited #rom the  calling shell.

c. %i"es to process group snchroniJation code so that ever child process  attempts to set the terminal$s process groupX #i"es some snchroniJation  problems on &inu" ernels that schedule the child to alwas run be#ore  the parent.

d. %i"ed processing o# octal and he" constants in print# builtin #or !O(0D.2  compliance.

e. %i"ed a couple o# core dumps in the pattern removal code.

#. %i"es to the arra subrange e"traction code to deal better with sparse  arras.

g. !arser errors and other errors that result in the shell e"iting now cause  the e"it trap to be run.

h. Change the command substitution completion #unctions to not append an  closing +uote, because it would be inserted a closing K7K or K/K.

i. %i" histor initialiJation so assignments to histchars made in startup  #iles are honored.

:. 0# an e"it trap does not contain a call to 7e"it$, the shell now uses

  the e"it status o# the last command e"ecuted be#ore the trap as the e"it  status o# the shell.

. The parser now prompts with !(2 i# it reads a newline while parsing a  compound arra assignment statement.

l. hen per#orming a compound arra assignment, the parser doesn$t treat  words o# the #orm 8inde"9?value as assignments i# the$re the result o#  e"pansions.

m. %i"ed a bug that caused 7return$ e"ecuted in a trap command to mae the  shell thin it was still running the trap.

n. %i"ed the value o# errno set b the pathname canonicaliJation #unctions.

o. Changed the grammar so that 7time$ alone on a line times a null command  rather than being a snta" error.

Page 53: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 53/123

p. The pattern substitution code no longer per#orms +uote removal on the  pattern be#ore tring to match it, as the pattern removal #unctions do.

+. %i"ed a bug that could cause core dumps when checing whether a +uoted  command name was being completed.

r. %i"es to the pattern removal and pattern replacement e"pansions to deal  with multibte characters better and #aster/.

s. %i" to the substring e"pansion MparamLo##8Llen9N/ to deal with possibl  multibte/ characters instead o# raw btes.

t. %i"ed a bug that caused some e bindings set in an inputrc to be ignored  at shell startup.

u. %i"ed a bug that caused unsetting a local variable within a #unction to  not wor correctl.

v. %i"ed a bug that caused invalid variables to be created when using  7read -a$.

w. %i"ed a bug that caused KIK to e"pand incorrectl when used as the right  hand side o# a parameter e"pansion such as MwordL?KIKN i# the #irst  character o# 0%( was not a space.

". %i"ed a slight cosmetic problem when printing commands containing a  7F)word$ redirection.

. %i"ed a problem that could cause here documents to not be created correctl  i# the sstem temporar director did not allow writing.

2. Changes to 6eadline

a. Change to histor e"pansion #unctions to treat 7$ as e+uivalent to word  one, as the documention states.

b. (ome changes to the displa code to improve displa and redispla o#  multibte characters.

c. Changes to speed up the multibte character redispla code.

d. %i"ed a bug in the vi-mode 7E$ command that caused it to sip over the  last character o# a word i# invoed while point was on the word$s  ne"t-to-last character.

e. %i"ed a bug that could cause incorrect #ilename +uoting when

  case-insensitive completion was enabled and the word being completed  contained bacslashes +uoting word brea characters.

#. %i"ed a bug in redispla triggered when the prompt string contains  invisible characters.

g. %i"ed some displa and other/ bugs encountered in multibte locales  when a non-ascii character was the last character on a line.

h. %i"ed some displa bugs caused b multibte characters in prompt strings.

i. %i"ed a problem with histor e"pansion caused b non-whitespace characters  used as histor word delimiters.

3. ew %eatures in Bash

a. print# builtin understands two new escape se+uencesL VK and V;.

Page 54: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 54/123

b. 7echo -e$ understands two new escape se+uencesL VK and V;.

c. The = 7gette"t$ pacage and libintl have been integratedX the shell$s  messages can be translated into di##erent languages.

d. The 7V$ prompt e"pansion now abbreviates 'OE as 7@$, lie 7Vw$.

e. The error message printed when bash cannot open a shell script supplied  as argument 1 now includes the name o# the shell, to better identi#  the error as coming #rom bash.

4. ew %eatures in 6eadline

a. ew application variable, rlAcompletionA+uoteAcharacter, set to an  +uote character readline #inds be#ore it calls the application completion  #unction.

b. ew application variable, rlAcompletionAsuppressA+uote, settable b an  application completion #unction. 0# set to non-Jero, readline does not  attempt to append a closing +uote to a completed word.

c. ew application variable, rlAcompletionA#oundA+uote, set to a non-Jero  value i# readline determines that the word to be completed is +uoted.  (et be#ore readline calls an application completion #unction.

d. ew #unction hoo, rlAcompletionAwordAbreaAhoo, called when readline  needs to brea a line into words when completion is attempted. 5llows  the word brea characters to var based on position in the line.

e. ew bindable commandL uni"-#ilename-rubout. oes the same thing as  uni"-word-rubout, but adds 7>$ to the set o# word delimiters.

------------------------------------------------------------------------------

This document details the changes between this version, bash-3.G-alpha,and the previous version, bash-2.G^b-release.

1. Changes to Bash

a. %i"es so that the shell will compile without some o# the de#ault options  de#ined.

b. %i"ed an error message that did not pass enough arguments to print#.

c. %i"ed a bug that caused input redirection to a builtin inside a script  being read #rom standard input to result in the rest o# the alread-  read and bu##ered script to be discarded.

d. %i"ed a bug that caused subshell initialiJation to close the #ile  descriptor #rom which the shell was reading a script under certain  circumstances.

e. %i"ed a bug that caused the shell to not advance a string pointer over  a null wide character when doing string operations.

#. %i"ed the internal logout code so that shells that time out waiting #or  input using TO=T/ run @>.bashAlogout.

g. !ortabilit and con#iguration changes #orL cgwin, '!>=D, =>%reeB(.

h. The parser no longer adds implicit double +uotes to ...// arithmetic  commands.

i. The ...// arithmetic command evaluation code was #i"ed to not dump core

Page 55: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 55/123

  when the e"panded string is null.

:. The ...// arithmetic command evaluation code was #i"ed to not per#orm  variable assignments while e"panding the e"pression.

. %i"ed a bug that caused word splitting to be per#ormed incorrectl when  0%( is set, but null.

l. %i"ed a bug in brace e"pansion that caused a +uoted 7$ preceding an  open brace to inhibit brace e"pansion.

m. %i"ed a bug that caused a leading 7-$ in the shell$s name to cause it to  not be recogniJed as a restricted shell.

n. %i"ed a bug in the arithmetic evaluation code that could cause long:mps  to an invalid location and result in a core dump.

o. %i"ed a bug in the calculation o# how man histor lines are new in a  single shell session when reading new histor lines #rom a #ile with  7histor -n$.

p. %i"ed a bug in pathname canonicaliJation that caused the shell to dump  core when presented with a pathname longer than !5T'A5D.

+. %i"ed the parser so that it doesn$t tr to compare a char variable to  EO%, which #ails when chars are unsigned.

r. %i"ed a bug in the simple command e"ecution code that caused occasional  core dumps.

s. The shell does a better :ob o# saving an partial parsing state during  operations which cause a command to be e"ecuted while a line is being  entered and parsed.

t. The completion code now splits words more lie the e"pansion code when  0%( is used to split.

u. The locale code does a better :ob o# recomputing the various locale  variable values when &CA5&& is unset.

v. The programmable completion code does a better :ob o# de+uoting e"panded  word lists be#ore comparing them against the word to be matched.

w. The shell no longer seg #aults i# the e"panded value o# !(4 is null  and 7set -"$ is enabled.

". %i"ed a bug that caused core dumps when a here string e"panded to =&&.

. The mail checing code now maes sure the mailbo" is bigger be#ore  reporting the e"istence o# new mail.

J. The parser does not tr to e"pand $...$ and K...K when the appear  within double +uotes unless the 7e"t+uote$ option has been enabled with  7shopt$. %or bacwards compatibilit, it is enabled b de#ault.

aa. %i"ed a bug that caused 7#or "X do ...$ and 7select "X do ... to use  I instead o# KIK #or the implicit list o# arguments.

bb. %i"ed a bug that caused a subshell o# a restricted shell e.g., one  spawned to e"ecute a pipeline/ to not e"it immediatel i# attempting

  to use a command containing a slash.

cc. %i"ed a problem with empt replacements #or a pattern that doesn$t match  when per#orming Mparam>word>N e"pansion.

Page 56: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 56/123

dd. ord e"pansions per#ormed while e"panding redirections no longer search  a command$s temporar environment to e"pand variable values.

ee. 0mprovements to the alias e"pansion code when e"panding subse+uent words  because an aliase$s value ends with a space.

##. 7cd -$ now prints the current woring director a#ter a success#ul chdir  even when the shell is not interactive, as the standard re+uires.

gg. The shell does a better :ob o# ensuring a child process dies o# (00T  be#ore resending (00T to itsel#.

hh. The arithmetic e"pansion variable assignment code now does the right  thing when assigning to 7special$ variables lie O!T0.

ii. hen histor e"pansion veri#ication is enabled, the bash readline helper  #unctions that do histor e"pansion on the current line don$t print  the results.

::. %i"ed bugs with multiple consecutive alias e"pansion when one o# the

  e"pansions ends with a space.

. %i"ed a problem in the programmable completion code that could cause core  dumps when tring to initialiJe a set o# possible completions #rom a  list o# variables.

ll. The V8 and V9 escape characters are now ignored when decoding the prompt  string i# the shell is started with editing disabled.

mm. %i"ed a bug that could leave e"tra characters in a string when doing  +uoted null character removal.

nn. Command substitution and other subshell operations no longer reset the

  line number aids the bash debugger/.

oo. Better line number management when e"ecuting simple commands, conditional  commands, #or commands, and select commands.

pp. The globbing code now uses malloc, with its better #ailure properties,  rather than alloca/.

++. %i"ed a bug that caused e"pansions lie PMa829L?valueN to create the  appropriate arra element instead o# a variable named 7a829$.

rr. %i"ed a bug in the handling o# a 7;.../$ pattern immediatel #ollowing  a 7$ when e"tglob is enabled.

ss. %i"ed a bug that caused a 7return$ invoed in an e"it trap when e"it is  invoed in a #unction to misbehave.

tt. %i"ed a bug that caused CT&E(C and CT&=& characters to not be escaped  b the internal shell string +uoting #unctions.

uu. %i"ed a bug that caused +uoted null characters in an e"panded word list  to be inappropriatel assigned to an arra variable when using 7read -a$.

vv. %i"ed a bug that caused redirections accompaning a null command to persist  in the current shell.

ww. %i"ed a bug that caused the prompt to be printed when the shell was  e"panding a multiline alias.

"". %i"ed a bug that resulted in core dumps when the completion #or a command

Page 57: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 57/123

  changed the compspec.

. %i"ed a bug that caused evaluation o# programmable completions to print  noti#ications o# completed :obs.

JJ. Bash now disables line editing when E5C( ?? 7t$ and TE6 ?? 7dumb$  which is what emacs shell windows do/.

aaa. 0n posi" mode, 7ill -l$ causes signal names to be displaed without  a leading 7(0$.

bbb. Clear error #lag on standard output so it doesn$t persist across multiple  builtin commands.

ccc. 0n posi" mode, 7alias$ displas alias values without the leading 7alias$,  so the output cannot be used as subse+uent input.

ddd. 0n posi" mode, the 7trap$ builtin doesn$t chec whether or not its  #irst argument is a signal speci#ication and revert the signal handling  to its original disposition i# it is.

eee. %i"ed several bugs in the handling o# KK and KMarra89NK b the  pattern substitution and removal e"pansions.

###. %i"ed several problems with the handling o# Marra8I9N, Marra89N,  I, and b the indirect variable e"pansion code.

ggg. %i"ed a bug that did not allow 7time$ to be aliased.

hhh. 0mproved the mail checing code so it won$t chec and possibl cause an  %( #ile sstem mount/ until 50&!5T' or 50& is given a value -- there  is no de#ault i# E%5=&TA50&A06ECTO6[ is not de#ined at compile time.  0t is computed b con#igure, but can be Punde#$d in con#ig-bot.h./

iii. 0# the 7chwinsiJe$ option is enabled, the shell checs #or window siJe  changes i# a child process e"its due to a signal.

:::. 6emoved the attempts to avoid adding a slash at the end o# a completed  e"ecutable name i# there was a director with the same name in the  current director.

. %i"ed !5T' looup code so it treats the permission bits separatel #or  owner, group, and other, rather than checing them all.

lll. %i"ed the locale code to reset the parser$s idea o# the character class  blanF, which controls how it splits toens, when the locale changes.

mmm. The shell now binds its special readline #unctions and e bindings onl  i# the user$s inputrc #ile has not alread bound them.

nnn. The shell now reports on processes that dump core due to signals when  invoed as 7-c command$.

2. Changes to 6eadline

a. %i"es to avoid core dumps because o# null pointer re#erences in the  multibte character code.

b. %i" to avoid in#inite recursion caused b certain e combinations.

c. %i"ed a bug that caused the vi-mode 7last command$ to be set incorrectl.

d. 6eadline no longer tries to read ahead more than one line o# input, even  when more is available.

Page 58: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 58/123

e. %i"ed the code that ad:usts the point to not mishandle null wide  characters.

#. %i"ed a bug in the histor e"pansion 7g$ modi#ier that caused it to sip  ever other match.

g. %i"ed a bug that caused the prompt to overwrite previous output when the  output doesn$t contain a newline and the locale supports multibte  characters. This same change #i"es the problem o# readline redispla  slowing down dramaticall as the line gets longer in multibte locales.

h. 'istor traversal with arrow es in vi insertion mode causes the cursor  to be placed at the end o# the new line, lie in emacs mode.

i. The locale initialiJation code does a better :ob o# using the right  precedence and de#aulting when checing the appropriate environment  variables.

:. %i"ed the histor word toeniJer to handle and F better when used as  part o# bash.

. The overwrite mode code received several bug #i"es to improve undo.

l. an speedups to the multibte character redispla code.

m. The callbac character reading inter#ace should not hang waiting to read  eboard input.

n. %i"ed a bug with redoing vi-mode 7s$ command.

o. The code that initialiJes the terminal tracs changes made to the terminal  special characters with stt1/ or e+uivalent/, so that these changes  are re#lected in the readline bindings. ew application-callable #unction

  to mae it worL rlAttAunsetAde#aultAbindings/.

p. %i"ed a bug that could cause garbage to be inserted in the bu##er when  changing character case in vi mode when using a multibte locale.

+. %i"ed a bug in the redispla code that caused problems on sstems  supporting multibte characters when moving between histor lines when the  new line has more glphs but #ewer btes.

r. =ndo and redo now wor better a#ter e"iting vi insertion mode.

s. ae sure sstem calls are restarted a#ter a (00C' is received using  (5A6E(T56T.

t. 0mprovements to the code that displas possible completions when using  multibte characters.

u. %i"ed a problem when parsing nested i# statements in inputrc #iles.

v. The completer now taes multibte characters into account when looing #or  +uoted substrings on which to per#orm completion.

w. The histor search #unctions now per#orm better bounds checing on the  histor list.

3. ew %eatures in Bash

a. 5(0 string e"pansion now implements the V"Mhe"digitsN escape.

b. There is a new loadable 7str#time$ builtin.

Page 59: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 59/123

c. ew variable, CO!AO6B6E5_(, which controls the readline completer$s  idea o# word brea characters.

d. The 7tpe$ builtin no longer reports on aliases unless alias e"pansion  will actuall be per#ormed.

e. '0(TCOT6O& is now a colon-separated list o# values, which permits  more e"tensibilit and bacwards compatibilit.

#. '0(TCOT6O& ma now include the 7erasedups$ option, which causes all lines  matching a line being added to be removed #rom the histor list.

g. 7con#igure$ has a new 7--enable-multibte$ argument that permits multibte  character support to be disabled even on sstems that support it.

h. ew variables to support the bash debuggerL B5('A56C, B5('A56],  B5('A(O=6CE, B5('A&0EO, B5('A(=B('E&&, B5('AEDEC=T0OA(T60,  B5('ACO5

i. %=C5E has been changed to support the debuggerL it$s now an arra

  variable.

:. #or, case, select, arithmetic commands now eep line number in#ormation  #or the debugger.

. There is a new 76ET=6$ trap e"ecuted when a #unction or sourced script  returns not inherited child processesX inherited b command substitution  i# #unction tracing is enabled and the debugger is active/.

l. ew invocation optionL --debugger. Enables debugging and turns on new  7e"tdebug$ shell option.

m. ew 7#unctrace$ and 7errtrace$ options to 7set -o$ cause EB= and E66

  traps, respectivel, to be inherited b shell #unctions. E+uivalent to  7set -T$ and 7set -E$ respectivel. The 7#unctrace$ option also controls  whether or not the EB= trap is inherited b sourced scripts.

n. The EB= trap is run be#ore binding the variable and running the action  list in a 7#or$ command, binding the selection variable and running the  +uer in a 7select$ command, and be#ore attempting a match in a 7case$  command.

o. ew 7--enable-debugger$ option to 7con#igure$ to compile in the debugger  support code.

p. 7declare -%$ now prints out e"tra line number and source #ile in#ormation

  i# the 7e"tdebug$ option is set.

+. 0# 7e"tdebug$ is enabled, a non-Jero return value #rom a EB= trap causes  the ne"t command to be sipped, and a return value o# 2 while in a  #unction or sourced script #orces a 7return$.

r. ew 7caller$ builtin to provide a call stac #or the bash debugger.

s. The EB= trap is run :ust be#ore the #irst command in a #unction bod is  e"ecuted, #or the debugger.

t. 7#or$, 7select$, and 7case$ command heads are printed when 7set -"$ is  enabled.

u. There is a new M"..N brace e"pansion, which is shorthand #or M"."Z1,  "Z2,...,N. " and can be integers or single charactersX the se+uence  ma ascend or descendX the increment is alwas 1.

Page 60: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 60/123

v. ew shH3-lie MYarra8I9N e"pansion, e"pands to all the es indices/  o# arra.

w. ew 7#orceA#ignore$ shopt optionX i# enabled, su##i"es speci#ied b  %0O6E cause words to be ignored when per#orming word completion even  i# the$re the onl possibilities.

". ew 7gnuAerr#mt$ shopt optionX i# enabled, error messages #ollow the 7gnu  stle$ #ilenameLlinenoLmessage/ #ormat.

. ew 7-o bashde#ault$ option to complete and compgenX i# set, causes the  whole set o# bash completions to be per#ormed i# the compspec doesn$t  result in a match.

J. ew 7-o plusdirs$ option to complete and compgenX i# set, causes director  name completion to be per#ormed and the results added to the rest o# the  possible completions.

aa. 7ill$ is available as a builtin even when the shell is built without  :ob control.

bb. ew '0(TT0E%O65T variableX value is a #ormat string to pass to  str#time3/. 0# set and not null, the 7histor$ builtin prints out  timestamp in#ormation according to the speci#ied #ormat when displaing  histor entries. 0# set, bash tells the histor librar to write out  timestamp in#ormation when the histor #ile is written.

cc. The 88 ... 99 command has a new binar 7?@$ operator that per#orms  e"tended regular e"pression egrep-lie/ matching.

dd. 7con#igure$ has a new 7--enable-cond-rege"p$ option enabled b de#ault/  to enable the ?@ operator and rege"p matching in 88 ... 99.

ee. (ube"pressions matched b the ?@ operator are placed in the new  B5('A6E5TC' arra variable.

##. ew 7#ailglob$ option that causes an e"pansion error when pathname  e"pansion #ails to produce a match.

gg. ew 7set -o pipe#ail$ option that causes a pipeline to return a #ailure  status i# an o# the processes in the pipeline #ail, not :ust the last  one.

4. ew %eatures in 6eadline

a. 'istor e"pansion has a new 7a$ modi#ier e+uivalent to the 7g$ modi#ier

  #or compatibilit with the B( csh.

b. 'istor e"pansion has a new 7$ modi#ier e+uivalent to the B( csh 7g$  modi#ier, which per#orms a substitution once per word.

c. 5ll non-incremental search operations ma now undo the operation o#  replacing the current line with the histor line.

d. The te"t inserted b an 7a$ command in vi mode can be reinserted with  7.$.

e. ew bindable variable, 7show-all-i#-unmodi#ied$. 0# set, the readline  completer will list possible completions immediatel i# there is more

  than one completion and partial completion cannot be per#ormed.

#. There is a new application-callable 7#reeAhistorAentr/$ #unction.

Page 61: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 61/123

g. 'istor list entries now contain timestamp in#ormationX the histor #ile  #unctions now how to read and write timestamp in#ormation associated  with each entr.

h. %our new e binding #unctions have been addedL

rlAbindAeAi#Aunbound/rlAbindAeAi#AunboundAinAmap/rlAbindAese+Ai#Aunbound/rlAbindAese+Ai#AunboundAinAmap/

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^b-release,and the previous version, bash-2.G^b-beta2.

1. Changes to Bash

a. %i"ed an o##-b-one error in the #unction that translates :ob  speci#ications.

b. ote that we$re running under Emacs and disable line editing i#

  E5C( ?? 7t$.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^b-beta2,and the previous version, bash-2.G^b-beta1.

1. Changes to Bash

a. %i"ed the >? and U? arithmetic operators to catch division b Jero.

b. 5dded putenv, setenv, unsetenv to getenv replacement #or completeness.

c. %i"ed a bug that could cause the -O e"pandAaliases invocation option

  to not tae e##ect.

d. %i"ed a problem with process substitution that resulted in incorrect  behavior when the number o# process substitutions in an individual  command approached \4.

2. Changes to 6eadline

a. %i"ed a problem with bacward-char-search when on a sstem with support  #or multibte characters when running in a locale without an multibte  characters.

------------------------------------------------------------------------------

This document details the changes between this version, bash-2.G^b-beta1,and the previous version, bash-2.G^b-alpha1.

1. Changes to Bash

a. %i"ed a problem when parsing a !O(0D.2 character class name while  evaluating a bracet e"pression containing multibte characters.

b. Changed the help te"t #or 7bind$ to mae it clear that an command  that ma be placed in @>.inputrc is a valid argument to 7bind$.

c. 5dded 7help$ builtin entries #or 7$, 788$, and arithmetic #or.

d. malloc updated againLo slightl better over#low and under#low detection b putting the  chun siJe at the beginning and end o# the chun and maing  sure the match in #ree>realloc

Page 62: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 62/123

o partial page allocated to mae things page-aligned no longer  completel wastedo bloc coalescing now enabled b de#aulto splitting and coalescing enabled #or 32-bte chuns, the most  common siJe re+uestedo #i"ed a problem that resulted in spurious under#low messages and  abortso bin siJes are precomputed and stored in an arra rather than  being computed at run timeo malloc will return memor blocs bac to the sstem i# the bloc  being #reed is at the top o# the heap and o# su##icient siJe to  mae it worthwhileo malloc>#ree>realloc now inline memset instead o# calling the  libc #unctionX uses u##$s device #or good per#ormance

e. Chec #or getservent/X mae the service name completion code dependent  on its presence.

#. Changed the readline callbac that e"ecutes a command bound to a e  se+uence to not save the e"ecuted command on the histor list and to  save and restore the parsing state.

g. Changes to lib>sh>snprint#.cL #i"ed some bugs in the 7g$ and 7$  #loating point #ormat displaX implemented the K$K #lag character  that turns on thousands$ groupingX #i"ed behavior on sstems where  BAC=6A5D does not evaluate to a constant.

h. The 7unset$ builtin no longer returns a #ailure status when ased to  unset a previousl-unset variable or #unction.

i. Changes to the build sstem to mae it easier to cross-compile bash  #or di##erent sstems.

:. 5dded 7,$ to the characters that are bacslash-escaped during #ilename

  completion, to avoid problems with complete-into-braces and 6C( #ilenames  containing commas.

. (ome changes to the multibte character support code to avoid man calls  to strlen/.

l. Bash now correctl honors setting &5 to some value when &CA5&& does not  alread have a value.

m. %i"ed a bug that could cause (0(E] when processing nested traps with  trap handlers.

n. The 7source>.$ builtin now restores the positional parameters when it

  returns unless the were changed using the 7set$ builtin during the #ile$s  e"ecution.

o. %i"ed a bug that caused a snta" error when a command was terminated b  EO%.

2. ew %eatures in Bash

a. There is now support #or placing the long help te"t into separate #iles  installed into MdatadirN>bash. ot enabled b de#aultX can be turned  on with 7--enable-separate-help#iles$ option to con#igure.

b. 5ll builtins that tae operands accept a 7--$ pseudo-option, e"cept

  7echo$.

c. The 7echo$ builtin now accepts VG""" Jero to three octal digits #ollowing  the 7G$/ in addition to V""" one to three octal digits/ #or (=(v3>D!\>

Page 63: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 63/123

  !O(0D.1-2GG1 compliance.

3. Changes to 6eadline

a. %i"ed a small problem in ArlAinsertAchar with multibte characters.

b. %i"es #rom 0B #or line wrapping problems when using multibte characters.

c. %i"ed a problem which caused the displa to be messed up when the last  line o# a multi-line prompt possibl containing invisible characters/  was longer than the screen width.

d. %i"ed a problem with the vi-mode 7r$ command that ocurred on sstems with  support #or multibte characters when running in a locale without an  multibte characters.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^b-alpha1,and the previous version, bash-2.G^a-release.

1. Changes to Bash

a. (ome changes to wor around inlining di##erences between compilers.

b. 5dded more prototpes #or internal shell tpede#s, to catch argument  passing errors when using pointers to #unctions.

c. The 7cd$ builtin now #ails in posi" mode when a valid director cannot be  constructed #rom a relative pathname argument and the ! using pathname  canonicaliJation, and the -! option has not been supplied. !reviousl,  the shell would attempt to use what the user tped, leading to weird  values #or ! and discrepancies between the value o# ! and the  actual woring director.

d. The 7cd$ builtin now resets ! when canonicaliJation #ails but a chdir  to the pathname passed as an argument succeeds when not in posi" mode/.

e. The 7#c$ builtin has been #i"ed, as !O(0D re+uires, to use the closest  histor position in range when given an out-o#-range argument.

#. The histor #ile loading code was changed to allow lines to be saved in  the histor list #rom the shell startup #iles.

g. 7histor -s args$ now wors better in compound commands.

h. The tilde e"pansion code was #i"ed to better recogniJe when it$s being  invoed in an assignment conte"t, which enables e"pansion a#ter 7?$

  and 7L$.

i. %i"ed the command name completion code so a slash is no longer appended  to a single match i# there happens to be a director with that name in  !.

:. %i"ed compound arra assignment to no longer per#orm alias e"pansion, to  allow reserved words as arra members, and to not produce e"tra output  when the 7-v$ option had been enabled.

. %i"ed the programmable completion code to better handle newlines in lists  o# possible completions e.g., 7complete -$/.

l. 6emoved the reserved words #rom the 7bash-builtins$ manual page.

m. !arser error reporting now attempts to do a better :ob o# identi#ing the  toen in error rather than doing straight te"tual analsis.

Page 64: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 64/123

n. %i"es #or 0n#>a, locales, wide>multibte characters and Jero-length  arguments in the librar snprint#3/ replacement.

o. 7read -e$ no longer does command name completion on the #irst word on  the line being read.

p. 7select$ now returns #ailure i# the read o# the user$s selection #ails.

+. %i"ed a bug that could cause a core dump when setting !0!E(T5T=(.

r. %i"es to not allocate so man :ob slots when the shell is running a loop  with :ob control enabled in a subshell o# an interactive shell.

s. %i"ed a bug in the trap code that caused traps to be inherited b  command substitutions in some cases.

t. %i"ed a bug that could cause alias e"pansion to inappropriatel e"pand  the word #ollowing the alias.

u. %i"ed a bug in the 7ill$ builtin that mishandled negative pid arguments.

v. The parser is less lenient when parsing assignment statements where the  characters be#ore the 7?$ don$t comprise a valid identi#ier.

w. The arithmetic e"pression evaluation code now honors the setting o# the  7-u$ option when e"panding variable names.

". %i"ed the arithmetic evaluation code to allow arra subscripts to be  assigned 7let b8W9?42$/ and auto-incremented and auto-decremented  e.g., b8W9ZZ/.

. 6eimplemented the e"isting prompt string date and time e"pansions using  str#time3/, which changed the output o# VI in some locales.

J. %i"ed a bug that could cause a core dump when a special shell variable  lie 65O/ was converted to an arra with a variable assignment.

aa. %i"ed a bug that would reset the handler #or a signal the user had  trapped to a #unction that would e"it the shell when setting the e"it  trap in a non-interactive shell.

bb. Changed the e"ecve2/ wrapper code to chec whether or not a #ailing  command is a director be#ore looing at whether a 7PY$ interpreter  #ailed #or some reason.

cc. %i"ed a bug in the command printing code so it no longer inserts a 7X$

  a#ter a newline, which produces a snta" error when reused as input.

dd. The code that e"pands !(4 no longer inherits the 7-"$ #lag.

ee. The bash-speci#ic completion #unctions ma now tae advantage o# the  double-T5B and -; #eatures o# the standard readline completion  #unctions.

##. The mail checing code no longer prints a message i# the checed #ile$s  siJe has not increased, even i# the access time is less than themodi#ication time.

gg. 6ewrote the variable smbol table codeL there is now a stac o#

  conte"ts, each possibl including a separate smbol tableX there can  be more than one temporar environment supplied to nested invocations  o# 7.>source$X the temporar environments no longer re+uire so much  special-case codeX shell #unctions now handle the temporar environment

Page 65: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 65/123

  and local variables more consistentlX #unction scope e"it is #aster now  that the entire smbol table does not have to be traversed to dispose o#  local variablesX it is now easier to push vars #rom the temporar  environment to the shell$s variable table in posi" modeX some duplicated  code has been removed.

hh. 6egulariJed the error message printing codeX builtinAerror is now called  more consistentl, and common error message strings are handled b small  #unctions. This should mae eventual message translation easier.

ii. Error messages now include the line number in a script when the shell  is not interactive.

::. 5rra subscript e"pansion now taes place even when the arra variable is  unset, so side e##ects will tae place.

. %i"ed a bug in the (0C'& child-reaping code so that it won$t #ind  :obs alread mared as terminated i# the O( reuses pids +uicl enough.

ll. %i"ed a bug that could cause a signal to not interrupt the 7wait$  builtin while it was waiting #or a bacground process to terminate.

mm. 5 couple o# changes to mae it easier #or multiple shells to share histor  #iles using 7histor -n$, 7histor -r$, and 7histor -w$.

nn. The 7getopts$ builtin alwas increments O!T0 to point to the ne"t  option to be handled when an option is returned, whether it$s valid  or not, as !O(0D 1GG3."-2GG1 re+uires.

oo. Changed some parts o# the e"pansion code to avoid allocating and  immediatel #reeing memor without using the results #or anthing.

pp. The shell now eeps trac o# 0%( internall, updating its internal map  each time the variable is assigned a new value or at local scope e"it/.

  This saves thousands o# hash looups #or 0%(, which, while individuall  cheap, add up.

++. 6ewrote the hash table codeL searching and insertion are much #aster now,  and it uses a better string hashing #unctionX augmented the #unction  inter#ace to simpli# other parts o# the code and remove duplicated code

rr. The shell now uses a simple, generic 7ob:ect cache$ #or allocating and  caching words and word lists, which were the ma:or users o#  malloc>#ree.

ss. %i"ed the assignment statement parsing code to allow whitespace and  newlines in subscripts when per#orming arra element assignment.

tt. The shell now issues man #ewer calls to sigprocmas and other signal  masing sstem calls.

uu. %i"ed the 7test$ and conditional command #ile comparison operators to  wor right when one #ile has a non-positive timestamp and the other  does not e"ist.

vv. %i"ed some cases where the special characters $VGG1$ and $V1WW$ in the  values o# variables or positional parameters caused incorrect e"pansion  results.

2. Changes to 6eadline

a. %i"ed output o# comment-begin character when listing variable values.

b. 5dded some de#ault e bindings #or common escape se+uences produced b

Page 66: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 66/123

  'OE and E es.

c. %i"ed the mar handling code to be more emacs-compatible.

d. 5 bug was #i"ed in the code that prints possible completions to eep it  #rom printing empt strings in certain circumstances.

e. Change the e se+uence printing code to print E(C as V- i# E(C is a  meta-pre#i" character -- it$s easier #or users to understand than Ve.

#. %i"ed unsti#leAhistor/ to return values that match the documentation.

g. %i"ed the event loop rlAeventAhoo/ to handle the case where the input  #ile descriptor is invalidated.

h. %i"ed the prompt displa code to wor better when the application has a  custom redispla #unction.

i. Changes to mae reading and writing the histor #ile a little #aster, and  to cope with huge histor #iles without calling abort3/ #rom "malloc.

:. The vi-mode 7($ and 7s$ commands are now undone correctl.

3. ew %eatures in Bash

a. 0# set, TO=T is the de#ault timeout #or the 7read$ builtin.

b. 7tpe$ has two new optionsL 7-#$ suppresses shell #unction looup, and  7-!$ #orces a !5T' search.

c. ew code to handle multibte characters.

d. 7select$ was changed to be more sh-compatible, in that the menu is  reprinted each time through the loop onl i# 6E!&[ is set to =&&.

  The previous behavior is available as a compile-time option.

e. 7complete -d$ and 7complete -o dirnames$ now #orce a slash to be  appended to names which are smlins to directories.

#. There is now a bindable edit-and-e"ecute-command readline command,  lie the vi-mode 7v$ command, bound to C-"C-e in emacs mode.

g. 5dded support #or shH3-lie 8LwordL9 character class in pattern matching.

h. The $...$ +uoting construct now e"pands VcD to Control-D.

i. 5 new VM...N prompt e"pansionX passes the 7...$ to str#time and inserts

  the result into the e"panded prompt.

:. The shell now per#orms arithmetic in the largest integer siJe the  machine supports intma"At/, instead o# long.

. 0# a numeric argument is supplied to one o# the bash globbing completion  #unctions, a 7$ is appended to the word be#ore e"pansion is attempted.

l. The bash globbing completion #unctions now allow completions to be listed  with double tabs or i# 7show-all-i#-ambiguous$ is set.

m. ew 7-o nospace$ option #or 7complete$ and 7compgen$ builtinsX suppresses  readline$s appending a space to the completed word.

n. ew 7here-string$ redirection operatorL word.

o. hen displaing variables, #unction attributes and de#initions are shown

Page 67: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 67/123

  separatel, allowing them to be re-used as input attempting to re-use  the old output would result in snta" errors/.

p. There is a new con#iguration option 7--enable-mem-scramble$, controls  bash malloc behavior o# writing garbage characters into memor at  allocation and #ree time.

+. The 7complete$ and 7compgen$ builtins now have a new 7-s>-5 service$  option to complete on names #rom >etc>services.

r. 7read$ has a new 7-u #d$ option to read #rom a speci#ied #ile descriptor.

s. %i" the completion code so that e"pansion errors in a director name  don$t cause a long:mp bac to the command loop.

t. %i"ed word completion inside command substitution to wor a little more  intuitivel.

u. The 7print#$ U+ #ormat speci#ier now uses $...$ +uoting to print the  argument i# it contains non-printing characters.

v. The 7declare$ and 7tpeset$ builtins have a new 7-t$ option. hen applied  to #unctions, it causes the EB= trap to be inherited b the named  #unction. Currentl has no e##ect on variables.

w. The EB= trap is now run be#ore simple commands, ...// commands,  88...99 conditional commands, and #or ...// loops.

". The e"pansion o# &0EO inside a shell #unction is onl relative to the  #unction start i# the shell is interactive -- i# the shell is running a  script, &0EO e"pands to the line number in the script. This is as  !O(0D-2GG1 re+uires.

. The bash debugger in e"amples>bashdb has been modi#ied to wor with the

  new EB= trap semantics, the command set has been made more gdb-lie,  and the changes to &0EO mae debugging #unctions wor better. Code  #rom ar ]aughan.

J. ew 8n9)word- and 8n9F)word- redirections #rom shH3 -- move #ds dup  and close/.

aa. There is a new 7-l$ invocation option, e+uivalent to 7--login$.

bb. The 7hash$ builtin has a new 7-l$ option to list contents in a reusable  #ormat, and a 7-d$ option to remove a name #rom the hash table.

4. ew %eatures in 6eadline

a. (upport #or e 7subse+uences$L allows, e.g., E(C and E(C-a to both  be bound to readline #unctions. ow the arrow es ma be used in vi  insert mode.

b. hen listing completions, and the number o# lines displaed is more than  the screen length, readline uses an internal pager to displa the results.  This is controlled b the 7page-completions$ variable de#ault on/.

c. ew code to handle editing and displaing multibte characters.

d. The behavior introduced in bash-2.G^a o# deciding whether or not to  append a slash to a completed name that is a smlin to a director has

  been made optional, controlled b the 7mar-smlined-directories$  variable de#ault is the 2.G^a behavior/.

e. The 7insert-comment$ command now acts as a toggle i# given a numeric

Page 68: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 68/123

  argumentL i# the #irst characters on the line don$t speci# a  comment, insert oneX i# the do, delete the comment te"t

#. ew application-settable completion variableL  rlAcompletionAmarAsmlinAdirs, allows an application$s completion  #unction to temporaril override the user$s pre#erence #or appending  slashes to names which are smlins to directories.

g. ew #unction available to application completion #unctionsL  rlAcompletionAmode, to tell how the completion #unction was invoed  and decide which argument to suppl to rlAcompleteAinternal to list  completions, etc./.

h. 6eadline now has an overwrite mode, toggled b the 7overwrite-mode$  bindable command, which could be bound to 70nsert$.

i. ew application-settable completion variableL  rlAcompletionAsuppressAappend, inhibits appending o#  rlAcompletionAappendAcharacter to completed words.

:. ew e bindings when reading an incremental search stringL ans

  the currentl-matched word out o# the current line into the search  stringX [ ans the rest o# the current line into the search string,  E& or ' deletes characters #rom the search string.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^a-release,and the previous version, bash-2.G^a-rc1.

1. Changes to Bash

a. %i"ed the 7print#$ builtin so that the variable name supplied as an  argument to a Un conversion must be a valid shell identi#ier.

b. 0mproved the random number generator slightl.

c. Changes to con#iguration to not put -0>usr>include into C%&5(, since  it messes up some includes.

d. Corrected description o# !O(0D&[ACO66ECT in man page and in#o manual.

e. %i"ed a couple o# cases o# incorrect #unction prototpes that sneaed  through and caused compilation problems.

#. 5 #ew changes to avoid potential core dumps in the programmable completion  code.

g. %i"ed a con#igure problem that could cause a non-e"istent #ile to show  up in &0BOBS(.

h. %i"ed a con#igure problem that could cause siglist.o to not be built when  re+uired.

i. Changes to the strtoima" and strtouma" replacement #unctions to wor  around bugg compilers.

:. %i"ed a problem with the snprint# replacement #unction that could  potentiall cause a core dump.

2. Changes to 6eadline

a. %i"ed a locale-speci#ic problem in the vi-mode 7goto mar$ command.

b. %i"ed ae#ile to not put -0>usr>include into C%&5(, since it can cause

Page 69: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 69/123

  include #ile problems.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^a-rc1,and the previous version, bash-2.G^a-beta1.

1. Changes to Bash

a. %i"ed the snprint# replacement to correctl implement the 7alternate #orm$  o# the Ug and U conversions.

b. %i"ed snprint# to correctl handle the optional precision with the Ug and  U conversions.

c. %i"ed the arithmetic evaluation code to correct the values o# 7I$ and 7A$  when translating base-\4 constants the were bacwards/.

d. ew librar #unctions #or #ormatting long and long long ints.

e. %i"ed a #ew places where negative arra subscripts could have occurred,  mostl as the result o# sstems using signed characters.

#. %i"ed a #ew places that assumed a pidAt was no wider than an int.

g. %i"ed the 7maildir$ mail checing code to wor on sstems where a  7struct stat$ doesn$t include an 7stAblocs$ member.

h. %i"ed snprint# to mae 7unsigned long long$ conversion #ormats Ullu/  wor better.

i. %i"ed snprint# to not print a sign when ased to do an unsigned conversion.

:. ade con#igure changes to avoid compiling empt source #iles in lib>sh.

. ew replacement #unctions i# necessar/ #or strtoull, strtoll, strtoima",  strtouma".

l. The 7print#$ builtin now handles the 7ll$ and 7:$ length modi#iers  directl, since the can a##ect the tpe and width o# the argument  passed to print#3/.

m. 6enamed a number o# the bash-speci#ic autocon# macros in aclocal.m4 to  have more stematic naming, with accompaning changes to con#igure.in.

n. %i"ed snprint# to handle long doubles and the Ua>U5 conversions b  #alling bac to sprint#, as long as sprint# supports them.

o. %i"ed return value #rom vsnprint#>snprint# to be the number o# characters  that would have been printed, even i# that number e"ceeds the bu##er  siJe passed as an argument.

p. Bash no longer attempts to de#ine its own versions o# some ctpe macros  i# the are implemented as #unctions in libc but not as macros in  ctpe.hF.

+. Changed the variable printing code used b 7set$, 7e"port$, etc./ to  not use the $...$ snta" when in posi" mode, since that caused  interoperabilit problems with other shells most notabl with autocon#/.  hen not in posi" mode, it uses $...$ i# the string to be printed  contains non-printing characters and regular single +uotes otherwise.

r. snprint# now recogniJes the U% conversion.

s. %i"ed a bug that could cause the wrong status to be returned b a shell

Page 70: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 70/123

  #unction when the shell is compiled without :ob control and a null  command containing a command substutition was e"ecuted in the #unction.

t. hen in posi" mode, the de#ault value #or 50&C'EC_ is \GG.

u. Bash onl initialiJes %=C5E, 6O=!(, and 06(T5C_ as special variables  i# the$re not in the initial environment.

v. 0# (ECO( appears in the initial environment with a valid integer value,  bash uses that as the starting value, as i# an assignment had been  per#ormed.

w. Bash no longer auto-e"ports 'OE, !5T', ('E&&, or TE6, even though it  gives them de#ault values i# the don$t appear in the initial environment.

". Bash no longer auto-e"ports 'O(T5E, 'O(TT[!E, 5C'T[!E, or O(T[!E,  even i# it assigns them de#ault values.

. Bash no longer removes the e"port attribute #rom (('AC&0ET or (('2AC&0ET  i# the appear in the initial environment.

J. Bash no longer attempts to discover i# it$s being run b sshd in order to  run the startup #iles. 0# the (('A(O=6CEAB5('6C is uncommented in  con#ig-top.h it will attempt to do so as previousl, but that$s commented  out in the distributed version.

aa. %i"ed a tpo in the code that tests #or &CA=E60C.

bb. The !O(0D&[ACO66ECT shell variable and its e##ects are now documented.

cc. (ome changes to several o# the support shell scripts included in the  de#initions to tr to avoid race conditions and attacs.

dd. (everal changes to avoid warnings #rom 7gcc -all$.

ee. %i"ed a problem with the 7unset$ builtin that could cause incorrect  results i# ased to unset a variable and an arra subscript in the  same command.

##. 5 #ew changes to the shell$s temporar #ile creation code to avoid  potential #ile descriptor leas and to pre#er the sstem$s idea o#  the temporar director to use.

gg. %i"es to build with the C alloca in lib>malloc>alloca.c i# the sstem  re+uires it but the shell has been con#igured --without-bash-malloc.

hh. =pdated the documentation to note that onl interactive shells resend

  (0'=! to all :obs be#ore e"iting.

ii. %i"es to onl pass un+uoted tilde words to tildeAe"pand, rather than  rel on tildeAe"pand or getpwnam3/ to handle the +uotes acO( 1G."  will remove bacslashes in an login name passed to getpwnam3//.

::. (mall change #rom !aul Eggert to mae &0EO right in commands run with  7bash -c$.

2. ew %eatures in Bash

a. The 7print#$ builtin now handles the Ua and U5 conversions i# the$re  implemented b print#3/.

b. The 7print#$ builtin now handles the U% conversion :ust about lie U#/.

c. The 7print#$ builtin now handles the Un conversion lie print#3/. The

Page 71: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 71/123

  corresponding argument is the name o# a shell variable to which the  value is assigned.

3. Changes to 6eadline

a. %i"ed a #ew places where negative arra subscripts could have occurred.

b. %i"ed the vi-mode code to use a better method to determine the bounds o#  the arra used to hold the mars.

c. %i"ed the de#ines in charde#s.h to wor better when chars are signed.

d. %i"ed con#igure.in to use the new names #or bash autocon# macros.

e. 6eadline no longer attempts to de#ine its own versions o# some ctpe  macros i# the are implemented as #unctions in libc but not as macros in  ctpe.hF.

#. %i"ed a problem where rlAbacward could possibl set point to be#ore  the beginning o# the line.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^a-beta1,and the previous version, bash-2.G^a-alpha1.

1. Changes to Bash

a. %i"ed a bug in the evalution o# arithmetic 7#or$ statements when the  e"panded e"pression is =&&.

b. %i"ed an unassigned variable problem in the redirection printing code.

c. 5dded more prototpes to e"tern #unction declarations in the header  #iles and to static #unction declarations in C source #iles.

d. ae sure called #unctions have a prototpe in scope, to get the arguments  and return values right instead o# casting. 6emoved e"tern #unction  declarations #rom C source #iles that were alread included in header  #iles.

e. Changed some #unction arguments to use #unction tpede#s in general.h so  the prototpes can be checed. The onl use o# %unction and ]%unction  now is #or unwind-protects.

#. ore const changes to #unction arguments and appropriate variables.

g. Changed the mail checing support to handle 7maildir$-stle mail

  directories.

h. 5ugmented the bash malloc to pass in the #ile and line number in#ormation  #or each malloc, realloc, and #ree. This should result in better error  messages.

i. The 7old$ gnu malloc is no longer a con#iguration option.

:. 5ugmented the bash malloc with optional tracing and registering allocated  and #reed memor.

. !rompt string decoding now saves and restores the value o# ; when it  e"pands the prompt string, so command substitutions don$t change ;.

i. 5rra indices are now 7long$, since shell arithmetic is per#ormed as long,  and the internal arraindAt tpe is used consistentl.

Page 72: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 72/123

:. (ome more 7unsigned char $ #i"es #rom !aul Eggert.

. %i"ed a bad call to builtinAerror that could cause core dumps when maing  local variables.

l. 7return$ ma no longer be used to terminate a 7select$ command, #or  compatibilit with sh.

m. Changed code that reads octal numbers to do a better :ob o# detecting  over#lows.

n. The time #ormatting code no longer uses absolute indices into a bu##er,  because the bu##er siJe changes depending on the siJe o# a 7timeAt$.

o. 7umas$ now prints #our digits when printing in octal mode, #or  compatibilit with other shells.

p. &ots o# changes to the 7print#$ builtin #rom !aul EggertL it handles 7&$  #ormats and long doubles better, and internal #unctions have been  simpi#ied where appropriate.

+. (ome 7timeAt$ #i"es #or machines were a timeAt is bigger than a long.

r. 6eplaced some bash-speci#ic autocon# macros with standard e+uivalents.

s. 0mprovmed the code that constructs temporar #ilenames to mae the  generated names a bit more random.

t. 5dded code that checs #or ascii be#ore calling an o# the is ctpe  #unctions.

u. Changed some places where a 7char$ was used as an arra subscript to use  7unsigned char$, since a 7char$ can be negative i# it$s signed b de#ault.

v. &ots o# changes to the 7ulimit$ builtin #rom !aul Eggert to add support  #or the new !O(0D-2GG" 6&0A(5]EAC=6 and 6&0A(5]EA5D values and  simpli# the code.

w. 7ulimit$ now prints the description o# a resource in an error message  relating to #etching or setting that resource$s limits.

". The 7snprint#$ replacement now computes ma"imum values at compile  time rather than using huge constants #or things lie long long.

. 0nteractive shells now ignore 7set -n$.

J. Changed the malloc booeeping in#ormation so that it$s now R btes

  instead o# 12 on most 32-bit machines saving 4 btes per allocation/,  restoring R-bte alignment.

aa. The malloc error reporting code now attempts to print the #ile and line  number o# the call that caused the error.

bb. Changed the redirection error reporting code to catch EB5% errors and  report the #ile descriptor number rather than the #ile being redirected  to or #rom e.g., things lie 7e"ec 4242"$ where 4242 is an out-o#-range  #ile descriptor/.

cc. 7print#$, 7echo -e$, and the $...$ code now process onl two he" digits  a#ter a 7V"$ escape se+uence #or compatibilit with other shells, and

  the documentation was changed to note that the octal and he" escape  se+uences result in an eight-bit value rather than strict 5(C00.

2. Changes to 6eadline

Page 73: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 73/123

a. The completion code now attempts to do a better :ob o# preserving the  case o# the word the user tped i# ignoring case in completions.

b. 6eadline de#aults to not echoing the input and lets the terminal  initialiJation code enable echoing i# there is a controlling terminal.

c. The e binding code now processes onl two he" digits a#ter a 7V"$  escape se+uence, and the documentation was changed to note that the  octal and he" escape se+uences result in an eight-bit value rather  than strict 5(C00.

3. ew %eatures in Bash

a. The builtin 7ulimit$ now taes two new non-numeric argumentsL 7hard$,  meaning the current hard limit, and 7so#t$, meaning the current so#t  limit, in addition to 7unlimited$

b. 7ulimit$ now prints the option letter associated with a particular  resource when printing more than one limit.

c. 7ulimit$ prints 7hard$ or 7so#t$ when a value is not 7unlimited$ but is  one o# 6&0A(5]EA5D or 6&0A(5]EAC=6, respectivel.

4. ew %eatures in 6eadline

a. ew bindable variable 7histor-preserve-point$. 0# set, the histor  code attempts to place the user at the same location on each histor  line retrived with previous-histor or ne"t-histor.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^a-alpha1,and the previous version, bash-2.G^-release.

1. Changes to Bash

a. Better checs in the redirection code #or write errors.

b. bashbug now uses T!06, de#aulting to >tmp, and uses mtemp1/ more  portabl.

c. (stem-speci#ic con#iguration changes #orL 0nteri", OpenB(, %reeB(,  acO( D.

d. (ome more 7const$ cleanups through the code.

e. %i"ed a tpo in the >dev>#d redirection code, better checs #or valid

  numeric #ds in >dev>#d.

#. %i"ed man parts o# the shell to handle integer over#low more grace#ull  and to do more stringent checs #or valid numbers.

g. %i"ed msignames to include con#ig.h.

h. %i"ed an uninitialiJed variable problem that could cause the shell to core  dump when replacing characters in a string.

i. ew mechanism #or updating the patch level when o##icial patches are  released patchlevel.h/.

:. con#igure.in changed to no longer re+uire e"ternal #iles Adistribution and  Apatchlevel.

. %i"ed non-interactive shell initialiJation problem when bash started as

Page 74: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 74/123

  7bash -i #ilename$.

l. %i"ed print# builtin conversion error handling to be !O(0D.2-con#ormant.

m. autocon#-2.^2 is now used to build con#igureX autocon#-2.^G or newer is  re+uired. (ome o# the bash-speci#ic macros were removed, since the are  now standard.

n. (tartup #iles and #iles read with source or 7.$ are no longer re+uired to  be regular #iles.

o. %i"ed core dump in builtin print# when user-supplied precision or #ield  width is G.

p. %i"ed builtin print# to treat a negative #ield width as a positive #ield  width with le#t-:usti#ication.

r. ew unwind-protect implementation #rom !aul Eggert.

s. %i"ed an inadvertentl-unclosed comment in the bash completion code that  caused programmable completions to not add trailing slashes or spaces to

  completions.

t. %i"ed the process substitution code to cope better when stdin is closed.

v. %i"es, mostl #rom !aul Eggert, #or a #ew possible bu##er over#lows in  the shell.

w. %i"es #rom !aul Eggert to avoid most o# the tpe casts in the shell code,  and use more appropriate tpes #or a number o# variables.

". Command substition no longer inherits the EB= trap.

. (ome #i"es to the process substition code on machines without >dev>#d so

  that named pipes are not removed inappropriatel.

J. The loadable 7getcon#$ builtin is now much more complete, and will become  part o# the shell in the #uture.

aa. The select command no longer terminates on a 7return$, so it can be used  to return #rom an enclosing #unction as sh does it/.

bb. %i"ed the e"tended pattern matching code to behave better when presented  with incorrectl-#ormed patterns.

cc. (ome changes were made with the intent o# maing cross-compilation easier.

dd. The networ code >dev>tcp and >dev>udp redirections/ uses getaddrin#o3/  i# it$s available, which adds support #or 0!v\.

ee. (ubshells o# login shells no longer source @>.bashAlogout when the e"it.

##. %i"es so that subshells don$t e"it inappropriatel i# the -e option has  been set.

gg. 6estricted shells no longer allow #unctions to be e"ported.

hh. Changes to the pattern matching code so e"tended pattern matching wors  on sstems with de#icient shared librar implementations, lie acO( D.

ii. Better error messages when a script with a leading 7PYinterp$ #ails  to e"ecute because o# problems with 7interp$.

::. %i"ed 7compgen$ to handle the 7-o de#ault$ option better.

Page 75: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 75/123

. %i"ed the :ob control code to #orce an asnchronous process$s standard  input to >dev>null onl i# :ob control is not active.

ll. %i"ed a possible in#inite recursion problem when 7#c KK?abc$ a null  pattern/ is used to re-e"ecute a previous command.

mm. %i"ed 7declare 8-a9 var?value$ to assign ]5&=E to element G i# ]56 is an  arra variable. (imilarl #or 7declare 8-a9 var89?value$. This is lie  shH3.

nn. %i"ed a bug that caused 7read -a aname$ to wor even i# 55E had been  declared readonl.

oo. %i"ed a possible integer over#low problem when constructing names #or  temporar #iles.

2. ew %eatures in Bash

a. 5dded support #or E(T06 installation root pre#i", so ou can do a  7mae install E(T06?bash-root$ and do easier binar pacaging.

b. 5dded support #or builtin print# K$K #lag character as per latest !O(0D  dra#ts.

c. (upport #or !O(0D.2 print#1/ length speci#iers 7:$, 7t$, and 7J$ #rom  0(O CHH/.

d. ew autocon# macro, 6&A&0BA6E5&0EA]E6(0O, #or use b other applications  bash doesn$t use ver much o# what it returns/.

e. 7set 8-Z9o nolog$ is recogniJed as re+uired b the latest !O(0D dra#ts,  but ignored.

#. ew read-onl 7shopt$ optionL loginAshell. (et to non-Jero value i# the  shell is a login shell.

g. ew 7V5$ prompt string escape se+uenceX e"pands to time in 24 ''L #ormat.

h. ew 7-5 group>-g$ option to complete and compgenX does group name  completion.

i. ew 7-t$ option to 7hash$ to list hash values #or each #ilename argument.

:. ew 8-Z9O invocation option to set and unset 7shopt$ options at startup.

. con#igure$s 7--with-installed-readline$ option now taes an optional

  7?!5T'$ su##i" to set the root o# the tree where readline is installed  to !5T'.

l. The sh-lie 7E66$ trap has been added. The 7E66$ trap will be run  whenever the shell would have e"ited i# the -e option were enabled.  0t is not inherited b shell #unctions.

m. 7readonl$, 7e"port$, and 7declare$ now print variables which have been  given attributes but not set b assigning a value as :ust a command and  a variable name lie 7e"port #oo$/ when listing, as the latest !O(0D  dra#ts re+uire.

n. 7bashbug$ now re+uires that the sub:ect be changed #rom the de#ault.

o. con#igure has a new 7--enable-large#ile$ option, lie other = utilities.

p. 7#or$ loops now allow empt word lists a#ter 7in$, lie the latest !O(0D

Page 76: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 76/123

  dra#ts re+uire.

3. Changes to 6eadline

a. ore 7const$ and tpe casting #i"es.

b. Changed rlAmessage/ to use vsnprint#3/ i# available/ to #i" bu##er  over#low problems.

c. The completion code no longer appends a 7>$ or 7 $ to a match when  completing a smbolic lin that resolves to a director name, unless  the match does not add anthing to the word being completed. This  means that a tab will complete the word up to the #ull name, but not  add anthing, and a subse+uent tab will add a slash.

d. %i"ed a trivial tpo that made the vi-mode 7dT$ command not wor.

e. %i"ed the tt code so that ( and < can be inserted with rlA+uotedAinsert.

#. %i"ed the tt code so that ] wors more than once.

g. Changed the use o# AA!...// #or #unction prototpes to !565(...//  because the use o# AA! in tpede#s con#licted gZZ and glibc.

4. ew %eatures in 6eadline

a. 5dded e"tern declaration #or rlAgetAtermcap to readline.h, maing it a  public #unction it was alwas there, :ust not in readline.h/.

b. ew Pde#ines in readline.hL 6&A6E5&0EA]E6(0O, currentl G"G4G2,  6&A]E6(0OA5SO6, currentl 4, and 6&A]E6(0OA0O6, currentl 2.

c. ew readline variableL rlAreadlineAversion, mirrors 6&A6E5&0EA]E6(0O.

d. ew bindable boolean readline variableL match-hidden-#iles. Controls  completion o# #iles beginning with a 7.$ on =ni"/. Enabled b de#ault.

e. The histor e"pansion code now allows an character to terminate a  7L#irst-$ modi#ier, lie csh.

#. The incremental search code remembers the last search string and uses  it i# 66 is tped without a search string.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^-release,and the previous version, bash-2.G^-beta2.

1. Changes to Bash

a. ae sure we note that the #irst line o# a multi-line command was not  saved in the histor i# the tests #or '0(TCOT6O& succeed, but the  '0(T0O6E chec #ails.

b. %i"ed a bug in the pattern matching code that caused 78$ to be treated  as a special character inside a 78...9$ bracet e"pression.

c. %i"ed a bug in the pattern matching code that caused 79$ to terminate  a bracet e"pression even i# it was the #irst character a#ter the 78$  or a leading 7Y$ or 7$/.

d. ade a small change to report a more user-#riendl error message i#  e"ecve2/ #ails because o# an error with the interpreter in a script  with a leading 7PY interpreter$.

Page 77: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 77/123

e. 0# the O( does not support an e"ec2/ magic number o# 7PY$, mae sure we  have a non-null interpreter name be#ore attempting to e"ecute it.

#. %i"ed a bug that caused the shell process to end up in a di##erent  process group than the controlling terminal i# a :ob-control shell was  run with 7e"ec$ in the startup #iles.

g. hen started in !O(0D mode, either b 7bash --posi"$, 7bash -o posi"$, or  7sh$, ('E&&O!T( includes 7posi"$ and !O(0D&[ACO66ECT is set.

h. %i"ed a problem that caused the 7V$ prompt string escape se+uence to  e"pand to nothing when ! was 7>>$.

i. The 7bashbug$ shell script no longer uses .../ command substitution.

:. hen 7set$ is invoed without options in !O(0D mode, it no longer prints  the names and de#initions o# shell #unctions.

2. Changes to 6eadline

a. rlAsetAparenAblinAtimeout/ is now documented.

b. Corrected histor.3 man pageL 7$ is not in the de#ault value o#  historAwordAdelimiters.

c. 0# a hoo #unction assigned to rlAeventAhoo sets rlAdone to a non-Jero  value, rlAreadAe/ now immediatel returns $Vn$ which is assumed to  be bound to accept-line/.

3. ew %eatures in Bash

a. The 7F)word$ redirection now wors in !O(0D mode as it does b de#ault,  since !O(0D.2 leaves it unspeci#ied.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^-beta2,and the previous version, bash-2.G^-beta1.

1. Changes to Bash

a. %i"ed a bug in the arithmetic evaluation code so that a?b is supported.

b. %i"ed startup so posi"lAcorrect is retained across subshells begun to  e"ecute scripts without a leading 7PY$.

c. %i"ed a bug that caused #ile/ to not wor in a .../ subshell.

d. 5dded con#ig support #or &inu" running on the 0B (3HG.

e. %i"ed a bug that caused bash to get its input pointer out o# snc when  reading commands through a pipe and running a command with standard  input redirected #rom a #ile.

#. ade a change so that command completion now maes about hal# as man  stat2/ calls when searching the !5T'.

g. %i"ed a bug that caused variable assignments preceding 7return$ to not  be propagated to the shell environment in !O(0D mode.

h. %i"ed a bug with Mparameter8L9;wordN -- tilde e"pansion was not per#ormed

  on 7word$.

i. 0n !O(0D mode, 7brea$ and 7continue$ do not complain and return success  i# called when the shell is not e"ecuting a loop.

Page 78: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 78/123

:. %i"ed 7bash -o posi"$ to wor the same as 7bash --posi"$.

. %i"ed a bug where variable assignments preceding 7eval$ or 7source>.$  would not show up in the environment e"ported to subshells run b the  commands.

l. 0n !O(0D mode, shells started to e"ecute command substitutions inherit  the value o# the 7-e$ option #rom their parent shell.

m. 0n !O(0D mode, aliases are e"panded even in non-interactive shells.

n. Changed some o# the :ob control messages to displa the te"t re+uired b  !O(0D.2 when the shell is in !O(0D mode.

o. %i"ed a bug in 7test$ that caused it to occasionall return incorrect  results when non-numeric arguments were supplied to 7-t$.

2. Changes to 6eadline

a. (ome changes were made to avoid gcc warnings with -all.

b. rlAgetAemapAbAname now #inds emaps case-insensitivel, so  7set emap E5C($ wors.

c. The histor #ile writing and truncation #unctions now return a use#ul  status on error.

d. %i"ed a bug that could cause applications to dere#erence a =&& pointer  i# a =&& second argument was passed to historAe"pand/.

3. ew %eatures in Bash

a. doc>readline.3 has been moved to the readline distribution.

4. ew %eatures in 6eadline

a. ew #unction, rlAgetAscreenAsiJe int rows, int columns/, returns  readline$s idea o# the screen dimensions.

b. The timeout in rlAgatherAti readline eboard input polling #unction/  is now settable via a #unction rlAsetAeboardAinputAtimeout//.

c. 6enamed the ma"AinputAhistor variable to historAma"AentriesX the old  variable is maintained #or bacwards compatibilit.

d. The list o# characters that separate words #or the histor toeniJer is

  now settable with a variableL historAwordAdelimiters. The de#ault  value is as be#ore.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^-beta1,and the previous version, bash-2.G^-alpha1.

1. Changes to Bash

a. Changes to allow shared librar and ob:ect building on the = 'urd.

b. %i"es to the wa e"ported #unctions are placed into the environment and  cached.

c. The globbing librar once again respects locales when processing ranges  in bracet e"pressions while doing pattern matching.

Page 79: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 79/123

d. (stem-speci#ic con#iguration changes #orL Tru \4, 0nteri"

e. Bashbug now uses >usr>bin>editor as one o# the editing alternatives, and  will use mtemp1/ or temp#ile1/, i# present, #or temporar #ile creation.

#. Bash no longer per#orms a binar #ile chec on a script argument that$s  reall a tt lie >dev>#d>G or >dev>stdin/.

g. %i"ed a bug in the e"ecution o# shell scripts that caused the e##ects o#  B5('AE] to be undone in some cases.

h. %i"ed several bugs that made 7bash 8-i9 >dev>stdin$ not wor correctl.

i. (everal changes to the :ob control code to avoid some signal state  manipulation.

:. The Bash malloc no longer blocs signals as o#ten, which should mae it  #aster.

. %i"ed a parsing bug that did not allow bacslash to escape a single +uote  inside a $...$ construct.

l. %i"ed a bug that caused things lie MvarL?$value$N to be parsed  incorrectl. This showed up in newer versions o# autocon#.

m. %i"ed a bug in the bash-speci#ic readline initialiJation that caused  e bindings to bash-speci#ic #unction names appearing in .inputrc to  not be honored.

n. Bash now sets the #ile descriptor it uses to save the #ile descriptor  opened on a shell script to close on e"ec.

o. %i"ed a bug in the prompt string decoding that caused it to misbehave  when presented an octal se+uence o# #ewer than three characters.

p. %i"ed the 7test$ builtin to return an error i# 78$ is supplied a single  argument that is not 79$.

+. %i"ed a bug that caused subshells started to run e"ecutable shell scripts  without a leading 7PY$ to incorrectl inherit an argument list preceding  a shell builtin lie such a script called #rom a script sourced with 7.$,  where there were variable assignments preceding the 7.$ command/

r. %i"ed a bug that caused changes to variables supplied in an assignment  statement preceding a shell builtin to not be honored lie a script  run with 7.$/.

s. 'O(TT[!E, O(T[!E, and 5C'T[!E are set onl i# the do not have values  when the shell is started.

t. %i"ed a bug that caused (00T to ill shell scripts a#ter the script  called 7wait$.

u. The 7#c$ builtin now tries to create its temporar #iles in the director  named b T!06.

v. Bash no longer calls an 6eadline #unctions or uses an 6eadline variables  not declared in readline.h.

w. %i"ed a bug that caused some substitutions involving I to not be split

  correctl, especiall e"pansions o# the #orm MparamterO!wordN.

". (('2AC&0ET is now treated lie (('AC&0ET and not auto-e"ported i# it  appears in the initial environment.

Page 80: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 80/123

. %i"ed a couple o# problems with shell scripts without a leading 7PY$  being e"ecuted out o# shell #unctions that could cause core dumps i#  such a script attempted to e"ecute 7return$.

J. %i"ed a problem with the 7-nt$ and 7-ot$ binar operators #or the  7test>8$ builtin and the 788$ conditional command that caused wrong  return values i# one o# the #ile arguments did not e"ist.

aa. %i"ed a bug that caused non-interactive shells which had previousl  e"ecuted 7shopt -s e"pandAaliases$ to #ail to e"pand aliases in a  command lie 7command/ )$. 2. Changes to 6eadline

a. Changes to mae most but not et all -- there is still crl#// o# the  e"ported readline #unctions declared in readline.h have an rlA pre#i".

b. ore 7const$ changes in #unction arguments, mostl #or completion  #unctions.

c. %i"ed a bug in rlA#orward that could cause the point to be set to be#ore  the beginning o# the line in vi mode.

d. %i"ed a bug in the callbac read-char inter#ace to mae it wor when a  readline #unction pushes some input onto the input stream with  rlAe"ecuteAne"t lie the incremental search #unctions/.

e. %i"ed a #ile descriptor lea in the histor #ile manipulation code that  was tripped when attempting to truncate a non-regular #ile lie  >dev>null/.

#. (ome e"isting variables are now documented and part o# the public  inter#ace declared in readline.h/L rlAe"plictAarg, rlAnumericAarg,

  rlAeditingAmode, rlAlastA#unc.

g. 6enamed rlttAsetAde#aultAbindings to rlAttAsetAde#aultAbindings and  crl# to rlAcrl#, so there are no public #unctions declared in readline.h  without an 7rlA$ pre#i". The old #unctions still e"ist #or bacwards  compatibilit.

3. ew %eatures in Bash

a. 5 new loadable builtin, realpath, which canonicaliJes and e"pands smlins  in pathname arguments.

b. hen 7set$ is called without options, it prints #unction de#intions in a

  wa that allows them to be reused as input. This a##ects 7declare$ and  7declare -p$ as well.

4. ew %eatures in 6eadline

a. ew application-callable #unction rlAsetApromptconst char prompt/L  e"pands its prompt string argument and sets rlAprompt to the result.

b. ew application-callable #unction rlAsetAscreenAsiJeint rows, int cols/L  public method #or applications to set readline$s idea o# the screen  dimensions.

c. The histor e"ample program e"amples>histe"amp.c/ is now built as one

  o# the e"amples.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G^-alpha1,

Page 81: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 81/123

and the previous version, bash-2.G4-release.

1. Changes to Bash

a. 5 #i" was made to allow newlines in compond arra assignments.

b. con#igure now checs #or real-time signals with unusable values.

c. 0nteractive shells no longer e"it i# a substitution #ails because o# an  unset variable within a sourced #ile.

d. %i"ed a problem with incorrect matching o# e"tended glob patterns when  doing pattern substitution.

e. 7M$ is now +uoted b the completion code when it appears in a #ilename.

#. %i"ed an error in pattern matching that caused the matcher to not  correctl sip the rest o# a bracet e"pression a#ter a character  matched.

g. %i"ed a bug in the 0%( word splitting code to mae a non-whitespace 0%(

  character preceded b 0%( whitespace part o# the current delimiter rather  than generating a separate #ield.

h. The MYpre#i"IN e"pansion now generates separate words, analogous to I,  when double-+uoted.

i. Command substitution now ignores =& btes in the command output, and the  parser ignores them on input.

:. 5 #i" was made to the :ob control code to prevent hanging processes when  the shell thins bacground processes are running but the ernel returns  -1>EC'0& #rom waitpid/.

. 7pwd$ now prints an error message i# the write #ails when displaing the  current director.

l. hen in !O(0D mode, the shell prints trap dispostions without a leading  7(0$ in the signal speci#ication.

m. %i"ed a parser bug that caused the current command$s line count to be  messed up b a compound arra assignment.

n. %i"ed a bug in the unwind-protect code that caused bad behavior on machines  where ints and pointers are not the same siJe.

o. (stem-speci#ic con#igure changes #orL acO( D.

p. Changes #or Cgwin to translate VrVn and Vr to Vn and to set #ile  descriptors used #or reading input to te"t mode in various places.

+. %i"ed a bug that caused 7Y$ to occasionall not be honored when in  a .../ subshell.

r. Bash no longer assumes that getcwd/ will return an use#ul error message  in the bu##er passed as an argument i# the call #ails.

s. The 7source$, 7.$, and 7#c$ builtins no longer chec whether a #ile is  binar be#ore reading commands #rom it.

t. (ubshells no longer turn o## :ob control when the e"it, since that  sometimes resulted in the terminal being reset to the wrong process  group.

Page 82: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 82/123

u. The histor code no longer tries to save the second and subse+uent lines  o# a multi-line command i# the #irst line was not saved.

v. The histor saving code now does a better :ob o# saving blan lines in a  multi-line command.

w. 6emoved a 7#eature$ that made 7ulimit$ silentl translate 7unlimited$ to  the current hard limit, which obscured some ernel error returns.

". %i"ed the grammar so that 7N$ is recogniJed as a reserved word a#ter  another reserved word, rather than re+uiring a 7X$ or newline. This  means that constructs lie

M M echo a b c X N N

  wor as e"pected.

. Conditional commands 88...99/ now per#orm tilde e"pansion on their  arguments.

J. oted in the documentation that 7set -a$ will cause #unctions to be

  e"ported i# the are de#ined a#ter 7set -a$ is e"ecuted.

aa. hen an interactive login shell starts, i# ! and 'OE re#er to the  same director but are not the same string, ! is set to 'OE.

bb. %i"ed 7print#$ to handle invalid #loating point numbers better.

cc. Temporar #iles are now created with random #ilenames, to improve securit.

dd. The readline initialiJation code now binds the custom bash #unctions and  e bindings a#ter the readline de#aults are set up.

ee. %i"ed the 7source$ builtin to no longer overwrite a shell #unction$s

  argument list, even i# the sourced #ile changes the positional parameters.

##. 5 bug #i" was made in the e"pansion o# 7$ in conte"ts where it should  not be split, lie assignment statements.

gg. %i"ed a bug in the parameter substring e"pansion to handle conditional  arithmetic e"pressions e"p ; val1 L val2 / without cutting the e"pression  o## at the wrong 7L$.

hh. The 7F$ redirection is no longer sub:ect to the current setting o#  7noclobber$, as !O(0D.2 speci#ies.

ii. %i"ed a bug in the conditional command parsing code that caused e"pressions

  in parentheses to occasionall be parsed incorrectl.

::. %i"ed a bug in the ...// arithmetic command to allow do...done or  M...N to #ollow the // without an intervening list terminator.

. 7print#$ now treats 7VE$ the same as 7Ve$ when per#orming bacslash escape  e"pansion #or the 7Ub$ #ormat speci#ier.

ll. hen in !O(0D mode, the shell no longer searches the current director #or  a #ile to be sourced with 7.$ or 7source$ i# 7.$ is not in !5T'.

mm. 0nteractive comments are no longer turned o## when !O(0D mode is disabled.

nn. The =0, E=0, 'O(T5E variables are not set i# the are in the shell$s  environment when it starts up.

oo. %i"ed a bug in the 7command$ builtin so the e##ect o# a command lie

Page 83: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 83/123

  7command e"ec 4#ile$ is as i# the 7command$ had been omitted.

pp. M#oo8I9N and M#oo89N now wor as in shH3 i# 7#oo$ is not an arra  variable.

++. MP#oo8D9N, where D is G, I, or , now wor as in shH3 i# 7#oo$ is not  an arra variable.

rr. The shell$s idea o# an absolute pathname now taes into account a  possible drive speci#ication on Cgwin and other indows sstems.

ss. %i"ed a bug which caused incorrect parsing o# some multi-character  constructs i# the were split across input lines with bacslash-newline  line continuation.

tt. %i"ed a bug that caused restricted shell mode to be set inappropriatel  when tring to e"ecute a shell script without a leading 7PY$.

uu. (hell #unction de#initions no longer re+uire that the bod be a group  command M...N /, as !O(0D.2 re+uires.

vv. The 7cd$ and 7pwd$ builtins now process smlins in pathnames internall  and should re+uire man #ewer calls to getcwd/.

ww. %i"ed a bug that caused a pipeline$s process group to be set incorrectl  i# one o# the pipeline elements contained a command substitution.

"". %i"ed a bug that caused core dumps when e"panding the value o# '0(T0O6E.

. The output o# 7set$ is now +uoted using $...$ so invisible characters are  displaed as escape se+uences.

JJ. %i"ed the help te"t #or 7unset$, since !5T' and 0%( ma both be unset.

aaa. The shell no longer puts director names into the command hash table.

bbb. %i"ed a bug in 7read$ that caused it to occasionall #ree memor twice i#  it was interrupted a#ter reading a large amount o# data.

ccc. 5ssignment statements that attempt to assign values to readonl variables  now cause the command to return an error status.

ddd. %i"ed a bug that could cause incorrect output i# a #ile/ construct was  interrupted.

eee. 6O=!( and %=C5E now return an error status when assignment is  attempted, but ma be unset in which case the lose their special

  properties/. 0n all respects e"cept unsetting, the are readonl.

###. The string-to-integer conversion code now ignores trailing whitespace in  the string, even i# strtol3/ does not.

ggg. The tcsh magic-space #unction now does a better :ob o# inserting the  space close to where the point was be#ore the histor e"pansion, rather  than :ust appending it.

hhh. %i"ed a bug which caused a #ile sourced #rom an interactive shell to  #ill up the :obs table i# it ran lots o# :obs.

iii. %i"ed a bug in the parameter pattern substitution code to avoid in#inite

  recursion on Jero-length matches.

2. Changes to 6eadline

Page 84: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 84/123

a. hen setting the terminal attributes on sstems using 7struct termio$,  readline waits #or output to drain be#ore changing the attributes.

b. 5 #i" was made to the histor word toeniJation code to avoid attempts to  dere#erence a null pointer.

c. 6eadline now de#aults rlAterminalAname to TE6 i# the calling application  has le#t it unset, and tries to initialiJe with the resultant value.

d. 0nstead o# calling rlAgetcA#unction// directl to get input in certain  places, readline now calls rlAreadAe/ consistentl.

e. %i"ed a bug in the completion code that allowed a bacslash to +uote a  single +uote inside a single-+uoted string.

#. rlAprompt is no longer assigned directl #rom the argument to readline/,  but uses memor allocated b readline. This allows constant strings to  be passed to readline without problems arising when the prompt processing  code wants to modi# the string.

g. %i"ed a bug that caused non-interactive histor searches to return the

  wrong line when per#orming multiple searches bacward #or the same string.

h. an variables, #unction arguments, and #unction return values are now  declared 7const$ where appropriate, to improve behavior when lining with  CZZ code.

i. The control character detection code now wors better on sstems where  7char$ is unsigned b de#ault.

:. The vi-mode numeric argument is now capped at HHHHHH, :ust lie emacs mode.

. The %unction, C!%unction, C!!%unction, and ]%unction tpede#s have been  replaced with a set o# speci#ic prototped tpede#s, though the are

  still in the readline header #iles #or bacwards compatibilit.

m. earl all o# the undocumented/ internal global variables in the librar  now have an ArlA pre#i" -- there were a number that did not, lie  screenheight, screenwidth, alphabetic, etc.

n. The ding/ convenience #unction has been renamed to rlAding/, though the  old #unction is still de#ined #or bacwards compatibilit.

o. The completion convenience #unctions #ilenameAcompletionA#unction,  usernameAcompletionA#unction, and completionAmatches now have an rlA  pre#i", though the old names are still de#ined #or bacwards compatibilit.

p. The #unctions shared b readline and bash linage is satis#ied #rom bash  when compiling with bash, and internall otherwise/ now have an shA pre#i".

+. Changed the shared librar creation procedure on &inu" and B(>O( 4." so  that the 7soname$ contains onl the ma:or version number rather than the  ma:or and minor numbers.

r. %i"ed a redispla bug that occurred when the prompt spanned more than one  phsical line and contained invisible characters.

3. ew %eatures in Bash

a. 5dded a new 7--init-#ile$ invocation argument as a snonm #or 7--rc#ile$,

  per the new = coding standards.

b. The >dev>tcp and >dev>udp redirections now accept service names as well as  port numbers.

Page 85: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 85/123

c. 7complete$ and 7compgen$ now tae a 7-o value$ option, which controls some  o# the aspects o# that compspec. ]alid values areL

de#ault - per#orm bash de#ault completion i# programmable  completion produces no matches

dirnames - per#orm director name completion i# programmable  completion produces no matches

#ilenames - tell readline that the compspec produces #ilenames,  so it can do things lie append slashes to  director names and suppress trailing spaces

4. ew %eatures in 6eadline

a. The blin timeout #or paren matching is now settable b applications.

b. ArlAe"ecutingAmacro has been renamed to rlAe"ecutingAmacro, which means  it$s now part o# the public inter#ace.

c. 6eadline has a new variable, rlAreadlineAstate, which is a bitmap that  encapsulates the current state o# the librarX intended #or use b

  callbacs and hoo #unctions.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G4-release,and the previous version, bash-2.G4-beta^.

1. Changes to Bash

a. Better compile-time and con#igure-time checs #or the necessit o#  inetAaton/.

b. 5 bug was #i"ed in the e"pansion o# KMIL-NK when there are positional  parameters.

c. 5 tpo was #i"ed in the output o# 7complete$.

d. The matches generated #or a word b the 7-$ argument to complete and  compgen are now matched against the word being completed, and onl  matches are returned as the result.

e. (ome #i"es were made #or sstems which do not restart read2/ when a  signal caught b bash is received.

#. 5 bug was #i"ed which caused the umas to be set to G when an invalid  smbolic mode mas was parsed.

g. %i"ed a bug that could cause a core dump i# a (0C'& was received while  per#orming an assignment statement using command substitution.

h. Changed the word splitting #unction #or programmable completion so cases  in which the cursor is between words are handled a bit better.

2. Changes to 6eadline

a. rlA#unmapAnames/ is now documented.

3. ew %eatures in Bash

a. The &CA=E60C variable is now treated speciall, and used to set the

  &CA=E60C locale categor #or number #ormatting, e.g., when 7print#$  displas #loating-point numbers.

------------------------------------------------------------------------------

Page 86: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 86/123

This document details the changes between this version, bash-2.G4-beta^,and the previous version, bash-2.G4-beta4.

1. Changes to Bash

a. 5 couple o# changes were made to the ae#iles #or easier building on  non-=ni" sstems.

b. %i"ed a bug where the current prompt would be set to !(2 at startup.

c. The shell script that tests an alread-installed version was changed to  remove the director it created its test programs in at e"it.

d. (everal changes were made to the code that toeniJes an input line #or  the programmable completion code. (hell metacharacters will now appear  as individual words in the word list passed to the completion #unctions.  (ome o# the e"ample completion shell #unctions were changed to understand  redirection operators.

e. 5 bug was #i"ed that, under obscure circumstances, could con#use the  parser when a shell #unction was run b the programmable completion code.

#. 5 bug was #i"ed in the ulimit builtin #or sstems not using getrlimit/.

g. The e"ecution code now propagates the correct e"it status bac to the rest  o# the code i# the return value o# a subshell command was being inverted.  (ome new test cases #or inverting return values with the 7Y$ reserved  word have been added.

h. egative e"ponents in the arithmetic evaluation o# ve now return an  evaluation error.

i. 5 bug that caused bash to chec the wrong process in a pipeline #or  abnormal termination and conse+uentl resetting the terminal attributes/

  was #i"ed.

:. %i"ed a bug that caused !(2 to be displaed a#ter !6O!TACO5 was  e"ecuted.

2. Changes to 6eadline

1. %i"ed a bug in a C preprocessor de#ine that caused the epad control  #unctions to be compiled out #or all plat#orms e"cept S!!.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G4-beta4,and the previous version, bash-2.G4-beta3.

1. Changes to Bash

a. 5 couple o# changes were made to the redirection to attempt to avoid  race conditions and malicious #ile replacement.

2. 5 change was made to the string evaluation code used #or commandsubstitution, 7eval$, and the 7.$ builtin/ to #i" an obscure core

  dump on alpha machines.

3. 5 bug that caused &0EO to be wrong when e"ecuting arithmetic #or  commands was #i"ed.

4. 5 couple o# memor leas in the programmable completion code were #i"ed.

^. 5 bug that could cause a core dump b #reeing memor twice during a call  to 7eval$ i# 7set -u$ had been enabled and an unde#ined variable was

Page 87: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 87/123

  re#erenced was #i"ed.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G4-beta3,and the previous version, bash-2.G4-beta2.

1. Changes to Bash

a. Bash should run the appropriate startup #iles when invoed b ssh2.

b. %i"ed a bug in the parsing o# conditional commands that could cause a  core dump.

c. %i"ed a bug in parsing :ob speci#ications that occasionall caused  core dumps when an out-o#-range :ob was re#erenced.

d. %i"ed the 7tpe$ and 7command$ builtins to do better reporting o#  commands that are not #ound in !5T' or the hash table.

e. %i"ed a !O(0D.2 compliance problem in the command builtin -- commands  are supposed to be reported as #ull pathnames.

#. The 7echo$ builtin now returns #ailure i# a write error occurs.

g. %i"ed a bug which caused the locale to not be reset correctl when  &CA5&& was unset.

h. Changed description o# 7getopts$ in man page and re#erence manual to mae  it clear that option characters ma be characters other than letters.

i. 0# the shell e"its while in a #unction, mae sure that an trap on ED0T  doesn$t thin the #unction is still e"ecuting.

:. Bashbug now tries harder to #ind a usable editor i# E0TO6 is not set,

  rather than simpl de#aulting to 7emacs$.

. Changes to the scripts that guess and canonicaliJe the sstem tpe, #rom  the latest 7automae$ distribution via ebian.

l. hen using named pipes #or process substitution, mae sure the #ile  descriptors opened #or reading are set to non-blocing mode.

m. %i"ed a bug that caused termination o# pipelines that are illed b a  signal to not be reported in some cases.

n. hen not in literal-histor mode, shell comment lines are not added to  the histor list.

o. hen running in !O(0D.2 mode, bash no longer per#orms word splitting on  the e"panded value o# the word supplied as the #ilename argument to  redirection operators.

p. The prompt string decoding code now bacslash-+uotes onl characters that  are special within double +uotes when e"panding the Vw and V escape  se+uences.

+. %i"ed a bug in the prompt decoding code that could cause a non-interactive  shell to seg #ault i# 7Vu$ was used in !(4 and the shell was in "trace  mode.

r. %i"ed a bug that caused #unction de#initions to be printed with an  redirections that should be attached to the entire #unction be#ore the  closing brace.

Page 88: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 88/123

s. Changed the tilde e"pansion code #or Cgwin sstems to avoid creating  pathnames beginning with 7>>$ i# 'OE ?? 7>$.

t. %i"ed a couple o# autocon# tests to avoid creating #iles with #i"ed names  in >tmp.

u. The 7trap$ and 7ill$ builtins now now the names o# the !O(0D.1b real-  time signals on sstems which support them.

2. Changes to 6eadline

a. %i"ed a problem with the single-+uote +uoting #unction that could cause  bu##er over#lows.

b. %i"ed a bug that caused incorrect 7stat characters$ to be printed i#  the #iles being completed were in the root director and visible-stats  was enabled.

3. ew %eatures in Bash

a. There is a new 7rbash.1$ manual page, #rom the ebian release.

b. The 7--enable-usg-echo-de#ault$ option to 7con#igure$ has been renamed to  7--enable-"pg-echo-de#ault$. The old option is still there #or bacwards  compatibilit.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G4-beta2,and the previous version, bash-2.G4-beta1.

1. Changes to Bash

a. %i"ed a bug that could cause pipes to be closed inappropriatel in  some obscure cases.

b. %i"ed a bug that caused creation o# the e"ported environment to clobber  the current command string i# there were an e"ported shell #unctions.

c. (ome changes were made to reduce bash$s memor usage.

d. %i"ed a problem with programmable completion and #ilenames to be  completed containing +uote characters.

e. Changed the code the removes named pipes created #or the .../ and F.../  e"pansions to de#er removal until a#ter an current shell #unction has  #inished e"ecuting.

#. %i"ed a bug in 7select$ which caused it to not handle the 7continue$  builtin correctl.

g. 5utocon# tests added #or cgwin32 and mingw32.

2. ew %eatures in Bash

a. The 7--with-bash-malloc$ con#igure option replaces 7--with-gnu-malloc$  which is still there #or bacwards compatibilit/.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G4-beta1,and the previous version, bash-2.G4-alpha1.

1. Changes to Bash

a. %i"ed a bug in the programmable completion code that occurred when

Page 89: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 89/123

  tring to complete command lines containing a 7X$ or 7I$.

b. The #ile descriptor #rom which the shell is reading a script is now  moved to a #ile descriptor above the user-addressible range.

c. Changes to 7print#$ so that it can handle integers beginning with G  or G" as octal and he", respectivel.

d. %i"es to the programmable completion code so it handles nonsense lie  7compgen -C "J$ grace#ull.

e. The shell no longer modi#ies the signal handler #or (0!6O%, allowing  pro#iling again on certain sstems.

#. The shell checs #or a new window siJe, i# the user has re+uested it,  a#ter a process e"its due to a signal.

g. %i"ed a bug with variables with null values in a program$s temporar  environment and the bash getenv/ replacement.

h. 7declare$ and the other builtins that tae variable assignments as

  arguments now honor 7set -a$ and mar modi#ied variables #or e"port.

i. (ome changes were made #or --dump-po-strings mode when writing strings  with embedded newlines.

:. The code that caches e"port strings #rom the initial environment now  duplicates the string rather than :ust pointing into the environment.

. The #ilename completion +uoting code now uses single +uotes b de#ault  i# the #ilename being completed contains newlines, since VnewlineF  has a special meaning to the parser.

l. Bash now uses tpede#s bits32At and uAbits32At instead o# int32At and

  uAint32At, respectivel to avoid con#licts on certain =ni" versions.

m. Con#iguration changes were made #orL 6hapsod, ac O(, %reeB(-3.".

n. %i"ed a problem with hostname-to-ip-address translation in the  >dev>tcp*udp/>hostname>port redirection code.

o. The te"in#o manual has been reorganiJed slightl.

p. %ilename generation globbing/ range comparisons in bracet e"pressions  no longer use strcoll3/ even i# it is available, since it has unwanted  e##ects in certain locales.

+. %i"ed a cosmetic problem in the source that caused the shell to not  compile i# !56EA560T'ET0C was not de#ined but 560T'A%O6ACO5 was.

r. %i"ed a bug in the here-document code tripped when the #ile descriptor  opened to the #ile containing the te"t o# the here document was the  same as a redirector speci#ied b the user.

s. %i"ed a bug where the 0]E6TA6ET=6 #lag was not being set #or 7pipeline$  in 7time Y pipeline$.

t. %i"ed a bug with the 7wait$ builtin which mani#ested itsel# when an  interrupt was received while the shell was waiting #or asnchronous  processes in a shell script.

u. %i"ed the EB= trap code so that it has the correct value o# ;.

v. %i"ed a bug in the parameter pattern substitution code that could cause

Page 90: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 90/123

  the shell to attempt to #ree unallocated memor i# the pattern started  with 7>$ and an e"pansion error occurs.

w. %i"ed a bug in the positional parameter substring code that could  cause the shell to loop #reeing #reed memor.

". %i"ed a bug in the positional parameter pattern substitution code so  that it correctl handles null replacement strings with a pattern  string pre#i"ed with 7U$ or 7P$.

. The shell no longer attempts to import #unctions #rom the environment i#  started with 7-n$.

J. %i"ed a bug that caused 7return$ in a command substitution e"ecuted in  a shell #unction to return #rom the #unction in a subshell and continue  e"ecution.

aa. 7hash -p >pathname>with>slashes name$ is no longer allowed when the shell  is restricted.

bb. The wait :ob control #unctions now behave better i# called when there

  are no unwaited-#or children.

cc. Command substitution no longer unconditionall disables :ob control in  the subshell started to run the command.

dd. 5 bug was #i"ed that occasionall caused traps to mess up the parser  state.

ee. 7bashbug$ now honors user headers in the mail message it sends.

##. 5 bug was #i"ed that caused the 7Lp$ histor modi#ier to not print the  histor e"pansion i# the 7histveri#$ option was set.

2. Changes to 6eadline

a. %i"ed a bug in the redispla code #or lines with more than 2^\ line  breas.

b. 5 bug was #i"ed which caused invisible character marers to not be  stripped #rom the prompt string i# the terminal was in no-echo mode.

c. 6eadline no longer tries to get the variables it needs #or redispla  #rom the termcap entr i# the calling application has speci#ied its  own redispla #unction. 6eadline treats the terminal as 7dumb$ in  this case.

d. %i"es to the (00C' code so that a multiple-line prompt with escape  se+uences is redrawn correctl.

3. ew %eatures in Bash

a. 7bashbug$ now accepts 7--help$ and 7--version$ options.

b. There is a new 7"pgAecho$ option to 7shopt$ that controls the behavior  o# echo with respect to bacslash-escaped characters at runtime.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G4-alpha1,and the previous version, bash-2.G4-devel.

1. Changes to Bash

a. %i"ed a bug that could cause core dumps when per#orming substring

Page 91: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 91/123

  e"pansion.

b. (hared ob:ect con#iguration changes #orL (olaris, O(%>1

c. The !O(0DA&OBA&0B656[ code that uses the !O(0D.2 globbing #acilities  #or pathname e"pansion now understands &OB0O6E.

d. The code that implements 7eval$ was changed to save the value o# the  current prompt, so an eval in a shell #unction called b the programmable  completion code will not change the prompt to !(2.

e. 6estored the undocumented OA0TE65CT0]EA&O0A('E&&( Pde#ine to  con#ig-top.h. 0# this is de#ined, all login shells will read the  startup #iles, not :ust interactive and non-interactive started with  the 7--login$ option.

#. %i"ed a bug that caused the e"pansion code to occasionall dump core i#  0%( contained characters F 12R.

g. %i"ed a problem with the grammar so that a newline is not re+uired  a#ter the 7//$ in the new-stle arithmetic #or statementX a semicolon

  ma be used as e"pected.

h. ]ariable indirection ma now re#erence the shell$s special variables.

i. The $...$ and K...K constructs are now added to the histor correctl  i# the contain newlines and command-oriented histor is enabled.

:. 0t is now an error to tr to assign a value to a #unction-local cop  o# a readonl shell variable declared with the 7local$ builtin/.

2. Changes to 6eadline

a. The histor #ile code now uses OAB056[ mode when reading and writing

  the histor #ile on cgwin32.

3. ew %eatures in Bash

a. 5 new programmable completion #acilit, with two new builtin commandsL  complete and compgen.

b. con#igure has a new option, 7--enable-progcomp$, to compile in the  programmable completion #eatures enabled b de#ault/.

c. 7shopt$ has a new option, 7progcomp$, to enable and disable programmable  completion at runtime.

d. =nsetting 'O(T%0&E now clears the list o# hostnames used #or completion.

4. ew %eatures in 6eadline

a. 5 new variable, rlAgnuAreadlineAp, alwas 1. The intent is that an  application can veri# whether or not it is lined with the 7real$  readline librar or some substitute.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G4-devel,and the previous version, bash-2.G3-release.

1. Changes to Bash

a. (stem-speci#ic con#iguration and source changes #orL 0nteri", 6hapsod

b. %i"ed a bug in e"ecuteAcmd.c that resulted in a compile-time error i#

Page 92: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 92/123

  SOBACOT6O& was not de#ined.

c. 5n obscure race condition in the trap code was #i"ed.

d. The string resulting #rom $...$ is now re+uoted to avoid an #urther  e"pansion.

e. The $...$ +uoting snta" now allows bacslash to escape a single +uote,  #or sh-H3 compatibilit.

#. The K...K +uoting snta" now escapes bacslashes and double +uotes in  the translated string when displaing them with the --dump-po-strings  option.

g. 7echo -e$ no longer converts V$ to $.

h. %i"es were made to the e"tended globbing code to handle embedded .../  patterns better.

i. (ome improvements were made to the code that unsets 7nodela$ mode on  the #ile descriptor #rom which bash is reading input.

:. (ome changes were made to the replacement termcap librar #or better  operation on (-O(.

. (ome changes were made to the tilde e"pansion code to handle bacslash  as a pathname separator on (-O(.

l. The source has been reorganiJed a little bit -- there is now an 7include$  subdirector, and lib>posi"headers has been removed.

m. 0mprovements were made to the 7read$ builtin so that it maes man  #ewer read2/ sstem calls.

n. The e"pansion o# - will include 7c$ and 7s$ when those options are  supplied at shell invocation.

o. (everal improvments were made to the completion codeL variable completion  now wors better when there are unterminated e"pansions, command  completion understands +uotes better, and completion now wors in certain  unclosed ... constructs.

p. The arithmetic e"pansion code was #i"ed to not need the value o# a  variable being assigned a value #i"es the Kss?GHX let ss?1GK bug/.

+. (ome changes were made to mae e"ported environment creation #aster.

r. The html documentation will be installed into htmldir/ i# that variable  has a value when 7mae install$ is run.

s. %i"ed a bug that would cause the bashrc #ile to be sourced inappropriatel  when bash is started b sshd.

t. The (('AC&0ET environment variable is no longer auto-e"ported.

u. 5 bug that caused redirections with .../ subshells to be per#ormed in  the wrong order was #i"ed.

v. 5 bug that occasionall caused inappropriate e"pansion o# assignment  statements in compound arra assignments was #i"ed.

w. The code that parses the words in a compound arra assignment was  simpli#ied considerabl and should wor better now.

Page 93: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 93/123

". %i"es to the non-:ob-control code in no:obs.c to mae it !O(0D.2-compliant  when a user attempts to retrieve the status o# a terminated bacground  process.

. %i"es to the 7print#$ builtin so that it doesn$t tr to e"pand all  bacslash escape se+uences in the #ormat string be#ore parsing it #or  U #ormat speci#iers.

2. Changes to 6eadline

a. The histor librar tries to truncate the histor #ile onl i# it is a  regular #ile.

b. 5 bug that caused ArlAdispatch to address negative arra indices on  sstems with signed chars was #i"ed.

c. rl-an-nth-arg now leaves the histor position the same as when it was  called.

d. Changes to the completion code to handle (-O( drive-letterLpathname  #ilenames.

e. Completion is now case-insensitive b de#ault on (-O(.

#. %i"es to the histor #ile manipulation code #or (-O(.

g. 6eadline attempts to bind the arrow es to appropriate de#aults on (-O(.

h. (ome #i"es were made to the redispla code #or better operation on (-O(.

i. The +uoted-insert code will now insert tt special chars lie C.

:. 5 bug was #i"ed that caused the displa code to re#erence memor be#ore  the start o# the prompt string.

. ore support #or AAEDAA O(>2/.

l. 5 bug was #i"ed in readline$s signal handling that could cause in#inite  recursion in signal handlers.

m. 5 bug was #i"ed that caused the point to be less than Jero when rlA#orward  was given a ver large numeric argument.

n. The vi-mode code now gets characters via the application-settable value  o# rlAgetcA#unction rather than calling rlAgetc directl.

3. ew %eatures in Bash

a. The histor builtin has a 7-d o##set$ option to delete the histor entr  at position 7o##set$.

b. The prompt e"pansion code has two new escape se+uencesL V:, the number o#  active :obsX and Vl, the basename o# the shell$s tt device name.

c. The 7bind$ builtin has a new 7-"$ option to bind e se+uences to shell  commands.

d. There is a new shell option, noAemptAcommandAcompletion, which, when  enabled, disables command completion when T5B is tped on an empt line.

e. The 7help$ builtin has a 7-s$ option to :ust print a builtin$s usage  snopss.

#. There are several new arithmetic operatorsL idZZ, id-- variable

Page 94: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 94/123

  post-increment>decrement/, ZZid, --id variabl pre-increment>decrement/,  e"pr1 , e"pr2 comma operator/.

g. There is a new sh-H3 stle arithmetic #or commandL#or e"pr1 X e"pr2X e"pr3 //X do listX done

h. The 7read$ builtin has a number o# new optionsL-t timeout onl wait timeout seconds #or input-n nchars onl read nchars #rom input instead o# a #ull line-d delim read until delim rather than newline-s don$t echo input chars as the are read

i. The redirection code now handles several #ilenames speciallL  >dev>#d>, >dev>stdin, >dev>stdout, and >dev>stderr, whether or  not the are present in the #ile sstem.

:. The redirection code now recogniJes pathnames o# the #orm  >dev>tcp>host>port and >dev>udp>host>port, and tries to open a socet  o# the appropriate tpe to the speci#ied port on the speci#ied host.

. The sh-H3 MYpre#i"N e"pansion, which e"pands to the names o# all

  shell variables whose names start with pre#i", has been implemented.

l. There is a new dnamic variable, %=C5E, which e"pands to the name o#  a currentl-e"ecuting #unction. 5ssignments to %=C5E have no e##ect.

m. The 6O=!( variable is no longer readonlX assignments to it are silentl  discarded. This means it can be unset.

4. ew %eatures in 6eadline

a. !arentheses matching is now alwas compiled into readline, and enabled  or disabled when the value o# the 7blin-matching-paren$ variable is  changed.

b. (-O( sstems now use @>Ainputrc as the last-ditch inputrc #ilename.

c. (-O( sstems now use @>Ahistor as the de#ault histor #ile.

d. histor-search-M#orward,bacwardN now leave the point at the end o# the  line when the string to search #or is empt, lie  Mreverse,#orwardN-search-histor.

e. histor-search-M#orward,bacwardN now leave the last histor line #ound  in the readline bu##er i# the second or subse+uent search #ails.

#. ew #unction #or use b applicationsL rlAonAnewAlineAwithAprompt, used

  when an application displas the prompt itsel# be#ore calling readline/.

g. ew variable #or use b applicationsL rlAalreadAprompted. 5n application  that displas the prompt itsel# be#ore calling readline/ must set this to  a non-Jero value.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G3-release,and the previous version, bash-2.G3-beta2.

1. Changes to Bash

a. 5 #ile descriptor lea in the 7#c$ builtin was #i"ed.

b. 5 bug was #i"ed in the 7read$ builtin that caused occasional spurious  #ailures when using 7read -e$.

Page 95: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 95/123

c. The version code needed to use the value o# the cpp variable  CO%A5C'T[!E rather than 5C'T[!E.

d. 5 new test was added to e"ercise the command printing and coping code.

e. 5 bug was #i"ed that caused 7time$ to be recogniJed as a reserved word  i# it was the #irst pattern in a 7case$ statement pattern list.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G3-beta2,and the previous version, bash-2.G3-beta1.

1. Changes to Bash

a. (light additions to support>shob:-con#, mostl #or the bene#it o# 50D 4.2.

b. con#ig.Mguess,subN support added #or the EC (D4.

c. Changed some o# the cross-compiling sections o# the con#igure macros in  aclocal.m4 so that con#igure won$t abort.

d. (light changes to how the 'T& versions o# the bash and readline manuals  are generated.

e. %i"ed conditional command printing to avoid interpreting print# 7U$-escapes  in arguments to 88.

#. on$t include the bash malloc on all variants o# the alpha processor.

g. Changes to con#igure to mae --enable-pro#iling wor on (olaris 2.".

h. %i"ed a bug that mani#ested itsel# when shell #unctions were called  between calls to 7getopts$.

i. %i"ed pattern substitution so that a bare 7P$as a pattern causes the  replacement string to be pre#i"ed to the search string, and a bare  7U$ causes the replacement string to be appended to the search string.

:. %i"ed a bug in the command e"ecution code that caused child processes  to occasionall have the wrong value #or Y.

2. Changes to 6eadline

a. 5dded code to the histor librar to catch histor substitutions using  7)$ without a previous histor substitution or search having been  per#ormed.

3. ew %eatures in Bash

4. ew %eatures in 6eadline

a. ew bindable variableL 7isearch-terminators$.

b. ew bindable #unctionL 7#orward-bacward-delete-char$ unbound b de#ault/.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G3-beta1,and the previous version, bash-2.G3-alpha. 1. Changes to Bash

a. 5 change was made to the help te"t #or 7M...N$ to mae it clear that a  semicolon is re+uired be#ore the closing brace.

Page 96: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 96/123

b. 5 #i" was made to the 7test$ builtin so that snta" errors cause test  to return an e"it status F 1.

c. lobbing is no longer per#ormed on assignment statements that appear as  arguments to 7assignment builtins$ such as 7e"port$.

d. (stem-speci#ic con#iguration changes were made #orL 6hapsod,  50D 4.2>gcc, B(>O( 4.G.

e. ew loadable builtinsL ln, unlin.

#. (ome #i"es were made to the globbing code to handle e"tended glob patterns  which immediatel #ollow a 7$.

g. 5 #i" was made to the command printing code to ensure that redirections  #ollowing compound commands have a space separating them #rom the rest  o# the command.

h. The pathname canonicaliJation code was changed to produce #ewer leading  7>>$ se+uences, since those are interpreted as networ #ile sstem  pathnames on some sstems.

i. 5 #i" was made so that loops containing 7eval$ commands in commands passed  to 7bash -c$ would not e"it prematurel.

:. (ome changes were made to the :ob reaping code when the shell is not  interactive, so the shell will retain e"it statuses longer #or e"amination  b 7wait$.

. 5 #i" was made so that 7:obs * command$ wors again.

l. The erroneous compound arra assignment var?...// is now a snta" error.

m. 5 change was made to the dnamic loading code in 7enable$ to support

  Tenon$s achTen.

n. 5 #i" was made to the globbing code so that e"tended globbing patterns  will correctl match 7.$ in a bracet e"pression.

2. Changes to 6eadline

a. 5 #i" was made to the completion code in which a tpo caused the wrong  value to be passed to the #unction that computed the longest common  pre#i" o# the list o# matches.

b. The completion code now checs the value o# rlA#ilenameAcompletionAdesired,  which is set b application-supplied completion #unctions to indicate

  that #ilename completion is being per#ormed, to decide whether or not to  call an application-supplied 7ignore completions$ #unction.

3. ew %eatures in Bash

a. 5 change was made to the startup #ile code so that an shell begun with  the 7--login$ option, even non-interactive shells, will source the login  shell startup #iles.

4. ew %eatures in 6eadline

a. 5 new variable, rlAeraseAemptAline, which, i# set b an application using  readline, will cause readline to erase, prompt and all, lines on which the

  onl thing tped was a newline.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G3-alpha,

Page 97: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 97/123

and the previous version, bash-2.G2.1-release.

1. Changes to Bash

a. (stem-speci#ic con#iguration changes were made #orL 0ri" \.", =ni"ware W.

b. The te"i2dvi and te"i2html scripts were updated to the latest versions  #rom the net.

c. The con#igure tests that determine which native tpe is 32 bits were  changed to not re+uire a compiled program.

d. %i"ed a bug in shellAe"ecve that could cause memor to be #reed twice  a#ter a #ailed e"ec.

e. The 7print#$ test uses 7di## -a$ i# it$s available to prevent con#usion  due to the non-ascii output.

#. (hared ob:ect con#iguration is now per#ormed b a shell script,  support>shob:-con#, which generates values to be substituted into  mae#iles b con#igure.

g. (ome changes were made to 7ulimit$ to avoid the use o# 6&0A0]5&0 as a  return value.

h. Changes were made to 7ulimit$ to wor around '!=D H."$s peculiar  handling o# 6&00TA%0&E(0QE.

i. (ome new loadable builtins were addedL id, printenv, snc, whoami, push,  mdir. 7pushd$, 7popd$, and 7dirs$ can now be built as regular or  loadable builtins #rom the same source #ile.

:. Changes were made to 7print#$ to handle =& btes in the e"panded #ormat  string.

. The various 7mae clean$ ae#ile targets now descend into lib>sh.

l. The 7tpe$ builtin was changed to use the internal 7getopt$ so that things  lie 7tpe -ap$ wor as e"pected.

m. There is a new con#iguration option, --with-installed-readline, to lin  bash with a locall-installed version o# readline. Onl readline version  4.G and later releases can support this. (hared and static libraries  are supported. The installed include #iles are used.

n. There is a new autocon# macro used to #ind which basic tpe is \4 bits.

o. namic lining and loadable builtins should now wor on (CO 3.2v^,  50D 4.2 with gcc, =ni"ware W, and man other sstems using gcc, where  the 7-shared$ options wors correctl.

p. 5 bug was #i"ed in the bash #ilename completion code that caused memor to  be #reed twice i# a director name containing an unset variable was  completed and the -u option was set.

+. The prompt e"pansion code now +uotes the 7$ in the 7V$ e"pansion so it  is not processed b subse+uent parameter e"pansion.

r. %i"ed a parsing bug that caused a single or double +uote a#ter a 7$ to  trigger 5(0 C e"pansion or locale translation.

s. %i"ed a bug in the globbing code that caused +uoted #ilenames containing  no globbing characters to sometimes be incorrectl e"panded.

Page 98: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 98/123

t. Changes to the de#ault prompt strings i# prompt string decoding is not  compiled into the shell.

u. 5dded 7do$, 7then$, 7else$, 7M$, and 7$ to the list o# ewords that ma  precede the 7time$ reserved word.

v. The shell ma now be cross-built #or BeO( as well as cgwin32.

w. The conditional command e"ecution code now treats 7?$ the same as 7??$  #or deciding when to per#orm pattern matching.

". The 7-e$ option no longer causes the shell to e"it i# a command e"its  with a non-Jero status while running the startup #iles.

. The 7print#$ builtin no longer dumps core i# a modi#ier is supplied in  the #ormat string without a conversion character e.g. 7Uh$/.

J. 5rra assignments o# the #orm a?.../ no longer show up in the histor  list.

aa. The parser was #i"ed to obe the !O(0D.2 rules #or #inding the closing

  7N$ in a M...N e"pression.

bb. The histor #ile is now opened with mode G\GG rather than G\\\, so bash  no longer relies on the user$s umas being set appropriatel.

cc. (etting &5 no longer causes &CA5&& to be assigned a valueX bash now  relies on proper behavior #rom the C librar.

dd. inor changes were made to allow +uoted variable e"pansions using  M...N to be completed correctl i# there is no closing 7K$.

ee. Changes were made to builtins>ae#ile.in so that con#iguring the shell  with 7--enable-pro#iling$ wors right and builtins>mbuiltins is

  generated.

2. Changes to 6eadline

a. The version number is now 4.G.

b. There is no longer an Pi#de# ('E&& code in the source #iles.

c. (ome changes were made to the e binding code to #i" memor leas and  better support in32 sstems.

d. %i"ed a sill tpo in the paren matching code -- it$s microseconds, not  milliseconds.

e. The readline librar should be compilable b CZZ compilers.

#. The readline.h public header #ile now includes #unction prototpes #or  all readline #unctions, and some changes were made to #i" errors in the  source #iles uncovered b the use o# prototpes.

g. The ma"imum numeric argument is now clamped at 1GGGGGG.

h. %i"es to rlAanAlastAarg to mae it behave better.

i. %i"ed a bug in the displa code that caused core dumps i# the prompt  string length e"ceeded 1G24 characters.

:. The menu completion code was #i"ed to properl insert a single completion  i# there is onl one match.

Page 99: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 99/123

. 5 bug was #i"ed that caused the displa code to improperl displa tabs  a#ter newlines.

3. ew %eatures in Bash

a. ew 7shopt$ option, 7restrictedAshell$, indicating whether or not the  shell was started in restricted mode, #or use in startup #iles.

b. %ilename generation is now per#ormed on the words between and / in  arra assignments which it probabl should have done all along/.

c. O&! is now auto-e"ported, as !O(0D.2 seems to re+uire.

d. E] and B5('AE] are read-onl variables in a restricted shell.

4. ew %eatures in 6eadline

a. an changes to the signal handlingLo 6eadline now catches (0<=0T and cleans up the tt be#ore returningXo 5 new variable, rlAcatchAsignals, is available to application writersto indicate to readline whether or not it should install its own

  signal handlers #or (00T, (0TE6, (0<=0T, (05&6, (0T(T!,  (0TT0, and (0TTO=Xo 5 new variable, rlAcatchAsigwinch, is available to application  writers to indicate to readline whether or not it should install its  own signal handler #or (00C', which will chain to the calling  applications$s (00C' handler, i# one is installedXo There is a new #unction, rlA#reeAlineAstate, #or application signal  handlers to call to #ree up the state associated with the current  line a#ter receiving a signalXo There is a new #unction, rlAcleanupAa#terAsignal, to clean up the  displa and terminal state a#ter receiving a signalXo There is a new #unction, rlAresetAa#terAsignal, to reinitialiJe the  terminal and displa state a#ter an application signal handler

  returns and readline continues

b. There is a new #unction, rlAresiJeAterminal, to reset readline$s idea o#  the screen siJe a#ter a (00C'.

c. ew public #unctionsL rlAsaveAprompt and rlArestoreAprompt. These were  previousl private #unctions with a 7A$ pre#i".

d. ew #unction hooL rlApreAinputAhoo, called :ust be#ore readline starts  reading input, a#ter initialiJation.

e. ew #unction hooL rlAdisplaAmatchesAhoo, called when readline would  displa the list o# completion matches. The new #unction

  rlAdisplaAmatchAlist is what readline uses internall, and is available  #or use b application #unctions called via this hoo.

#. ew bindable #unction, delete-char-or-list, lie tcsh.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G2.1-release,and the previous version, bash-2.G2-release.

1. Changes to Bash

a. 5 bug that caused the bash readline support to not compile unless aliases  and csh-stle histor were con#igured into the shell was #i"ed.

b. %i"ed a bug that could cause a core dump when here documents contained  more than 1GGG characters.

Page 100: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 100/123

c. %i"ed a bug that caused a C!5T' entr o# KK to not be treated the same  as the current director when in !O(0D mode.

d. %i"ed an alignment problem with the memor returned b the bash malloc,  so returned memor is now \4-bit aligned.

e. %i"ed a bug that caused command substitutions e"ecuted within pipelines  to put the terminal in the wrong process group.

#. %i"es to support>con#ig.sub #orL alphas, (CO Open (erver and Open estop,  =ni"ware 2, and =ni"ware W.

g. %i"es to the pattern matching code to mae it wor correctl #or eight-bit  characters.

h. %i"ed a problem that occasionall caused the shell to displa the wrong  value #or the new woring director when changing to a director #ound  in C!5T' when in phsical mode.

i. %i"ed a bug that caused core dumps when using conditional commands in  shell #unctions.

:. %i"ed a bug that caused the print# builtin to loop #orever i# the #ormat  string did not consume an o# the arguments.

. %i"ed a bug in the parameter e"pansion code that caused KIK to be  incorrectl split i# 0%( did not contain a space character.

l. %i"ed a bug that could cause a core dump when completing hostnames i#  the number o# matching hostnames was an e"act multiple o# 1\.

m. %i"ed a bug that caused the shell to #or too earl when a command  such as 7U2 )$ was given.

2. Changes to 6eadline

a. %i"ed a problem with redispla that showed up when the prompt string was  longer than the screen width and the prompt contained invisible characters.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G2-release,and the previous version, bash-2.G2-beta2.

1. Changes to Bash

a. 5 bug was #i"ed that caused the terminal process group to be set  incorrectl when per#orming command substitution o# builtins in a

  pipeline.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G2-beta2,and the previous version, bash-2.G2-beta1.

1. Changes to Bash

a. 5ttempting to 7wait$ #or stopped :obs now generates a warning message.

b. !ipelines which e"it due to (0!0!E in non-interactive shells are now  not reported i# the shell is compiled -OTA6E!O6TA(0!0!E.

c. (ome changes were made to builtins>psiJe.sh and support>bashbug.sh to  attempt to avoid some >tmp #ile races and surreptitious #ile  substitutions.

Page 101: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 101/123

d. %i"ed a bug that caused the shell not to compile i# con#igured with  dparen arithmetic but without aliases.

e. %i"ed a bug that caused the input stream to be switched when assigning  empt arras with 7bash -c$.

#. 5 bug was #i"ed in the readline e"pansion glue code that caused bash to  dump core when e"panding lines with an unclosed single +uote.

g. 5 #i" was made to the 7cd$ builtin so that using a non-empt director  #rom C!5T' results in an absolute pathname o# the new current woring  director to be displaed a#ter the current director is changed.

h. %i"ed a bug in the variable assignment code that caused the shell to  dump core when re#erencing an unset variable with 7set -u$ enabled in  an assignment statement preceding a command.

i. %i"ed a bug in the e"it trap code that caused reserved words to not be  recogniJed under certain circumstances.

:. %i"ed a bug in the parameter pattern substitution code so that +uote

  removal is per#ormed.

. The shell should now con#igure correctl on 5pple 6hapsod sstems.

l. The 7ill$ builtin now prints a usage message i# it is not passed an  arguments.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G2-beta1,and the previous version, bash-2.G2-alpha1.

1. Changes to Bash

a. 5 #ew compilation bugs were #i"ed in the new e"tended globbing code.

b. E"ecuting arithmetic commands now sets the command name to 7$ so  error messages loo right.

c. %i"ed some build problems with various con#iguration options.

d. The 7print#$ builtin now aborts immediatel i# an illegal #ormat  character is encountered.

e. The code that creates here-documents now behaves better i# the #ile it$s  tring to create alread e"ists #or some reason.

#. %i"ed a problem with the e"tended globbing code that made patterns lie  7"Z$ e"pand incorrectl.

g. The prompt string e"pansion code no longer +uotes tildes with bacslashes.

h. The bash getcwd/ implementation in lib>sh>getcwd.c now behaves better in  the presence o# lstat2/ #ailures.

i. %i"ed a bug with strsub/ that caused core dumps when e"ecuting 7#c -s$.

:. The mail checing code now ensures that it has a valid de#ault mailpath.

. 5 bug was #i"ed that caused local variables to be unset inappropriatel

  when sourcing a script #rom within another sourced script.

l. 5 bug was #i"ed in the histor saving code so that #unctions are saved  in the histor list correctl i# 7cmdhist$ is enabled, but 7lithist$

Page 102: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 102/123

  is not.

m. 5 bug was #i"ed that caused print# over#lows when displaing error  messages.

n. 0t should be easier to build the loadble builtins in e"amples>loadables,  though some manual editing o# the generated ae#ile is still re+uired.

o. The user$s primar group is now alwas M6O=!(8G9N.

p. (ome updates were made to support>con#ig.guess #rom the = master cop.

+. (ome changes were made to the autocon# support #or (olaris 2.\ large  #iles.

r. The 7command$ builtins now does the right thing when con#str3/ cannot  #ind a value #or AC(A!5T'.

s. E"tended globbing e"pressions lie 7.Yc/$ are not histor e"panded i#  7e"tglob$ is enabled.

t. =sing the 7-!$ option to 7cd$ will #orce the value that is assigned to  ! to not contain an smbolic lins.

2. Changes to 6eadline

a. The code that prints completion listings now behaves better i# one or  more o# the #ilenames contains non-printable characters.

b. The time dela when showing matching parentheses is now G.^ seconds.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G2-alpha1,and the previous version, bash-2.G1.1-release.

1. Changes to Bash

a. O(-speci#ic con#iguration changes #orL B(>O( 3.", ini" 2.",  (olaris 2.\, (00D (]64.

b. Changes were made to the generated 7in#o$ #iles so that 7install-in#o$  wors correctl.

c. ! is now auto-e"ported.

d. 5 #i" was made to the pipeline code to mae sure that the shell #ors  to e"ecute simple commands consisting solel o# assignment statements.

e. Changes to the test suite #or sstems with 14-character #ilenames.

#. The de#ault siJes o# some internal hash tables have been made smaller  to reduce the shell$s memor #ootprint.

g. The 7...//$ arithmetic command is now e"ecuted directl instead o#  being translated into 7let K...K$.

h. %i"es were made to the e"pansion code so that KK, KIK, KMarra8I9NK,  and KMarra8I9NK e"pand correctl when 0%( does not contain a space  character, is unset, or is set to =&&.

i. The indirect e"pansion code MYvarN/ was changed so that the onl  valid values o# 7var$ are variable names, positional parameters, 7P$,  7I$, and 7$.

Page 103: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 103/123

:. 5n arithmetic e"pression error in a ...// e"pansion now causes a  non-interactive shell running in posi" mode to e"it.

. Compound arra assignment now splits the words within the parentheses  on shell metacharacters lie the parser would be#ore e"pansing them  and per#orming the assignment. This is #or compatibilit with sh-H3.

l. The internal shell bacslash-+uoting code used in the output o# 7set$  and completion/ now +uotes tildes i# the appear at the start o# the  string or a#ter a 7?$ or 7L$.

m. 5 couple o# bugs with 7shopt -o$ were #i"ed.

n. 7bash Zo$ now displas the same output as 7set Zo$ be#ore starting an  interactive shell.

o. 5 bug that caused command substitution and the 7eval$ builtin to  occasionall #ree memor twice when an error was encountered was #i"ed.

p. The #ilename globbing code no longer re+uires read permission #or a  director when the #ilename to be matched does not contain an globbing

  characters, as !O(0D.2 speci#ies.

+. 5 bug was #i"ed so that the :ob containing the last asnchronous  process is not removed #rom the :ob table until a 7wait$ is e"ecuted  #or that process or another asnchronous process is started. This  satis#ies a !O(0D.2 re+uirement.

r. 5 7select$ bug was #i"ed so that a non-numeric user response is treated  the same as a numeric response that is out o# range.

s. The shell no longer parses the value o# ('E&&O!T( #rom the environment  i# it is restricted, running setuid, or running in 7privileged mode$.

t. %i"es were made to enable large #ile support on sstems such as  (olaris 2.\, where the siJe o# a #ile ma be larger than can be held  in an 7int$.

u. The #ilename hashing code was #i"ed to not add 7.>$ to the beginning o#  #ilenames which alread begin with 7.>$.

v. The con#igure script was changed so that the = termcap librar is not  compiled in i# 7pre#er-curses$ has been speci#ied.

w. '0(TCOT6O& and '0(T0O6E are no longer applied to the second and  subse+uent lines o# a multi-line command.

". 5 #i" was made to 7disown$ so that it does a better :ob o# catching  out-o#-range :obs.

. on-interactive shells no longer report the status o# processes terminated  due to (00T, even i# the standard output is a terminal.

J. 5 bug that caused the output o# 7:obs$ to have e"tra carriage returns  was #i"ed.

aa. 5 bug that caused !0!E(T5T=( to not be set when builtins or shell  #unctions were e"ecuted in the #oreground was #i"ed.

bb. Bash now attempts to detect when it is being run b sshd, and treats

  that case identicall to being run b rshd.

cc. 5 bug that caused 7set -a$ to e"port ('E&&O!T( when one o# the shell  options was changed was #i"ed.

Page 104: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 104/123

dd. The 7ill$ builtin now disallows empt or missing process id arguments  instead o# treating them as identical to 7G$, which means the current  process.

ee. 7var?value declare -" var$ now behaves identicall to  7var?value e"port var$. (imilarl #or 7var?value declare -r var$ and  7var?value readonl var$.

##. 5 #ew memor leas were #i"ed.

gg. 7alias$ and 7unalias$ now print error messages when passed an argument  that is not an alias #or printing or deletion, even when the shell is  not interactive, as !O(0D.2 speci#ies.

hh. 7alias$ and 7alias -p$ now return a status o# G when no aliases are  de#ined, as !O(0D.2 speci#es.

ii. 7cd -$ now prints the pathname o# the new woring director i# the shell  is interactive.

::. 5 #i" was made so that the code that binds ! now copes with getcwd/  returning =&&.

. 7unset$ now checs whether or not a #unction name it$s tring to unset  is a valid shell identi#ier onl when the shell is running in posi" mode.

ll. 5 change was made to the code that generates #ilenames #or here documents  to mae them less prone to name collisions.

mm. The parser was changed so that 7time$ is recogniJed as a reserved word  onl at the beginning o# a pipeline.

nn. The pathname canonicaliJation code was changed so that 7>>$ is converted

  into 7>$, but all other pathnames beginning with 7>>$ are le#t alone, as  !O(0D.2 speci#ies.

oo. The 7logout$ builtin will no longer e"it a non-interactive non-login  shell.

2. Changes to 6eadline

a. %i"ed a problem in the readline test program rltest.c that caused a core  dump.

b. The code that handles parser directives in inputrc #iles now displas  more error messages.

c. The histor e"pansion code was #i"ed so that the appearance o# the  histor comment character at the beginning o# a word inhibits histor  e"pansion #or that word and the rest o# the input line.

3. ew %eatures in Bash

a. 5 new version o# malloc, based on the older = malloc, that has man  changes, is more page-based, is more conservative with memor usage,  and does not 7orphan$ large blocs when the are #reed.

b. 5 new version o# gmalloc, based on the old &0BC malloc, with man  changes and range checing included b de#ault.

c. 5 new implementation o# #nmatch3/ that includes #ull !O(0D.2 Basic  6egular E"pression matching, including character classes, collating  smbols, e+uivalence classes, and support #or case-insensitive pattern

Page 105: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 105/123

  matching.

d. sh-RR egrep-stle e"tended pattern matching 8IZ;Y9patlist// has been  implemented, controlled b a new 7shopt$ option, 7e"tglob$.

e. There is a new sh-lie 788$ compound command, which implements  e"tended 7test$ #unctionalit.

#. There is a new 7print#$ builtin, implemented according to the !O(0D.2  speci#ication.

g. There is a new #eature #or command substitutionL #ilename/ now e"pands  to the contents o# 7#ilename$, with an trailing newlines removed  e+uivalent to cat #ilename//.

h. There are new tilde pre#i"es which e"pand to directories #rom the  director stac.

i. There is a new 7$ arithmetic operator to do e"ponentiation.

:. There are new con#iguration options to control how bash is linedL

  7--enable-pro#iling$, to allow bash to be pro#iled with gpro#, and  7--enable-static-lin$, to allow bash to be lined staticall.

. There is a new con#iguration option, 7--enable-cond-command$, which  controls whether or not the 788$ command is included. 0t is on b  de#ault.

l. There is a new con#iguration option, 7--enable-e"tended-glob$, which  controls whether or not the sh e"tended globbing #eature is included.  0t is enabled b de#ault.

m. There is a new con#iguration Pde#ine in con#ig.h.top that, when enabled,  will cause all login shells to source >etc>pro#ile and one o# the user-

  speci#ic login shell startup #iles, whether or not the shell is  interactive.

n. There is a new invocation option, 7--dump-po-strings$, to dump  a shell script$s translatable strings K...K/ in = 7po$ #ormat.

o. There is a new 7shopt$ option, 7nocaseglob$, to enable case-insensitive  pattern matching when globbing #ilenames and using the 7case$ construct.

p. There is a new 7shopt$ option, 7hupone"it$, which, when enabled, causes  the shell to send (0'=! to all :obs when an interactive login shell  e"its.

+. 7bind$ has a new 7-u$ option, which taes a readline #unction name as an  argument and unbinds all e se+uences bound to that #unction in a  speci#ied emap.

r. 7disown$ now has 7-a$ and 7-r$ options, to limit operation to all :obs  and running :obs, respectivel.

s. The 7shopt$ 7-p$ option now causes output to be displaed in a reusable  #ormat.

t. 7test$ has a new 7-$ option, which returns true i# the #ilename argument  has been modi#ied since it was last accessed.

u. 7umas$ now has a 7-p$ option to print output in a reusable #ormat.

v. 5 new escape se+uence, 7V"$, has been added to the 7echo -e$ and $...$  translation code. 0t e"pands to the character whose ascii code is

Page 106: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 106/123

  in he"adecimal.

w. The prompt string e"pansion code has a new 7Vr$ escape se+uence.

". The shell ma now be cross-compiled #or the C[032 environment on  a =ni" machine.

4. ew %eatures in 6eadline

a. There is now an option #or 7iterative$ an-last-arg handline, so a user  can eep entering 7-.$, aning the last argument o# successive histor  lines.

b. ew variable, 7print-completions-horiJontall$, which causes completion  matches to be displaed across the screen lie 7ls -"$/ rather than up  and down the screen lie 7ls$/.

c. ew variable, 7completion-ignore-case$, which causes #ilename completion  and matching to be per#ormed case-insensitivel.

d. There is a new bindable command, 7magic-space$, which causes histor

  e"pansion to be per#ormed on the current readline bu##er and a space to  be inserted into the result.

e. There is a new bindable command, 7menu-complete$, which enables tcsh-lie  menu completion successive e"ecutions o# menu-complete insert a single  completion match, ccling through the list o# possible completions/.

#. There is a new bindable command, 7paste-#rom-clipboard$, #or use on in32  sstems, to insert the te"t #rom the in32 clipboard into the editing  bu##er.

g. The e se+uence translation code now understands print#-stle bacslash  escape se+uences, including V octal escapes. These escape se+uences

  ma be used in e se+uence de#initions or macro values.

h. 5n 7include$ inputrc #ile parser directive has been added.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G1.1-release,and the previous version, bash-2.G1-release.

1. Changes to Bash

a. The select command was #i"ed to chec the validit o# the user$s  input more strenuousl.

b. 5 bug was #i"ed that prevented 7time$ #rom timing commands correctl  when supplied as an argument to 7bash -c$.

c. 5 #i" was made to the mail checing code to eep #rom adding the same  mail #ile to the list o# #iles to chec multiple times when parsing  50&!5T'.

d. %i"ed an o##-b-one error in the tilde e"pansion librar.

e. hen using the compound arra assignment snta", the old value o#  the arra is cleared be#ore assigning the new value.

#. %i"ed a bug that could cause a core dump when a trap handler was reset

  to the de#ault in the trap command associated with that signal.

g. %i"ed a bug in the locale code that occurred when assigning a value  to &CA5&&.

Page 107: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 107/123

h. 5 change was made to the parser so that words o# the #orm """?.../  are not considered compound assignment statements unless there are  characters be#ore the 7?$.

i. 5 #i" was made to the command tracing code to correctl +uote each  word o# output.

:. (ome changes were made to the bash-speci#ic autocon# tests to mae them  more portable.

. Completion o# words with globbing characters now correctl +uotes the  result.

l. The director >var>spool>mail is now pre#erred to >usr>spool>mail when  con#igure is deciding on the de#ault mail director.

m. The brace completion code was #i"ed to not +uote the 7M$ and 7N$.

n. (ome #i"es were made to mae 65O more random in subshells.

o. (stem-speci#ic changes were made to con#igure #orL (]64.2

p. Changes were made so that completion o# words containing globbing chars  substitutes the result onl i# a single #ilename was matched.

+. The window siJe is now recomputed a#ter a :ob is stopped with (0T(T! i#  the user has set 7checwinsiJe$ with 7shopt$.

r. hen doing substring e"pansion, out-o#-range substring speci#iers now  cause nothing to be substituted rather than an e"pansion error.

s. 5 #i" was made so that ou can no longer trap 7(0ED0T$ or 7(0EB=$ --  onl 7ED0T$ and 7EB=$ are accepted.

t. The displa o# trapped signals now uses the signal number i# signals  #or which bash does not now the name are trapped.

u. 5 #i" was made so that 7bash -r$ does not turn on restricted mode until  a#ter the startup #iles are e"ecuted.

v. 5 bug was #i"ed that occasionall caused a core dump when a variable  #ound in the temporar environment o# e"port>declare>readonl had a  null value.

w. 5 bug that occasionall caused unallocated memor to be passed to #ree/  when doing arithmetic substitution was #i"ed.

". 5 bug that caused a bu##er overrun when e"panding a prompt string  containing 7Vw$ and MP!N e"ceeded !5T'A5D was #i"ed.

. 5 problem with the completion code that occasionall caused it to  re#er to a character be#ore the beginning o# the readline line bu##er  was #i"ed.

J. 5 bug was #i"ed so that the 7read$ builtin restarts reads when  interrupted b signals other than (00T.

aa. %i"ed a bug that caused a command to be #reed twice when there was  an evaluation error in the 7eval$ command.

2. Changes to 6eadline

a. 5dded a missing 7e"tern$ to a declaration in readline.h that ept

Page 108: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 108/123

  readline #rom compiling cleanl on some sstems.

b. The histor #ile is now opened with mode G\GG when it is written #or  better securit.

c. Changes were made to the (00C' handling code so that prompt redispla  is done better.

d. now interrupts incremental searches correctl.

e. 5 bug that caused a core dump when the set o# characters to be +uoted  when completing words was empt was #i"ed.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G1-release,and the previous version, bash-2.G1-beta2.

1. Changes to Bash

a. The 7distclean$ target should remove the 7printenv$ e"ecutable i# it  has been created.

b. The test suite was changed slightl to ensure that the error messages  are printed in English.

c. 5 bug that caused the shell to dump core when a #ilename containing a  7>$ was passed to 7hash$ was #i"ed.

d. !athname canonicaliJation now leaves a leading 7>>$ intact, as !O(0D.1  re+uires.

e. 5 memor lea when completing commands was #i"ed.

#. 5 memor lea that occurred when checing the hash table #or commands

  with relative paths was #i"ed.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G1-beta2,and the previous version, bash-2.G1-beta1.

1. Changes to Bash

a. The 7ulimit$ builtin translates 6&0A0%00T[ to the hard limit onl i#  the current so#t/ limit is less than or e+ual to the hard limit.

b. %i"ed a bug that caused the bash emulation o# strcasecmp to produce  incorrect results.

c. 5 bug that caused memor to be #reed twice when a trap handler resets  the trap more than once was #i"ed.

d. 5 bug that caused machines where siJeo# pointer/ F siJeo# int/ to  #ail and possibl dump core/ when tring to unwind-protect a null  pointer was #i"ed.

e. The startup #iles should not be run with :ob control enabled. This #i"  allows (00T to once again interrupt startup #ile e"ecution.

#. Bash should not change the (0!6O% handler i# it is set to something  other than (0A%&.

g. The completion code that provides bash-speci#ic completions #or readline  now +uotes characters that the readline code would treat as word brea  characters i# the appear in a #ile name.

Page 109: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 109/123

h. The completion code now correctl +uotes #ilenames containing a 7Y$,  even i# the user attempted to use double +uotes when attempting  completion.

i. 5 bug that caused the shell to dump core when 7disown$ was called without  arguments and there was no current :ob was #i"ed.

:. 5 construct lie #oo/Xbar/ is now processed as a command substitution  rather than as a bad arithmetic substitution.

. 5 couple o# bugs that caused 7#c$ to not obe the 7cmdhist$ and 7lithist$  shell options when editing and re-e"ecuting a series o# commands were  #i"ed.

l. 5 #i" was made to the grammar -- the list o# commands between 7do$ and  7done$ in the bod o# a 7#or$ command should be treated the same as a  while loop.

2. Changes to 6eadline

a. 5 couple o# bugs that caused the histor search #unctions to attempt to  #ree a =&& pointer were #i"ed.

b. 0# the C librar provides setlocale3/, readline does not need to loo  at various environment variables to decide whether or not to go into  eight-bit mode automaticall -- :ust chec whether the current locale  is not 7C$ or 7!O(0D$.

c. 0# the #ilename completion #unction #inds that a director was not closed  b a previous interrupted/ completion, it closes the director with  closedir/.

3. ew %eatures in Bash

a. ew bindable readline commandsL histor-and-alias-e"pand-line and  alias-e"pand-line. The code was alwas in there, there was :ust no  wa to e"ecute it.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G1-beta1,and the previous version, bash-2.G1-alpha1.

1. Changes to Bash

a. %i"ed a problem that could cause #ile descriptors used #or process  substitution to con#lict with those used e"plicitl in redirections.

b. ade it easier to regenerate con#igure i# the user changes con#igure.in.

c. M6O=!(8G9N should alwas be the primar group, even on sstems without  multiple groups.

d. (pelling correction is no longer enabled b de#ault.

e. %i"es to +uoting problems in 7bashbug$.

#. O(-speci#ic con#iguration changes were made #orL 0ri" \.

g. O(-speci#ic code changes were made #orL <D.

h. 5 more meaning#ul message is now printed when the #ile in >tmp #or a  here document cannot be created.

Page 110: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 110/123

i. an changes to the shell$s variable initialiJation code to speed  non-interactive startup.

:. Changes to the non-:ob-control code so that it does not tr to open  >dev>tt.

. The output o# 7set$ and 7e"port$ is once again sorted, as !O(0D wants.

l. %i"ed a problem caused b a recursive call reparsing the value o#  ('E&&O!T(.

m. The tilde code no longer calls getenv/ when it$s compiled as part o#  the shell, which should eliminate problems on sstems that cannot  rede#ine getenv/, lie the eDT O(.

n. %i"ed a problem that caused 7bash -o$ or 7bash Zo$ to not list all  the shell options.

o. %i"ed 7ulimit$ to convert 6&0A0%00T[ to the appropriate hard limit  onl i# the hard limit is greater than the current so#t/ limit.

p. %i"ed a problem that arose when building bash in a di##erent director  than the source and .tab.8ch9 were remade with something other than  bison. This came up most o#ten on etB(.

+. %i"ed a problem with completion -- it thought that 7pwd7>8T5B9 indicated  an un#inished command completion 7>/, which generated errors.

r. The bash special tilde e"pansions @-, @Z/ are now attempted be#ore  calling the standard tilde e"pansion code, which should eliminate the  problems people have been seeing with this on (olaris 2.^.1.

s. 5dded support #or stdarg.hF to places where it was missing.

t. Changed the code that reads the output o# a command substitution to not  go through stdio. This reduces the memor re+uirements and is #aster.

u. 5 number o# changes to speed up e"port environment creation were made.

v. 5 number o# memor leas were #i"ed as the result o# running the test  scripts through !uri#.

w. %i"ed a bug that caused subshells #ored to interpret e"ecutable  scripts without a leading 7PY$ to not reinitialiJe the values o#  the shell options.

2. Changes to 6eadline

a. 'istor librar has less 7Pi#de# ('E&&$ code -- abstracted stu## out  into application-speci#ic #unction hoos.

b. 6eadline no longer calls getenv/ i# it$s compiled as part o# the shell,  which should eliminate problems on sstems that cannot rede#ine getenv/,  lie the eDT O(.

c. %i"ed translation o# E(C when 7untranslating$ macro values.

d. The region ill operation now #i"es the mar i# it ends up beond the  boundaries o# the line a#ter the region is deleted.

3. ew %eatures in Bash

a. ew argument #or 7con#igure$L 7--with-curses$. This can be used to  override the selection o# the termcap librar on sstems where it is

Page 111: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 111/123

  de#icient.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G1-alpha1,and the previous version, bash-2.G-release.

1. Changes to Bash

a. (stem-speci#ic con#iguration changes #orL %reeB(, (unO(4, 0ri",  achTen, <D 4.2, 'arris ight 'aw, (unO(^.

b. (stem-speci#ic code changes were made #orL &inu", 4.4 B(, <D 4.2,  '!-=D, 50D 4.2.

c. 5 bug that caused the e"ec builtin to #ail because the #ull pathname o#  the command could not be #ound was #i"ed.

d. The code that per#orms output redirections is now more resistant to  race conditions and possible securit e"ploits.

e. 5 bug that caused the shell to dump core when per#orming pattern

  substitutions on variable values was #i"ed.

#. ore hosts are now recogniJed b the auto-con#iguration mechanism  OpenB(, <D, others/.

g. 5ssignments to read-onl variables that attempt to convert them to  arras are now errors.

h. 5 bug that caused shell scripts using arra assignments in !O(0D mode  to e"it a#ter the assignment was per#ormed was #i"ed.

i. The substring e"pansion code is now more care#ul about running o## the  ends o# the e"panded variable value.

:. 5 bug that caused completion to #ail i# a bac+uoted command substitution  appeared anwhere on the line was #i"ed.

. The 7source$ builtin no longer turns o## histor i# it has been enabled  in a non-interactive shell.

l. 5 bug that caused the shell to crash when 7disown$ was given a pid  instead o# a :ob number was #i"ed.

m. The 7cd$ spelling correction code will not tr to change to 7.$ i# no  director entries match a single-character argument.

n. 5 bad variable name supplied to 7declare$, 7e"port$, or 7readonl$ no  longer causes a non-interactive shell in !O(0D mode to e"it.

o. (ome #i"es were made to the test suite to handle peculiarities o#  various =ni" versions.

p. The bash completion code now +uotes characters that readline would  treat as word breas #or completion but are not shell metacharacters.

+. Bad options supplied at invocation now cause a usage message to be  displaed.

r. %i"es were made to the code that handles EB= traps so that the trap

  string is not #reed inappropriatel.

s. (ome changes were made to the bash debugger in e"amples>bashdb -- it  should be closer to woring now.

Page 112: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 112/123

t. 5 problem that caused the de#ault #ilename used #or mail checing to be  wrong was #i"ed.

u. 5 #i" was made to the 7echo$ builtin so that =& characters printed with  7echo -e$ do not cause the output to be truncated.

v. 5 #i" was made to the :ob control code so that the shell behaves better  when monitor mode is enabled in a non-interactive shell.

w. Bash no longer catches all o# the terminating signals in a non-  interactive shell until a trap is set on ED0T, which should result in  +uicer startup.

". 5 #i" was made to the command timing code so that 7time$ can be used in  a loop.

. 5 #i" was made to the parser so that 7cmd/X cmd2/$ is now parsed as  a nested subshell rather than strictl as an erroneous/ arithmetic  command.

J. 5 #i" was made to the globbing code so that it correctl matches +uoted  #ilenames beginning with a 7.$.

aa. 5 bug in 7#c$ that caused some multi-line commands to not be stored as  one command in the histor when the were re-e"ecuted a#ter editing  with 7#c -e$/ was #i"ed.

bb. The 7ulimit$ builtin now attempts to catch some classes o# integer  over#lows.

cc. The command-oriented-histor code no longer attempts to add 7X$  inappropriatel when a newline appears while reading a .../ command  substitution.

dd. 5 bug that caused the shell to dump core when 7help --$ was e"ecuted  was #i"ed.

ee. 5 bug that caused the shell to crash when an unset variable appeared  in the bod o# a here document a#ter 7set -u$ had been e"ecuted was  #i"ed.

##. 0mplicit input redirections #rom >dev>null #or asnchronous commands  are now handled better.

gg. 5 bug that caused the shell to #ail to compile when con#igured with  7--disable-readline$ was #i"ed.

hh. The globbing code should now be interruptible.

ii. Bash now notices when the 7ill$ builtin is used to send (0COT to a  stopped :ob and ad:usts the data structures accordingl, as i# 7bg$ had  been e"ecuted instead.

::. 5 bug that caused the shell to crash when mi"ing calls to 7getopts$  and 7shi#t$ on the same set o# positional parameters was #i"ed.

. The command printing code now preserves the 7-p$ #lag to 7time$.

ll. The command printing code now handles here documents better when there

  are other redirections associated with the command.

mm. The special glibc environment variable A=AnonoptionAargvA#lagsA/  is no longer placed into the environment o# e"ecuted commands -- users

Page 113: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 113/123

  o# glibc had too man problems with it.

nn. 6eorganiJed the code that generates signames.h. The signalAnames list  is now more complete but ma be slightl di##erent (05B6T is #avored  over (00OT, #or e"ample/. The pre#erred signal names are those  listed in the !O(0D.2 standard.

oo. 7bashbug$ now uses a #ilename shorter than 14 characters #or its  temporar #ile, and ass #or con#irmation be#ore sending the bug  report.

pp. 5 bug that caused T5B completion in vi editing mode to not be turned  o## when 7set -o posi"$ was e"ecuted or bac on when 7set Zo posi"$  was e"ecuted was #i"ed.

++. 5 bug in the brace e"pansion code that caused brace e"pansions appearing  in new-stle .../ command substitutions to be inappropriatel e"panded  was #i"ed.

rr. 5 bug in the readline hoo shell-e"pand-line that could cause memor to  be inappropriatel #reed was #i"ed.

ss. 5 bug that caused some arithmetic e"pressions containing 7))$ and 7**$  to be parsed with the wrong precedence has been #i"ed.

tt. 6e#erences to unbound variables a#ter 7set -u$ has been e"ecuted now  cause the shell to e"it immediatel, as the should.

uu. 5 bug that caused the shell to e"it inappropriatel when 7set -e$ had  been e"ecuted and a command$s return status was being inverted with the  7Y$ reserved word was #i"ed.

vv. 5 bug that could occasionall cause the shell to crash with a  divide-b-Jero error when timing a command was #i"ed.

ww. 5 bug that caused parameter pattern substitution to leave stra  bacslashes in the replacement string when the e"pression is in  double +uotes was #i"ed.

"". The 7brea$ and 7continue$ builtins now brea out o# all loops when an  invalid count argument is supplied.

. %i"ed a bug that caused !5T' to be set to the empt string i#  7command -p$ is e"ecuted with !5T' unset.

JJ. %i"ed 7ill -l signum$ to print the signal name without the 7(0$ pre#i",  as !O(0D speci#ies.

aaa. %i"ed a bug that caused the shell to crash while setting ('E&&O!T(  i# there were no shell options set.

bbb. %i"ed 7e"port -p$ and 7readonl -p$ so that when the shell is in !O(0D  mode, their output is as !O(0D.2 speci#ies.

ccc. %i"ed a bug in 7readonl$ so that 7readonl -a avar?.../$ actuall  creates an arra variable.

ddd. %i"ed a bug that prevented 7time$ #rom correctl timing bacground  pipelines.

2. Changes to 6eadline

a. 5 bug that caused an e"tra newline to be printed when the cursor was on  an otherwise empt line was #i"ed.

Page 114: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 114/123

b. 5n instance o# memor being used a#ter it was #reed was corrected.

c. The redispla code now wors when the prompt is longer than the screen  width.

d. 7dump-macros$ is now a bindable name, as it should have been all along.

e. on-printable characters are now e"panded when displaing macros and  their values.

#. The 7dump-variables$ and 7dump-macros$ commands now output a leading  newline i# the$re called as the result o# a e se+uence, rather  than directl b an application.

3. ew %eatures in Bash

a. There is a new builtin arra variableL 6O=!(, the set o# groups to which  the user belongs. This is used b the test suite.

4. ew %eatures in 6eadline

a. 0# a e se+uence bound to 7universal-argument$ is read while reading a  numeric argument started with 7universal-argument$, it terminates the  argument but is otherwise ignored. This provides a wa to insert multiple  instances o# a digit string, and is how = emacs does it.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G-release,and the previous version, bash-2.G-beta3.

1. Changes to Bash

a. %i" to the 7getopts$ builtin so that it does the right thing when a

  re+uired option argument is not present.

b. The completion code now updates the common pre#i" o# matched names  a#ter %0O6E processing is done, since an names that were removed  ma have changed the common pre#i".

c. %i"ed a bug that made messages in 50&!5T' entries not wor correctl.

d. %i"ed a serious documentation error in the description o# the new  MparameterLo##set8Llength9N e"pansion.

e. %i"es to mae parameter substring e"pansion MparamLo##set8Llength9N/  wor when within double +uotes.

#. %i"es to mae 5 CT&E(C/ survive an un+uoted e"pansion o# positional  parameters.

g. Corrected a misspelling o# 7unlimited$ in the output o# 7ulimit$.

h. %i"ed a bug that caused e"ecutable scripts without a leading 7PY$ to  occasionall pic up the wrong set o# positional parameters.

i. &inu" sstems now have a woring 7ulimit -v$, using 6&00TA5(.

:. =pdated con#ig.guess so that man more machine tpes are recogniJed.

. %i"ed a bug with bacslash-+uoted slashes in the Mparam>pat8>sub9N  e"pansion.

l. 0# the shell is named 7-su$, and 7-c command$ is supplied, read and

Page 115: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 115/123

  e"ecute the login shell startup #iles even though the shell is not  interactive. This is to support the 7-$ option to 7su$.

m. %i"ed a bug that caused core dumps when the EB= trap was ignored  with 7trap KK EB=$ and a shell #unction was subse+uentl e"ecuted.

n. %i"ed a bug that caused core dumps in the read builtin when 0%( was  set to the null string and the input had leading whitespace.

2. Changes to 6eadline

a. %i"ed a bug that caused a numeric argument o# 1G24 to be ignored when  inserting te"t.

b. %i"ed the displa code so that the numeric argument is displaed as it$s  being entered.

c. %i"ed the numeric argument reading code so that 7-- command$ is  e+uivalent to 7--1 command$, as the prompt implies.

3. ew %eatures in Bash

a. 7ulimit$ now sets both hard and so#t limits and reports the so#t limit  b de#ault when neither -' nor -( is speci#ied/. This is compatible  with versions o# sh and sh that implement 7ulimit$.

b. 0nteger constants have been e"tended to base \4.

4. ew %eatures in 6eadline

a. The 7home$ and 7end$ es are now bound to beginning-o#-line and  end-o#-line, respectivel, i# the corresponding termcap capabilities  are present.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G-beta3,and the previous version, bash-2.G-beta2.

1. Changes to Bash

a. (stem-speci#ic changes #orL 50D 4.2, (CO 3.2v84^9, '!-=D.

b. hen in !O(0D mode, variable assignments preceding a special builtin  persist in the shell environment a#ter the builtin completes.

c. Changed all calls to getwd/ to getcwd/. 0mproved chec #or sstems  where the libc getcwd/ calls popen/, since that breas on some

  sstems when :ob control is being used.

d. %i"ed a bug that caused seg #aults when e"ecuting scripts with the  e"ecute bit set but without a leading 7PY$.

e. The environment passed to e"ecuted commands is never sorted.

#. 5 bug was #i"ed in the code that e"pands Mname8I9N to the number o#  elements in an arra variable.

g. 5 bug was #i"ed in the arra compound assignment code 5? ... / /.

h. indow siJe changes now correctl propagate down to readline i#

  the shopt 7checwinsiJe$ option is enabled.

i. 5 #i" was made in the code that e"pands to the length o# a variable  value MPvarN/.

Page 116: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 116/123

:. 5 #i" was made to the command builtin so that it did not turn on the  7no #or$ #lag inappropriatel.

. 5 #i" was made to mae 7set -n$ wor more reliabl.

l. 5 #i" was made to the :ob control initialiJation code so that the  terminal process group is set to the shell$s process group i# the  shell changes its own process group.

2. Changes to 6eadline

a. (stem-speci#ic changes #orL (CO 3.2v84^9.

b. The behavior o# the vi-mode 7.$ when redoing an 7i$ command was changed  to insert the te"t previousl inserted b the 7i$ command rather than  simpl entering insert mode.

3. ew #eatures in Bash

a. There is a new version o# the autoload #unction pacage, in

  e"amples>#unctions>autoload.v2, that uses arras and provides more  #unctionalit.

b. (upport #or &CACO&&5TE and locale-speci#ic sorting o# the results o#  pathname e"pansion i# strcoll/ is available.

4. ew %eatures in 6eadline

a. (upport #or locale-speci#ic sorting o# completion possibilities i#  strcoll/ is available.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G-beta2,

and the previous version, bash-2.G-beta1.

1. Changes to Bash

a. 7pushd -$ is once again e+uivalent to 7pushd O&!$.

b. O(-speci#ic changes #orL (CO 3.2v84^9.

c. 5 change was made to the #i" #or the recentl-reported securit hole  when reading characters with octal value 2^^ to mae it wor better on  sstems with restartable sstem calls when not using readline.

d. (ome changes were made to the test suite so that it wors i# ou

  con#igure bash with --enable-usg-echo-de#ault.

e. 5 #i" was made to the parsing o# conditional arithmetic e"pressions.

#. 0llegal arithmetic bases now cause an arithmetic evaluation error rather  than being silentl reset.

g. ultiple arithmetic bases now cause an arithmetic evaluation error  instead o# being ignored.

h. 5 #i" was made to the evaluation o# Mparam;wordN to con#orm to !O(0D.2.

i. 5 bug that sometimes caused arra indices to be evaluated twice which

  would cause errors when the contained assignment statements/ was #i"ed.

:. 7ulimit$ was rewritten to avoid problems with getrlimit2/ returning  unsigned values and to simpli# the code.

Page 117: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 117/123

. 5 bug in the command-oriented-histor code that caused it to sometimes  put semicolons a#ter right parens inappropriatel was #i"ed.

l. The values inserted into the prompt b the Vw and V escape se+uences  are now +uoted to prevent #urther e"pansion.

m. 5n interactive shell invoed as 7sh$ now reads and e"ecutes commands  #rom the #ile named b E] when it starts up. 0# it$s a login shell,  it does this a#ter reading >etc>pro#ile and @>.pro#ile.

n. The #ile named b E] is never read b non-interactive shells.

2. Changes to 6eadline

a. 5 #ew changes were made to hide some macros and #unctions that should not  be public.

b. 5n o##-b-one error that caused seg #aults in the histor e"pansion code  was #i"ed.

3. ew %eatures in Bash

a. The sh-stle ...// arithmetic command was implemented. 0t is e"actl  identical to let K...K. This is controlled b a new option to con#igure,  7--enable-dparen-arithmetic$, which is on b de#ault.

b. There is a new Pde#ine available in con#ig.h.topL ([(AB5('A&OO=T. 0#  de#ined to a #ilename, bash reads and e"ecutes commands #rom that #ile  when a login shell e"its. 0t$s commented out b de#ault.

c. 7ulimit$ has a 7-l$ option that reports the ma"imum amount o# data that  ma be loced into memor on 4.4B(-based sstems.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G-beta1,and the previous version, bash-2.G-alpha4.

1. Changes to Bash

a. 5 bug that sometimes caused traps to be ignored on signals the  shell treats speciall was #i"ed.

b. The internationaliJation code was changed to trac the values o#  &CA variables and call setlocale/ as appropriate. The TEDTO50  and TEDTO5006 variables are also tracedX changes cause calls  to te"tdomain/ and bindte"tdomain/, i# available.

c. 5 bug was #i"ed that sometimes caused double-+uoted strings to be  parsed incorrectl.

d. Changes were made so that the siglist code compiles correctl on  (olaris 2.^.

e. 5dded 7L$ to the set o# characters that cause word breas #or the  completion code so that pathnames in assignments to !5T' can be  completed.

#. The 7select$ command was #i"ed to print !(3 to stderr.

g. %i"ed an error in the manual page section describing the e##ect that  setting and unsetting &OB0O6E has on the setting o# the 7dotglob$  option.

Page 118: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 118/123

h. The time conversion code now uses C&_ATC_ rather than C&OC_(A!E6A(EC  on sstems without gettimeo#da/ and resources.

i. The getopt static variables are now initialiJed each time a subshell  is started, so subshells using 7getopts$ wor right.

:. 5 sign-e"tension bug that caused a possible securit hole was #i"ed.

. The parser now reads characters between bac+uotes within a double-  +uoted string as a single word, so double +uotes in the bac+uoted  string don$t terminate the enclosing double-+uoted string.

l. 5 bug that caused 7O$ to wor incorrectl when tped as the #irst  thing to an interactive shell was #i"ed.

m. 5 rarel-e"ercised o##-b-one error in the code that +uotes variable  values was #i"ed.

n. (ome memor and #ile descriptor leas encountered when running a  shell script that is e"ecutable but does not have a leading 7PY$  were plugged.

2. Changes to 6eadline

a. 5 bug that sometimes caused incorrect results when tring to read  tpeahead on sstems without %0O6E5 was #i"ed.

3. ew %eatures in Bash

a. The command timing code now uses the value o# the T0E%O65T variable  to #ormat and displa timing statistics.

b. The 7time$ reserved word now accepts a 7-p$ option to #orce the  !O(0D.2 output #ormat.

c. There are a couple o# new and updated scripts to convert csh startup  #iles to bash #ormat.

d. There is a new builtin arra variableL B5('A]E6(0%O. The various  members hold the parts o# the version in#ormation in B5('A]E6(0O,  plus the value o# 5C'T[!E.

4. ew %eatures in 6eadline

a. (etting &5 to 7enA=(.0(ORR^H-1$ now causes readline to enter  eight-bit mode.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G-alpha4,and the previous version, bash-2.G-alpha3.

1. Changes to Bash

a. There is better detection o# rsh connections on (olaris 2.

b. 5ssignments to read-onl variables preceding a command name are now  variable assignment errors. ]ariable assignment errors cause  non-interactive shells running in posi" mode to e"it.

c. The word toeniJer was rewritten to handle nested +uotes and pairs

  $$, KK, 77, M...N, .../, 8...9, $...$, K...K, .../, F...//  correctl. (ome o# the parameter e"pansion code was updated as a  conse+uence.

Page 119: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 119/123

d. 5 #i" was made to 7test$ when given three arguments so that a binar  operator is checed #or #irst, be#ore checing that the #irst argument  is 7Y$.

e. 2$$F>dev>null is no longer e+uivalent to 2F>dev>null.

#. !arser error messages were regulariJed, and in most cases the name o#  the shell script being read b a non-interactive shell is not printed  twice.

g. 5 #i" was made to the completion code so that it no longer removes the  te"t the user tped in some cases.

h. The special glibc 7getopt$ environment variable is no longer put into  the environment on machines with small values o# 56A5D.

i. The e"pansion o# M...N now #ollows the !O(0D.2 rules #or #inding the  closing 7N$.

:. The shell no longer displas spurious status messages #or bacground  :obs in shell scripts that complete success#ull when the script is

  run #rom a terminal.

. 7shopt -o$ now correctl updates ('E&&O!T(.

l. 5 bug that caused the !5T' searching code to return a non-e"ecutable  #ile even when an e"ecutable #ile with the same name appeared later in  !5T' was #i"ed.

m. The shell now does tilde e"pansions on un+uoted 7L@$ in assignment  statements when not in posi" mode.

n. ]ariable assignment errors when a command consists onl o# assignments  now cause non-interactive shells to e"it when in posi" mode.

o. 0# the variable in a 7#or$ or 7select$ command is read-onl, or not a  legal shell identi#ier, a variable assignment error occurs.

p. 7test$ now handles 7-a$ and 7-o$ as binar operators when three arguments  are supplied, and correctl parses 7 word /$ as e+uivalent to 7word$.

+. 7test$ was #i"ed so that #ile names o# the #orm >dev>#d> mean the same  thing on all sstems, even &inu".

r. %i"ed a bug in the globbing code that caused patterns with multiple  consecutive 7$s to not be matched correctl.

s. %i"ed a bug that caused !(2 to not be printed when an interactive shell  not using readline is reading a here document.

t. %i"ed a bug that caused histor e"pansion to be per#ormed inappropriatel  when a single-+uoted string spanned more than one line.

u. 7getopts$ now checs that the variable name passed b the user as the  second argument is a legal shell identi#ier and that the variable is  not read-onl.

v. %i"ed 7getopts$ to obe !O(0D.2 rules #or setting O!T0 when it  encounters an error.

w. %i"ed 7set$ to displa variable values in a #orm that can be re-read.

". %i"ed a bug in the code that eeps trac o# whether or not local variables  have been declared at the current level o# #unction nesting.

Page 120: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 120/123

. on-interactive shells in posi" mode now e"it i# the name in a #unction  declaration is not a legal identi#ier.

J. The :ob control code now ignores stopped children when the shell is not  interactive.

aa. The 7cd$ builtin no longer attempts spelling correction on the director  name i# the shell is not interactive, regardless o# the setting o# the  7cdspell$ option.

bb. (ome O(-speci#ic changes were made #or (CO 3.2v84^9 and 50D 4.2.

cc. 7time$ now prints its output to stderr, as !O(0D.2 speci#ies.

2. %i"es to 6eadline

a. 5#ter printing possible completions, all lines o# a multi-line prompt  are redisplaed.

b. (ome changes were made to the terminal handling code in rltt.c to

  wor around 50D 4.2 bugs.

3. ew %eatures in Bash

a. There is a new loadable builtinL sprint#, with calling snta"sprint# var #ormat 8args9

  This provides an eas wa to simulate sh le#t- and right-:usti#ied  variable values.

b. The e"pansions o# Vh and V' in prompt strings were swapped. Vh now  e"pands to the hostname up to the #irst 7.$, as in bash-1.14.

4. ew %eatures in 6eadline

a. The bash-1.14 behavior when is tped while doing an incremental  search was restored. S ma now be used to terminate the search without  accepting the line.

b. There is a new bindable variableL disable-completion. This inhibits  word completion and causes the completion character to be inserted as  i# it had been bound to sel#-insert.

------------------------------------------------------------------------------This document details the changes between this version, bash-2.G-alpha3,and the previous version, bash-2.G-alpha2.

There is now a #ile 7CO!5T$ included in the distribution that lists theuser-visible incompatibilities between 1.14 and 2.G.

1. Changes to Bash

a. (ome wor was done so that word splitting o# the rhs o# assignment  statements con#orms more closel to historical practice.

b. 5 couple o# errant memor #rees were #i"ed.

c. 5 #i" was made to the test builtin so it recogniJes 7$ and 7F$ as  binar operators.

d. The = malloc in lib>malloc>malloc.c now scrambles memor as it$s  allocated and #reed. This is to catch callers that re#er to #reed  memor or assume something about newl-allocated memor.

Page 121: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 121/123

e. %i"ed a problem with conversion to 12-hour time in the prompt  e"pansion code.

#. %i"ed a problem with con#igure$s argument parsing order. ow ou can  correctl turn on speci#ic options a#ter using --enable-minimal-con#ig.

g. The con#igure script now automaticall disables the use o# = malloc  on sstems where it$s appropriate better than having people read the  OTE( #ile and do it manuall/.

h. There are new prompt e"pansions Vv and V]/ to insert version in#ormation  into the prompt strings.

i. The de#ault prompt string now includes the version number.

:. ost o# the builtins that tae no options were changed to use the  internal getopt so the can produce proper error messages #or -;  and incorrect options.

. (ome sstem-speci#ic changes were made #or (]64.2 and (olaris 2.^.

l. Bash now uses !5T'A5D instead o# 5D!5T'&E and 5EA5D instead o#  5D5&E.

m. 5 couple o# problems caused b uninitialiJed variables were #i"ed.

n. There are a number o# new loadable builtin e"amplesL logname, basename,  dirname, tt, pathch, tee, head, and rmdir. 5ll o# these con#orm to  !O(0D.2.

o. Bash now notices changes in TQ and calls tJset/ i# present, so  changing TQ will alter the time printed b prompt e"pansions.

p. The source was reorganiJed a bit so 0 don$t have to wait so long #or

  some #iles to compile, and to #acilitate the creation o# a 7shell  librar$ at some #uture point.

+. Bash no longer turns o## :ob control i# called as 7sh$, since the  !O(0D.2 spec includes :ob control as a standard #eature.

r. 7bash -o posi"$ now wors as intended.

s. %i"ed a problem with the completion codeL when completing a #ilename  that contained globbing characters, i# show-all-i#-ambiguous was set,  the completion code would remove the user$s te"t.

t. %i"ed ulimit so that hope#ull/ the #ull range o# limits is available

  on '!=D sstems.

u. 5 new 7shopt$ option 7hostcomplete$/ enables and disables hostname  completion.

v. The shell no longer attempts to save the histor on an abort/,  which is usuall called b programmingAerror/.

w. The 7-s$ option to 7#c$ was changed to echo the command to be e"ecuted  to stderr instead o# stdout.

". 0# the editor invoed b 7#c -e$ e"its with a non-Jero status, no  commands are e"ecuted.

. %i"ed a bug that made the shopt 7histveri#$ option wor incorrectl.

J. There is a new variable 75C'T[!E$ whose value is the =-stle

Page 122: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 122/123

  7cpu-compan-sstem$ sstem description as set b con#igure. The  values o# 5C'T[!E and 'O(TT[!E should reall be swapped./

aa. The 7ulimit$ builtin now allows the ma"imum virtual memor siJe to be  set via setrlimit2/ i# 6&00TA]E is de#ined.

bb. 7bash -nc $command$$ no longer runs 7command$.

2. Changes to 6eadline

a. %i"ed a tpo in the code that checed #or %0O6E5 in input.c.

b. %i"ed a bug in the code that outputs ebindings, so things lie C-V  are +uoted properl.

c. %i"ed a bug in the inputrc #ile parsing code to handle the problems  caused b inputrc #iles created #rom the output o# 7bind -p$ in  previous versions o# bash. The problem was due to the bug #i"ed  in item b above.

d. 6eadline no longer turns o## the terminal$s meta e, and turns it on

  once the #irst time it$s called.

------------------------------------------------------------------------------This #ile documents the changes between this version, bash-2.G-alpha2,and the previous version, bash-2.G-alpha.

1. Changes to Bash

a. The shell no longer thins directories are e"ecutable.

b. 7disown$ has a new option, 7h$, which inhibits the resending o# (0'=!  but does not remove the :ob #rom the :obs table.

c. The varargs #unctions in error.c now use 5(0-C 7stdarg$ i# available.

d. The build process now treats the 7build version$ in .build as local to  the build director, so di##erent versions built #rom the same source  tree have di##erent 7build versions$.

e. (ome problems with the grammar have been #i"ed. 0t used 7list$ in a #ew  productions where 7compoundAlist$ was needed. 5 7list$ must be terminated  with a newline or semicolonX a 7compoundAlist$ need not be./

#. 5 #i" was made to eep 7wait$ #rom hanging when waiting #or all bacground  :obs.

g. 7bash --help$ now writes its output to stdout, lie the = Coding (tandards  speci#, and includes the machine tpe the value o# 5C'T[!E/.

h. 7bash --version$ now prints more in#ormation and e"its success#ull, lie  the = Coding (tandards speci#.

i. The output o# 7time$ and 7times$ now prints #ractional seconds with three  places a#ter the decimal point.

:. 5 bug that caused process substitutions to screw up the pipeline printed  b 7:obs$ was #i"ed.

. %i"es were made to the code that implements $...$ and K...K so the

  wor as documented.

l. The process substitution code now opens named pipes #or reading with  OAOB&OC_ to avoid hanging.

Page 123: Changes in Bash Version 4.2 to Bash 4.3

7/23/2019 Changes in Bash Version 4.2 to Bash 4.3

http://slidepdf.com/reader/full/changes-in-bash-version-42-to-bash-43 123/123

m. %i"es were made to the trap code so the shell cleans up correctl i# the  trap command contains a 7return$ and we$re e"ecuting a #unction or  sourcing a script with 7.$.

n. %i"es to doc>ae#ile.in so that it doesn$t tr to remae all o# the  documentation ps, dvi, etc./ on a 7mae install$.

o. %i"ed an auto-increment error that caused bash -c args to sometimes dump  core.

p. %i"ed a bug that caused '0(T0O6E to #ail when the histor line  contained globbing characters.

2. Changes to 6eadline

a. There is a new string variable, rlAlibrarAversion, available #or use b  applications. The current value is K2.1K.

b. 5 bug encountered when e"pand-tilde was enabled and #ile completion was  attempted on a word beginning with 7@>$ was #i"ed.

c. 5 slight change was made to the incremental search termination behavior.  E(C still terminates the search, but i# input is pending or arrives  within G.1 seconds on sstems with select2//, it is used as a pre#i"  character. This is intented to allow users to terminate searches with  the arrow es and get the behavior the e"pect.