On Mon, 26 Jan 2009, Cathey, Jim wrote:

> So you're looking at the string output of pidof?

Right.

> If proc's not there, I don't think that:
>
>       if [ "" ]
>
> is highly meaningful.

/proc is there alright.

> (Hence the -z suggestion?)

Well, I dom't think that matters.
I've been doing that kind of evaluation everywhere since ages.
All these expressions:

        [ "" ]
        [ -n "" ]
        [ -z "" ]

evaluate correctly in all shells I use: bash, zsh, dash and ash (except
for maybe this time, on this version: 1.13.2).  I already have ash from bb
1.1.3 behaving as expected on the same box.

> When I use pidof to probe for a process, I use
> its exit status:
>
>       if pidof <foo> >/dev/null

if [ "$(pidof <process name>)" ]

should return failure both if the pidof exit code is non-zero and when the
expression evaluates to the empty string.  That's the behaviour in all
shells I use.

The gdb backtrace I sent shows weird values for various variables.


Cheers,

-- 
Cristian
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to