Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Kill a job in a script?

  • Subject: Re: Kill a job in a script?
  • From: Roy Schestowitz <newsgroups@xxxxxxxxxxxxxxx>
  • Date: Wed, 01 Feb 2006 15:43:05 +0000
  • Newsgroups: comp.os.linux.misc
  • Organization: schestowitz.com / MCC / Manchester University
  • References: <drq6m2$rl1$1@gwdu112.gwdg.de> <1907b3-e5c.ln1@teksavvy.com>
  • Reply-to: newsgroups@xxxxxxxxxxxxxxx
  • User-agent: KNode/0.7.2
__/ [Chris F.A. Johnson] on Wednesday 01 February 2006 15:21 \__

> On 2006-02-01, Anton81 wrote:
>> Hi,
>>
>> I have scripts where I start command in the background and want to kill
>> them later. I don't manage to kill them. What's a possible way?
>>
>> Something like:
>>
>> nedit file.txt &
>> ...
>> kill <thatjob>
> 
> nedit file.txt &
> thatjob=$!
> kill "$thatjob"

Or... nedit file.txt & killall -HUP nedit, assuming you have just one
instance of that program. Why would you ever want to kill nedit? It's a good
editor.

Roy

-- 
Roy S. Schestowitz      |    Useless fact: Every polar bear is left-handed
http://Schestowitz.com  |    SuSE Linux     |     PGP-Key: 0x74572E8E
  3:40pm  up 15 days 10:56,  11 users,  load average: 0.18, 0.11, 0.05
      http://iuron.com - next generation of search paradigms

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index