[BusyBox] how to do "[ $? -eq 1 ] && echo equal"
Matthias Fuchs
matthias.fuchs at esd-electronics.com
Wed Apr 11 13:38:04 UTC 2001
Hi Michael,
I tested that before. I think busybox has so if-then support so far.
This is my test output
BusyBox v0.51pre (2001.04.11-11:38+0000) Built-in shell (lash)
Enter 'help' for a list of built-in commands.
/ # if [ 1 -eq 1]; then echo "equal" fi
[: missing ]
> if
sh: ÈþÈ: No such file or directory
>
I think test or "[" can only be used to set $?. The strange thing I
noticed is the result if I do nothing but typing "if" at the prompt !
Matthias
Michael Renzmann wrote:
>
> Hi.
>
> > is there already a possibility to do a "execute on test" ? I want to
> > start an application, if a condition is true. But how can I start an
> > application conditionally ?
>
> Does anything speak against an if-clause?
>
> if [ $? -eq 1]; then
> echo "equal"
> fi
>
> Thats the way I normally do it in bash-scripts. Due to a lack of
> knowledge of the lash I don't know if it works similar there, but...
>
> Bye, Mike
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/mailman/listinfo/busybox
--
-------------------------------------------------
\ Matthias Fuchs \
\ esd electronic system design Gmbh \
\ Vahrenwalder Straße 205 \
\ D-30165 Hannover \
\ email: matthias.fuchs at esd-electronics.com \
\ phone: +49-511-37298-0 \
\ fax: +49-511-37298-68 \
--------------------------------------------------
More information about the busybox
mailing list