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 redbrick.dcu.ie PubKey: colmmacc+pgp at redbrick.dcu.ie
Web: http://devnull.redbrick.dcu.ie/
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!