Nice syntax in csh on Solaris 10


 
Thread Tools Search this Thread
Operating Systems Solaris Nice syntax in csh on Solaris 10
# 1  
Old 01-14-2014
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:

Code:
$ nice -n 19 program

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

Code:
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

Last edited by radoulov; 01-14-2014 at 05:17 AM..
# 2  
Old 01-14-2014
According to the man page, csh's nice implementation does not use the -n option
Code:
  csh Builtin
     nice [-increment | +increment]  [command]
...
     nice is also a csh built-in command with behavior  different
     from the utility versions.

# 3  
Old 01-14-2014
I guess OP misunderstood the man page usage:
Code:
nice [+n |-n] [command]

Actually you have to replace n with process priority value.
Code:
+n Increment the process priority value by n.
-n Decrement the process priority value by n.

So it should be:
Code:
nice -19  program

This User Gave Thanks to Yoda For This Post:
# 4  
Old 01-14-2014
Thanks to Yoda,

The syntax below worked in C shell:

Code:
nice -19 program

Many thanks to your help,

George

Last edited by Scott; 01-14-2014 at 07:17 PM.. Reason: Code tags, please....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

syntax error in .csh file

Hi all, I am trying to modify a script for research purposes and am having difficulty here as I have little prior experience with C-shell scripting. The script looks as follows (it includes tcl commands like runFEP that you can ignore) #!/bin/bash for ((old=1, new=2; old<=4; ... (5 Replies)
Discussion started by: chrisjorg
5 Replies

2. Shell Programming and Scripting

Solaris bash syntax different from Linux?

I have a script that's meant to check the disk usage on a particular volume and delete the oldest logfile if it's over a certain percentage. It runs fine on a Linux machine, but on a Solaris one, I get this error: diskspace_check.sh: syntax error at line 3: `diskspace=$' unexpected I assume... (2 Replies)
Discussion started by: cara_k
2 Replies

3. Shell Programming and Scripting

Is tcsh 100% compatible with the plain-old csh [on Solaris 9]

Hi folks There are about 200 csh scripts (I didn't wrote them). Do all those scripts run with tcsh without modification? Is tcsh 100% compatible with the plain-old csh? $ which csh /usr/bin/csh $ which tcsh /usr/bin/tcsh $ uname -a SunOS purzelse 5.9 Generic_117171-07 sun4u sparc... (2 Replies)
Discussion started by: slashdotweenie
2 Replies

4. Shell Programming and Scripting

awk syntax for Solaris

Hi, Pass variable in SUN SOLARIS awk I have a file call text server1 10.0.0.2 When i use this awk command in Mac OS and Linux , everything works as expected. export HOSTNAME=server1 awk -v HOSTNAME=$HOSTNAME ' $1 ~ HOSTNAME { print $2 ; } ' text1 But when i entered the... (7 Replies)
Discussion started by: phamp008
7 Replies

5. Shell Programming and Scripting

simple CSH Script behaves differently on Solaris and RedHat Linux

I have a simple csh-script on a Solaris Workstaion which invokes the bc calculator: #!/bin/csh set shz=2 set zshift=5 set shzp=`bc -l <<END \ scale = 3 \ -1. * $shz + $zshift \ END` echo $shzp The result ($shzp) in this case is 3 (-1*2+5). It works fine on Solaris 8. ... (2 Replies)
Discussion started by: two reelers
2 Replies

6. Shell Programming and Scripting

csh in solaris

how can i pre-set then PATH so that i no need setenv everytime i login. i know it can be done with edit .login on normal user but how about root? (1 Reply)
Discussion started by: conandor
1 Replies

7. Shell Programming and Scripting

csh failing to call an 2 embedded csh script

I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them) Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Discussion started by: pollsizer
1 Replies

8. UNIX for Dummies Questions & Answers

csh syntax

I am trying to list output in columns in csh. What would be the syntax for this shell if in ksh it is: ls -d !(*SNMP*) ? (0 Replies)
Discussion started by: charlie11k
0 Replies

9. Programming

nice command and nice() system call

Hi I want to implement the nice command in the shell that I am building. I came to know that there is a corresponding nice() system call for the same. But since I will be forking different processes to run different commands typed on the command prompt, is there any way I can make a command... (2 Replies)
Discussion started by: tejbuch
2 Replies

10. Shell Programming and Scripting

if-else syntax in csh

Dear friends, I am writing a script usiing c-shell. iwant if -else syntax in c-shell i have taken twovariables and in one variable iam storing sysdate.and comparing with other variable if both are same then iam renaming file as oct_2005. please see below code set mon=`date +%m`... (1 Reply)
Discussion started by: rajan_ka1
1 Replies
Login or Register to Ask a Question