On 2003-04-22 at 16:20 -0400, Jorge Arellano Cid wrote:
kill `ps -U <USER> | grep bm_srv12 | sed 's/^ *//g' | cut -d' ' -f1`
Depending upon line buffering and how your PIDs are ordered (wrapped around recently?) that can end up killing the "grep" process before its given the PID for the bookmark server. A neat little Unix shell idiom for that is: grep '[b]m_srv12' The pattern there will no longer match the grep command-line, since the ']' adds an extra character. I think that I first learnt this from Aeleen Frisch's Essential System Adminstration book -- an excellent resource now in its third edition (was 1st ed when I learnt that one -- it's an old idiom). ps -U <USER> | grep '[b]m_srv' | awk '{print $1}' | xargs kill
That is, issued from dillo to force the shut down of a running bookmark server.
Suggestion: put it into a two-line shell-script which Dillo invokes; then portability simply becomes a package-maintainer issue of changing a very short shell script.
The point is: Does this command work well on *BSDs, and Solaris?
The basic stuff tested successfully on FreeBSD 4.7 ia32, OpenBSD 3.2 sparc and Solaris 2.5.1 sparc. Both the sed/cut version and the awk version. ;^) That's using the default /usr/bin/ps on Solaris; if someone has put the *BSD commands in their path first, then they'll have the really ancient syntax of /usr/ucb/ps and -U isn't supported. Such people are probably best just deemed "on their own".