Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 02 Jul 2000 07:18:09 -0700
From:      Cy Schubert - ITSD Open Systems Group <Cy.Schubert@uumail.gov.bc.ca>
To:        Alban Hertroys <dalroi@wit401310.student.utwente.nl>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: man nice(1) 
Message-ID:  <200007021418.e62EIww00785@cwsys.cwsent.com>
In-Reply-To: Your message of "Sun, 02 Jul 2000 14:09:16 %2B0200." <20000702120917.D5BA71E7E@wit401310.student.utwente.nl> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20000702120917.D5BA71E7E@wit401310.student.utwente.nl>, 
Alban Hertr
oys writes:
> Is it just me or is the man page for nice in error?
> 
> It says I have to specify a nice value of (+)20 as "nice -20" and a nice
> value of -20 as "nice --20".
> 
> running "nice -20" results in a nice value of -20, though,
> while "nice --20" says:
> 	nice: Badly formed number.
> 
> Eventually it turned out I had to do "nice +20" ...
> The man page of renice does state the nice value parameters correctly,
> which causes a confusing difference between the two commands.

I see you're a csh user.  C Shell has a builtin nice which is 
incompatible with /usr/bin/nice which is used by the Bourne shell and 
any of its descendants.

The csh nice builtin is documented in the csh(1) man page:
       nice
       nice +number
       nice command
       nice +number command
               The first form sets the scheduling priority for this 
shell
               to 4.  The second form sets the priority to the given
               number. The final two forms run command at priority 4 and
               number respectively.  The greater the number, the less 
cpu
               the process will get.  The super-user may specify 
negative
               priority by using `nice -number ...'.  Command is always
               executed in a sub-shell, and the restrictions placed on
               commands in simple if statements apply.

If you wish to use the Bourne nice command under csh, you must specify 
the full path name.

Why are Bourne and C Shell nice commands not the same?  Well the 
developers of csh so many years ago chose a different syntax.  Should 
they be the same?  To make them the same would break compatibility with 
all other UNIX systems.  If you want to make them the same, put the 
following in your .cshrc:

	alias nice /usr/bin/nice

> 
> 
> This is with a somewhat older 4.0-STABLE.
> I found this when trying a buildworld "nicely", as my system hottens up
> a tiny bit to much somewhere (probably my pci viper550 with bad fan)
> causing spontaneous reboots after a couple of hours.

I don't see how the nice command would solve this.  It just assigns a 
different priority to a command and its children causing them to be 
selected for execution more or less frequently in relationship to other 
processes running on the system.  If you have no higher priority work 
on the machine, a lower nice value will not make any difference in 
execution time or the amount of heat produced by your CPU.  Replacing 
the bad fan or reducing your CPU's clock rate will help.


Regards,                       Phone:  (250)387-8437
Cy Schubert                      Fax:  (250)387-5766
Team Leader, Sun/DEC Team   Internet:  Cy.Schubert@osg.gov.bc.ca
Open Systems Group, ITSD, ISTA
Province of BC





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200007021418.e62EIww00785>