[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: |
Wed, 12 Jun 2013 11:13:43 +0300 |
On Wed, Jun 12, 2013 at 5:39 AM, 齋藤正樹 <address@hidden> wrote:
> Hi, all.
> I have a question about brace expansion.
>
> ~$ echo a{b,c}
> ab ac
> ~$ echo a{,c}
> a ac
> ~$ echo a{,}
> a a
> ~$ echo {'',c}
> c
> ~$
>
> OK, two words were generated.
>
> ~$ echo {,c}
> c
> ~$ echo {,}
>
> ~$
>
> I expected two words.
> But I got only one or zero words.
> Is this behavior intended?
> Or documented in anywhere?
>
> I tested on 4.2.0(1)-release and 4.1.2(1)-release.
>
> Regards.
>
{,} just expands to two unquoted nothing and results in nothing
if you quote the nothing you get 2 empty strings:
$ set ''{,};echo $#
2
- [Help-bash] Brace expansion with empty args, 齋藤正樹, 2013/06/12
- Re: [Help-bash] Brace expansion with empty args,
Pierre Gaston <=
- Re: [Help-bash] Brace expansion with empty args, Greg Wooledge, 2013/06/12
- Re: [Help-bash] Brace expansion with empty args, Masaki Saito, 2013/06/14
- Re: [Help-bash] Brace expansion with empty args, Roman Rakus, 2013/06/14
- Re: [Help-bash] Brace expansion with empty args, Greg Wooledge, 2013/06/14
- Re: [Help-bash] Brace expansion with empty args, Pierre Gaston, 2013/06/14
- Re: [Help-bash] Brace expansion with empty args, Greg Wooledge, 2013/06/14
- Re: [Help-bash] Brace expansion with empty args, Roman Rakus, 2013/06/14
- Re: [Help-bash] Brace expansion with empty args, Greg Wooledge, 2013/06/14
- Re: [Help-bash] Brace expansion with empty args, Pierre Gaston, 2013/06/14
- Re: [Help-bash] Brace expansion with empty args, Chet Ramey, 2013/06/25