From: Colm MacCárthaigh (colmmacc at domain redbrick.dcu.ie)
Date: Tue 16 Jul 2002 - 13:26:10 IST
On Tue, Jul 16, 2002 at 01:16:20PM +0100, Donncha O Caoimh wrote:
> I renice my setiathome processes when I'm AFK . I setup the renice command as
> follows:
> ps auxw|grep setiathome| awk '{ if ($11 == "setiathome") print $2 }' | xargs
> echo renice 20
with pgrep that would be:
pgrep setiathome | xargs echo renice 20
personally, I use;
renice 20 `pgrep setiathome`
but that's me :)
pgrep has two features which make this safe:
"The pattern is normally only matched against the process name.
When -f is set, the full command line is used."
and
"The running pgrep or pkill process will never report itself as
a match"
These problems are common :)
> Now, if someone could show me how to stuff the renice command into the command
> line history/buffer from a shell script I wouldn't have to copy/paste it
> afterwards.
in bash; you can use history -s to get thigns into a history, but since that's
a different shell, it won't work. You could source it instead. Why are
you doing this though ?
-- colmmacc at domain redbrick.dcu.ie PubKey: colmmacc+pgp at domain redbrick.dcu.ie Web: http://devnull.redbrick.dcu.ie/
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:17:55 GMT