On Sunday 10 July 2011 21:02, Chris Rees wrote:
> >> >> > With ash :
> >> >> >
> >> >> > # mkdir /tmp/{a,b,c}
> >> >> > # ls /tmp
> >> >> > {a,b,c}
> >> >> >
> >> >> >
> >> >> > With hush :
> >> >> >
> >> >> > # mkdir /tmp/{a,b,c}
> >> >> > # ls /tmp
> >> >> > a b c
> >> >> >
> >> >> >
> >> >> > Brace expansion works in hush but not in ash.
> >> >>
> >> >> It shouldn't work in ash, as Denys said. It's a bashism.
> >> >
> >> > I didn't say it should not, I said it doesn't work.
> >> >
> >> > IOW: there is no policy decision to never ever implement
> >> > brace expansion in ash, it's just not implemented right now.
> >> >
> >>
> >> So... do we need a separate ash and hush if ash doesn't need to be
> >> sh-compatible? I don't want to start a flamewar, but I think that
> >> portability is very important, and adding strange extensions means
> >> that people use code that breaks on other platforms, as you well know
> >> from the latest patches to gen_build.sh.
> >
> > Bash is a standard Linux shell. Therefore bash compatibility hardly
> > can be qualified as "strange". You may not like it, but bash was
> > providing this functionality on Linux for years.
> >
> > Bash compatibility in both ash and hush is optional, therefore
> > you are free to configure them to not have these "strange extensions".
> >
> > However, you are not free to dictate other people that they must not
> > use these extensions. Because when you start telling other people
> > what they should do is where freedom ends and control freakism starts.
>
> I'm certainly not advocating telling people what to do, although I can
> see how that's coming across.
>
> Of course it's up to the Busybox project to set your own policy -- my
> problem with adding non-standard features to shells is that people
> rely on them and write incompatible scripts when *all that is needed*
> is to just use the correct language in the first place.
Bash was used in Linux from the very beginning, which makes it a de-facto
standard. It doesn't matter whether you or me like it or not, we must
account for the fact that long-time Linux users are used to it.
Forcing them to stop using all bashisms is both counter-productive
and arrogant.
> I don't think it's too much of a straw man to compare this with
> expecting C to support foreach, or expecting the 'dir' command to work
> (like RH7 did...).
The difference is that C never supported foreach. Shell in Linux did support
brace expansion. More important example: Shell in Linux always had echo builtin
not interpreting backslash escapes, and acception -n and -e options.
The approach dash took when they broke echo builtin compatibility (!)
in several ways at once (!!) angered a lot of people.
Do dash developers really think that they did more for Linux than bash,
and thus have a moral right to cause breakage to millions of users?
> However, I can see that this avenue of reason is not going to change
> any minds, so I'm going to apologise for jumping on Eric like that and
> advising against the patch -- it wasn't really my place to say that
> and I accept that.
>
> Can I make a final plea, if this is implemented as an option, can it
> please be disabled by default? This should make people more aware that
> it's a nonstandard function -- bash may be the standard shell on GNU
> systems, but it's not in most other OSes.
If other systems think Linux is irrelevant, Linux crowd can easily take
the same stance and declare all other (unix) systems irrelevant.
I leave it up to you to guess who is going to win such battle.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox