See the following for the difference. I'd consider the behavior of 4.4.23 should be correct.
How was this bug introduced? Should there be a test case to cover this case? $ cat main_debug.sh #!/usr/bin/env bash # vim: set noexpandtab tabstop=2: echo $BASH_VERSION declare -- null="@()" declare -- dir="." shopt -s extglob set +f matched_paths=(./$null"$dir"/main_debug.sh) declare -p matched_paths $ ./main_debug.sh 4.4.23(1)-release declare -a matched_paths=([0]="././main_debug.sh") $ ./main_debug.sh 5.0.0(1)-release declare -a matched_paths=([0]="./@()./main_debug.sh") -- Regards, Peng