I like these solution. Thanks.
ted On 10/13/05 10:59 PM, "Peter N Lewis" <[EMAIL PROTECTED]> wrote: > At 20:02 -0700 13/10/05, Ted Zeng wrote: >> Here is the fun part: I made a killapp.pl script and >> Call it to kill Bridge with >> `killapp.pl Bridge ` >> >> And it kills itself. >> >> As it turned out, the script finds itself from the list because the >> Command line includes Bridge(or "Adobe Illustrator" for Illustrator). > > The standard trick for this, if the search is a regular expression, > is to surround one of the letters with [], ie: > > killapp.pl '[B]ridge' > >> It works. But somebody probably laughs at it. > > It's hardly the first time, indeed the general "find this application" of > > ps auxw | grep xxxx > > inevitably finds the search command unless you use a trick like the above, or: > > ps auxw | grep xxxx | grep -v grep > > Enjoy, > Peter.