Date:Sat, 21 Jul 2018 11:33:18 -0400
From:Chet Ramey
Message-ID: <2fe93203-93fd-2a97-ff54-7cb748294...@case.edu>
| Even if the whitespace gets stripped out, the quoted null string should
| result in an empty argument.
Yes, it certainly should (and unless IFS has
Chet Ramey wrote:
> Bob Proulx wrote:
> > Denys Vlasenko wrote:
> >> $ f() { for i; do echo "|$i|"; done; }
> >> $ x=x
> >> $ e=
> >> $ f ${x:+ ""}
> >> ^^^ prints nothing, bug?
> >>
> >> $ ${x:+"" }
> >> ^^^ prints nothing, bug?
> >
> > Insufficient quoting. That argument should
On 7/21/18 12:44 AM, Bob Proulx wrote:
> Denys Vlasenko wrote:
>> $ f() { for i; do echo "|$i|"; done; }
>> $ x=x
>> $ e=
>> $ f ${x:+ ""}
>> ^^^ prints nothing, bug?
>>
>> $ ${x:+"" }
>> ^^^ prints nothing, bug?
>
> Insufficient quoting. That argument should be quoted to avoid t
On 7/20/18 10:43 AM, Denys Vlasenko wrote:
> $ f() { for i; do echo "|$i|"; done; }
> $ x=x
> $ e=
Thanks for the report. I'll take a look at what needs to be done here.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet
On 21.7. 07:44, Bob Proulx wrote:
Denys Vlasenko wrote:
$ f() { for i; do echo "|$i|"; done; }
$ x=x
$ e=
$ f ${x:+ ""}
^^^ prints nothing, bug?
$ ${x:+"" }
^^^ prints nothing, bug?
Insufficient quoting. That argument should be quoted to avoid the
whitespace getting stripped
Denys Vlasenko wrote:
> $ f() { for i; do echo "|$i|"; done; }
> $ x=x
> $ e=
> $ f ${x:+ ""}
> ^^^ prints nothing, bug?
>
> $ ${x:+"" }
> ^^^ prints nothing, bug?
Insufficient quoting. That argument should be quoted to avoid the
whitespace getting stripped. (Is that during wor
On 07/20/2018 04:43 PM, Denys Vlasenko wrote:
$ ${x:+"" }
^^^ prints nothing, bug?
Should be:
$ f ${x:+"" }
$ f ${x:+"$e""$e"""}
^^^ prints nothing, bug?
Should be:
$ f ${x:+"$e""$e" ""}
sorry.
$ f() { for i; do echo "|$i|"; done; }
$ x=x
$ e=
$ f ${x:+""}
||
^^^ correct
$ f ${x:+ ""}
^^^ prints nothing, bug?
$ ${x:+"" }
^^^ prints nothing, bug?
$ f ${x:+"$e"}
||
^^^ correct
$ f ${x:+ "$e"}
^^^ prints nothing, bug?
$ f ${x:+"$e""$e"""}
||
^