bug-bash
[Top][All Lists]
Advanced

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

Re: Curly braces expansion not always works as expected.


From: Stephane Chazelas
Subject: Re: Curly braces expansion not always works as expected.
Date: Fri, 6 Oct 2006 09:08:26 +0100
User-agent: Mutt/1.5.6i

On Thu, Oct 05, 2006 at 12:23:41AM +0200, Reuti wrote:
[...]
>         Curly braces expansion only works with at least one comma  
> (,). This also works, if the appears at least once
>         inside some apostrophes and has no function.
> 
> Repeat-By:
>         reuti@defiant:~> bash --version
>         GNU bash, version 2.05b.0(1)-release (powerpc-apple-darwin8.0)
>         Copyright (C) 2002 Free Software Foundation, Inc.
>         reuti@defiant:~> echo {"x x"} # No {} in output expected.
>         {x x}
>         reuti@defiant:~> echo {"xx"} # No {} in output expected.
>         {xx}
>         reuti@defiant:~> echo {"xx","yy"} # Works fine.
>         xx yy
>         reuti@defiant:~> echo {"x,x"} # Add a comma to get it  
> working, i.e. remove the {}.
>         x,x
>         reuti@defiant:~>
> 
>         Also this seems to be strange:
> 
>         reuti@defiant:~> echo {"klklkl"} {1,2,3} # Only second {}  
> works correctly.
>         {klklkl} 1 2 3
>         reuti@defiant:~> echo {"klklkl"}{1,2,3} # Completely messed up.
>         {klklkl}{1,2,3}

Only that one is a bug, it should output {klklkl}1 {klklkl}2
{klklkl}3

The other ones work as documented.

From info -f bash -n 'Brace Expansion'

 | A correctly-formed brace expansion must contain unquoted
 | opening and closing braces, and at least one unquoted comma
 | or a valid sequence expression.  Any incorrectly formed brace
 | expansion is left unchanged.

>         reuti@defiant:~> echo {"kl,klkl"}{1,2,3} # Add a comma to  
> get it working
>         kl,klkl1 kl,klkl2 kl,klkl3
>         reuti@defiant:~>
[...]

-- 
Stéphane




reply via email to

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