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: Greg Wooledge
Subject: Re: [Help-bash] Brace expansion with empty args
Date: Fri, 14 Jun 2013 08:32:15 -0400
User-agent: Mutt/1.4.2.3i

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> 



reply via email to

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