On Monday, July 11, 2011 17:20:31 Rich Felker wrote:
> On Mon, Jul 11, 2011 at 11:19:01AM -0400, Mike Frysinger wrote:
> > > in addition to that, the braces only get expanded if the usage warrants
> > > it. so if the braces are quoted, or dont follow the simple syntax, the
> > > braces get passed through like any other char.
> > > 
> > > $ echo {0..10
> > > {0..10
> > > $ echo '{0..10}'
> > > {0..10}
> > > 
> > > i doubt many scripts will hit this
> 
> Irrelevant. Some will. and you break them. Bash does not break them
> because brace expansion is off-by-default in non-interactive shells.

sorry, but that's incorrect.  bash does brace expansion by default.  only `set 
+B` turns it off.  the man page says this, as does simple testing.

$ readlink /bin/sh
bash
$ sh -c 'echo {a,b}'
a b
$ printf '#!/bin/sh\necho {a,b}' > test.sh
$ sh ./test.sh
a b
$ chmod a+rx test.sh
$ ./test.sh
a b

> > also worth noting that the brace is already a semi-reserved character
> > in POSIX itself.  you get semi-subshells and functions with it.  so
> > concern about it being reserved is kind of a red herring.
> 
> Completely different context, also irrelevant. POSIX specifies that
> "echo {a,b}" prints the string "{a,b}" not "a b".

my point is that the breakage is minor and the real world impact is 
insignificant at best.  and, again, if *you* dont want this behavior, then 
*dont enable it in your busybox config*.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to