You are not logged in.
Pages: 1
#!/bin/sh
prcs = pgrep $1
kill $prcs
How do I make a script that does that (my unworking version should show what I'm trying to do)
Offline
Is this behavior what you're looking for ?
#!/bin/bash
kill $(pgrep $1)
[edit]
I hope it is not your homework ?
Last edited by pressh (2008-01-21 15:52:08)
Offline
After a man pgrep, I see it's symlinked to pkill!
pkill is what you want!
no need for the script, just "pkill hto" will kill all htop e.g.
Offline
Is this behavior what you're looking for ?
#!/bin/bash kill $(pgrep $1)
[edit]
I hope it is not your homework ?
Thanks, yeah that works. It isn't my homework,
After a man pgrep, I see it's symlinked to pkill!
pkill is what you want!no need for the script, just "pkill hto" will kill all htop e.g.
Even better! Thanks.
Offline
Pages: 1