[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Bugs in defconfig /bin/sh
From:       Ralf Friedl <Ralf.Friedl () online ! de>
Date:       2010-09-30 22:26:03
Message-ID: 4CA50E7B.2020504 () online ! de
[Download RAW message or body]

Rob Landley wrote:
> I just fired up an Aboriginal system image with bash 2.05b (the much less 
> bloated version), and under that the third case _also_ prints "/bin/{a,b}*", 
> so the behavior of this corner case changed between bash versions.  Most 
> likely somebody reported the third case as a bug and they fixed the one defect 
> report without fixing the general case, because they're the FSF and everything 
> is a special case to them.
>
> The _important_ test is just:
>
>   v='/bin/*'; echo $v
>
> Which answers the simple question of glob precedence: does it happen before or 
> after the variable substitution?  And if the answer is "after" (which it is), 
> then that's what we should do.  Perform globbing after substituting variables.  
> {a,b} is part of globbing the same way * and ? and [x-y] and such are.
>   
The bash manual is quite explicit in the ordering of the expansion: 
brace expansion, variable expansion, pathname expansion (globbing).
Also, brace expansion is different from globbing in that it is just a 
string manipulation without references to the file system.
The result of {a,b} is always a b.
The result of [ab] depends on the content of the current directory.

> The fact that bash is a buggy pile of crap that can't even consistently 
> implement its own extensions is not our problem.  We should do the simple 
> thing and wait for the FSF to catch up.  (Specifically, wait for somebody 
> replying on this _obvious_bug_ to complain, and then tell them to complain to 
> the bash guys and make sure they don't _fix_ their inconsistency first.)

Ralf
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic