bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"$@" 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 ''"address@hidden"
   <foo><>

  [1] https://lists.gnu.org/archive/html/bug-bash/2016-05/msg00059.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]