Scripts to start and stop

Adam Lang aalang at rutgersinsurance.com
Fri May 25 19:01:28 UTC 2001


yup, the $ sign did it

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Michael Kjorling" <michael at kjorling.com>
To: "Adam Lang" <aalang at rutgersinsurance.com>
Cc: "BIND-Users" <bind-users at isc.org>
Sent: Friday, May 25, 2001 2:55 PM
Subject: Re: Scripts to start and stop


> -----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