[PATCH] Ash support for replace and subsitution

Denys Vlasenko vda.linux at googlemail.com
Mon Mar 24 23:07:19 PDT 2008


On Tuesday 25 March 2008 05:23, Paul Smith wrote:
> On Tue, 2008-03-25 at 01:25 +0100, Denys Vlasenko wrote:
> > What is the difference between "test"/"[" and "[["?
> 
> I mentioned this in an earlier email, but in case it got lost: [[ is
> guaranteed to be a shell builtin and as such, it has some semantics
> which make it a bit easier to use than test/[, which might be (and must
> always behave as if it is) a separate program.
> 
> In particular, the expansion rules are modified so that you don't have
> to worry about odd characters, variables expanding to empty strings,
> etc... those odd quirks of test/[ that require simple workarounds like
> quoting all variables.  Mostly, in [[ .. ]] the content is not word
> expanded by the shell before the expression is evaluated.  Obviously
> this cannot be true of test/[.

Thanks, I added this info to ash.c as a comment.
--
vda


More information about the busybox mailing list