On 8/6/19 2:18 PM, Mohamed Akram wrote: > Bash version: GNU bash, version 5.0.7(1)-release (x86_64-apple-darwin18.5.0) > > Example: > > shopt -s nullglob > a='\x30' > echo $a > > Expected output: > > \x30 > > Actual output:
Yes. Bash-5.0 changed so that backslashes in patterns are special characters. This is what POSIX requires. There's more of an explanation here: https://lists.gnu.org/archive/html/bug-bash/2019-02/msg00151.html So if patterns containing backslashes are patterns to be expanded (e.g., if the pattern is \x30 and there is a file named `x30' in the current directory, the pattern should expand to `x30'), a failed pattern expansion should be subject to the nullglob setting. There is currently a ferocious -- well, it's mostly died down, but still going on -- discussion on the POSIX mailing list about what POSIX *should* say, but the current bash behavior is more-or-less -- POSIX doesn't have a `nullglob' option -- what the POSIX shell group says should happen. I assume there will be an interpretation for http://austingroupbugs.net/view.php?id=1234 and I'll change bash to align with it. 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://tiswww.cwru.edu/~chet/