Eric Wolzak wrote:

> running  eigerstein 2 beta/pppoe/new Busybox(0.49)

Um - new busybox is 0.50.

> The decision to start psentry $opt  based on
> 
> ps ax| grep $prg -$opt| grep "?" |grep "S"
> 
> If the programm was found and sleeping then don't start.
> So what happened if $prg -$opt did not exist in ps ax
> first time grep $prg -$opt  did not find anything
> by the second call it returned the command grep $prg -$opt itself.
> and filtered the pid from the grep file out, deciding $prg is started.
> 
> This behaviour is also reproducible on the commandline.
> I don't know if this is the same with all "grep versions"
> I solved it by including  | sed '/grep/d' | in the call.
> Now everyhting functions perfectly.

However, that calls sed and adds more execution time.  This is what I
do when I combine ps with grep:

ps aux | grep "SOME[.]*PROCESS"

...this will match "SOMEPROCESS" (which is presumably what you are
searching for) but NOT the pattern found in grep, which would be the
text "SOME[.]*PROCESS".  This would match SOMEunusualPROCESS but the
pattern need only contain enough unique characters to make that
unlikely.

In truth, any pattern that contains characters in the middle which
will match null will work.

_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to