"$@" eats adjacent quoted nulls when expanding to quoted null
From:
Grisha Levit
Subject:
"$@" eats adjacent quoted nulls when expanding to quoted null
Date:
Thu, 30 Mar 2017 03:19:39 -0400
(This is very similar to a fixed issue[1] from 4.4-beta)
A quoted null string will fail to generate a field when it is adjacent
to a double-quoted expansion of $@ which itself expands to a null string:
$ set --; printf '<%s>' foo ''"$@"
<foo><> # correct
$ set -- ''; printf '<%s>' foo ''"$@"
<foo>
Note that this happens also if the expansion-to-single-null-string is due to
pattern substitution:
$ set -- X; printf '<%s>' foo ''"${@/*}"
<foo>
But not so with substring removal:
$ set -- X; printf '<%s>' foo ''"${@#X}"
<foo><>
[1] https://lists.gnu.org/archive/html/bug-bash/2016-05/msg00059.html
[Prev in Thread]
Current Thread
[Next in Thread]
"$@" eats adjacent quoted nulls when expanding to quoted null,
Grisha Levit<=