ash: command line editing question

Loïc Grenié loic.grenie at gmail.com
Thu Dec 6 00:41:13 PST 2007


2007/12/6, Alexander Griesser <alexander.griesser at lkh-vil.or.at>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Loïc Grenié wrote:
> >> Basically, this happens with all unfinished commands, the
> >> calculation above was just mentioned because it happened
> >> to me while I was working on a formula to calculate battery
> >> lifetime indicators.
> >>
> >
> >    One ) is probably considered part of the fomula (even though the
> >   formula will result sintactically incorrect) while one )) ends the
> >   formula.
>
> That sounds reasonable, but I tried `dash` today (busybox ash seems to
> behave similar than dash in most things) and dash does the following:
>
> - ------------------------[ dash ] -----------------------
> $ VAR=2
> $ echo $(( $VAR + $VAR ))
> 4
> $ echo $(( $VAR + $VAR )
> > )
> > )
> >
> $
> - ---------------------------------------------------------
>
> As you can see, the first try works because I did everything right, in
> the second try I "forgot" to add the last parantheses and the '>' prompt
> appears.
>
> dash behaves similar than ash in that it doesn't let me finish this
> command by simply adding the missing parantheses in the next line which
> is perfectly fine (I don't demand that it should work like this), _BUT_
> (and that's the big difference) dash lets me exit this editing mode by
> simply hitting CTRL-C as you can see in the last line of the above
> output.

> Again, busybox ash doesn't do this

    Indeed, but Ctrl-D let you out.

             Loïc Grenié


More information about the busybox mailing list