Re: =?iso-8859-1?Q?variable=3DStrart=5FProgramPID =3F=3F?=
From: Sam Watkins (swatkins_at_fastmail.fm)
Date: 11/24/04
- Previous message: Eric Scott: "Re: Using xvncviewer to talk to Windows remote desktop?"
- In reply to: pir aa: "variable=Strart_ProgramPID ??"
- Next in thread: pir aa: "Re: =?iso-8859-1?Q?variable=3DStrart=5FProgramPID =3F=3F?="
- Maybe reply: pir aa: "Re: =?iso-8859-1?Q?variable=3DStrart=5FProgramPID =3F=3F?="
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 25 Nov 2004 02:55:08 +1100 To: pir aa <pir@austromail.at>
On Wed, Nov 24, 2004 at 04:18:13PM +0100, pir aa wrote:
> I wrote a bash script from which I call one c-program, that is mainly a loop.
> But in the script I would like to be able to just kill the loop. So I thought,
> that there must be a way how to get the PID of a program when starting it
> (then save it in a variable and later use it to call kill). Is there?
not sure exactly what you want here, but here an example which might help:
find / > out &
pid=$!
sleep 4; kill $pid
this will find as many files as it can in about ~ 4 seconds,
then kill the find process.
The bash "info" doc is helpful, I always forget which funny variable is which,
you can type:
info bash var
to list all the variables, this one $! is one of the "special parameters" at
the top.
You may need to install the "bash-doc" package first.
hope this helps,
Sam
-- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
- Previous message: Eric Scott: "Re: Using xvncviewer to talk to Windows remote desktop?"
- In reply to: pir aa: "variable=Strart_ProgramPID ??"
- Next in thread: pir aa: "Re: =?iso-8859-1?Q?variable=3DStrart=5FProgramPID =3F=3F?="
- Maybe reply: pir aa: "Re: =?iso-8859-1?Q?variable=3DStrart=5FProgramPID =3F=3F?="
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|