Nice syntax in csh on Solaris 10

Dear Solaris Experts,

I would like to set the lowest priority when running a resource intensive program in C shell on Solaris 10 similar to the following syntax that works in Korn shell:

$ nice -n 19 program

However, I got the following error when running the same command in C shell:

9 [servername] george % uname -a 
SunOS servername 5.10 Generic_144488-12 sun4v sparc SUNW,SPARC-Enterprise-T5220 
10 [servername] george % nice -n 19 program 
nice: Badly formed number

The man page looks identical to that in Korn shell.

Thanks,

George

According to the man page, csh's nice implementation does not use the -n option

  csh Builtin
     nice [-increment | +increment]  [command]
...
     nice is also a csh built-in command with behavior  different
     from the utility versions. 

I guess OP misunderstood the man page usage:

nice [+n |-n] [command]

Actually you have to replace n with process priority value.

+n Increment the process priority value by n.
-n Decrement the process priority value by n.

So it should be:

nice -19  program
1 Like

Thanks to Yoda,

The syntax below worked in C shell:

nice -19 program

Many thanks to your help,

George