Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2 -Wno-parentheses -Wno-format-security uname output: Linux sinister 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux Machine Type: x86_64-unknown-linux-gnu
Bash Version: 4.4 Patch Level: 0 Release Status: release Description: In Bash 4.3, "${var/*/text}" would generate "" if var was a zero-length string and "text" if it contained at least one character. In Bash 4.4, this is no longer the case. I'm not sure if this is necessarily a bug, but I was unable to find this change in behavior in the change log or man page. Repeat-By: Bash 4.3: ericpruitt@sinister:~$ echo ${VAR/*/VAR was not empty} VAR was not empty ericpruitt@sinister:~$ VAR= ericpruitt@sinister:~$ echo ${VAR/*/VAR was not empty} ericpruitt@sinister:~$ Bash 4.4: ericpruitt@sinister:~$ VAR=NotEmpty ericpruitt@sinister:~$ echo ${VAR/*/VAR was not empty} VAR was not empty ericpruitt@sinister:~$ VAR= ericpruitt@sinister:~$ echo ${VAR/*/VAR was not empty} VAR was not empty ericpruitt@sinister:~$ Fix: As a work-around, I have changed the expressions I'm using from ${VAR/*/...} to ${VAR/?*/...}. Since it is not clear to me if this is actually a bug, I'm not sure what that fix should be. Maybe there should be a new "compat..." option.