help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Brace expansion with empty args


From: Pierre Gaston
Subject: Re: [Help-bash] Brace expansion with empty args
Date: Fri, 14 Jun 2013 15:51:37 +0300

On Fri, Jun 14, 2013 at 3:32 PM, Greg Wooledge <address@hidden> wrote:
> On Fri, Jun 14, 2013 at 12:37:25PM +0200, Roman Rakus wrote:
>> On 06/14/13 06:20, Masaki Saito wrote:
>> >I had thought that `nothing' is same as null string.
>> >But manual says that preamble and postscript are optional.
>
>> >What's different about nothing and null string?
>
> Honestly, I don't know whether this is a bug or not.  I tend to avoid
> brace expansion.
>
> Since it's a bash extension, and not part of POSIX, there's no formal
> specification for how it's *supposed* to work, so only Chet can decide
> whether it's doing what it should.
>
>> In fact it generates null string, but word splitting will erase it. (at
>> least I believe in it)
>
> That's not correct.  There's no word splitting of the results.
>
> imadev:~$ printf '<%s> ' {,c}; echo
> <c>
> imadev:~$ printf '<%s> ' ''{,c}; echo
> <> <c>
> imadev:~$ printf '<%s> ' ' '{,c}; echo
> < > < c>
> imadev:~$ printf '<%s> ' 'a '{,c}; echo
> <a > <a c>
>
>From the previous discussions about {} on bug-bash, brace expansion is
a textual thing.
So I guess it's just that ''{,} result in the text '' '', while {,}
results in not text, or perhaps in a whitespace



reply via email to

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