Scripts to start and stop

Michael Kjorling michael at kjorling.com
Fri May 25 18:55:07 UTC 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I haven't tried to reconstruct the code from the posts, but here is my
bet. Try quoting the string. And, if it's a bash shell script, you
shouldn't have the $ at the beginning of the variable name or it will
DEFINITELY be misinterpreted. Also, make the ps output wide and catch
nanny instead of perl.

nanny_pids="`ps -auxw | grep nanny | awk '{print $2}'`"

You could also pipe it through 'sed s/$^/ /g' - this will give you all
PIDs on one line, separated by spaces (like 'kill' wants them on its
command line).


Michael Kjörling


On May 25 2001 14:32 -0400, Adam Lang wrote:

> Ok I got part of it working:
> ps -aux | grep 'perl' | awk '{print $2}'
>
> produces this at the command line
> 22224
> 28431
>
> (the first number is the nanny program and the second is the grep)
> But when I run this in the script:
> $nanny_pids=`ps -aux | grep 'perl' | awk '{print $2}'`
>
> I get:
> ./named: =22224: command not found
>
> I placed an echo after that line to se if anything is in $nanny_pids, but it
> echos a blank line.
>
> I know this is not 100% BIND related, but I figured if I can get a working
> script, it would be good for the archives to have.
>
> Adam Lang
> Systems Engineer
> Rutgers Casualty Insurance Company
> http://www.rutgersinsurance.com

- -- 
Michael Kjörling - michael at kjorling.com - PGP: 8A70E33E
"We must be the change we wish to see" (Mahatma Gandhi)

^..^     Support the wolves in Norway -- go to     ^..^
 \/   http://home.no.net/ulvelist/protest_int.htm   \/

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBOw6qkiqje/2KcOM+EQIbaQCaAiuTHlOPSf0EVpZiiA4pl3L+J7EAn0oZ
h+jcg+Ua8NNY2ZF+j27W+xEg
=8IGD
-----END PGP SIGNATURE-----




More information about the bind-users mailing list