On 9/16/16 3:06 PM, Eric Pruitt wrote: > 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.
This was a bug in bash-4.3. * will match 0 or more characters, so if $var is null or unset, * should match it. This entry in the CHANGES file covers it: llll. Fixed a bug that would not replace empty strings using pattern substitution even if the pattern matched the empty string. According to the change log, it looks like I made this change back in May, 2015. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/