Re: [Haskell-cafe] [darcs-users] Darcs failure

On 24/12/2010 09:58 AM, Miles Gould wrote:
Hi Andrew,
Others have probably told you this,
Actually no...
but you should look into the pkill command, which allows you to kill processes (including sending signals other than SIGTERM) by name. It's installed by default on Ubuntu.
Mmm, OK. Thanks for the tip. Gotta love the way that this is THE MOST COMMON USE CASE for kill, and yet kill itself doesn't support doing this. But still, that's the Unix methodology; why have one application that does what you want when you could split it into a dozen smaller applications and force everybody yo reinvent the wheel every single time they need it? PS. No, I'm not bitter. Not at all...

On 12/24/10 4:08 PM, Andrew Coppin wrote:
Gotta love the way that this is THE MOST COMMON USE CASE for kill, and yet kill itself doesn't support doing this.
The problem with killing processes by name is that names aren't unique, so you might unintentionally end up killing other processes that share the same name. If you want to kill all processes with a given name, then you can use the "killall" command, which explicitly indicates that you are willing to kill everything with that name. Cheers, Greg

Andrew Coppin
but you should look into the pkill command, which allows you to kill processes (including sending signals other than SIGTERM) by name. It's installed by default on Ubuntu.
Or 'killall'. Which has (had) the interesting namesake on Solaris which would indiscriminately kill all processes on the system.
Gotta love the way that this is THE MOST COMMON USE CASE for kill, and yet kill itself doesn't support doing this.
If you have suspended the job (^Z), you can usually refer to its PID as %%, so e.g. kill -9 %% should do what you want. If you are a bit more careful, you can list background jobs with 'jobs' (-l to get PIDs as well), and you can then refer to each as %N, where N is job number. So if darcs is background job number 3, you can type kill -9 %3 The nice thing about Unix is that there are pleny of wheels, and you can pick the one that fits your wagon best. :-) -k -- If I haven't seen further, it is by standing in the footprints of giants
participants (3)
-
Andrew Coppin
-
Gregory Crosswhite
-
Ketil Malde