Query on "nice" command

Cameron Simpson cs at zip.com.au
Mon Feb 25 06:40:14 UTC 2008


On 25Feb2008 11:57, Ravi Shanmugam <ravi.shanmugam at sasken.com> wrote:
| I am writing a shell script, but I run that shell script with "nice -18"
| priority without invoking from command line like "nice -18 <script
| name>.
| Is it possible to embed the "nice" command in the same shell script? If
| yes, could somebody help me.

If you are thinking "make the script make itself nice", then yes. You want
the "renice" command, for adjusting the niceness of an existing process.
Apply it to the current process using $$ (the shell's script's process id):

  renice 18 -p $$

See "man renice" for details.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/




More information about the redhat-list mailing list