Hi,

This report stems from the discussion at 
https://lists.gnu.org/archive/html/help-bash/2024-02/msg00085.html.

Consider the following two cases.

$ ( set a -- b; f=+ IFS=$f; [[ $f$*$f == *"$f--$f"* ]]; echo $? )
0

$ ( set a -- b; f=$'\1' IFS=$f; [[ $f$*$f == *"$f--$f"* ]]; echo $? )
1

It does not make sense that that the exit status value differs between these 
cases, especially since SOH is not a whitespace character (in the sense of 
field splitting). I think that the second case should also yield 0. Regardless 
of what the intended behaviour is, I would also expect for the manual to 
describe it.

Note that quoting the left-hand side fixes it for SOH. In the absence of 
quotes, xtrace output suggests that all of the SOH characters are stripped from 
the expansion of $f$*$f.

$ ( set a -- b; f=$'\1' IFS=$f; [[ "$f$*$f" == *"$f--$f"* ]]; echo $? )
0

-- 
Kerin Millar

Reply via email to