Call Nice command (priority) from /bin/ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Call Nice command (priority) from /bin/ksh
# 1  
Old 03-07-2011
Call Nice command (priority) from /bin/ksh

Hello,

I am just starting with shell scripting, as everyone will soon see from my question. What I'm trying to do is call the Nice command to set the script process priority from /bin/ksh. The difference is I'm running it not directly through the shell, but through Bigfix (very similar to MSFT's SMS\SCCM).

I feel certain my syntax to call it is off. Here is what I tried (along with a few other variations):

/bin/ksh nice -n 20 <script to run>

Removing any call to Nice and it runs fine so clearly the shell is opening, but just not finding and\or running Nice. This was tested on AIX 6.1 and Red Hat 5.2

Any help is very much appreciated.

Thanks!

Last edited by solly119; 03-07-2011 at 01:43 PM..
# 2  
Old 03-07-2011
Have you got an error message ? If so do post it here ... so many things can go wrong theses days !
# 3  
Old 03-07-2011
nice isn't a shell script, so you can't just do /bin/ksh nice ... It won't know what to do with a binary executable.

Have nice run ksh instead. nice -n 20 /bin/ksh script-to-run
# 4  
Old 03-07-2011
Thank you Corona688! That did it.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call stack /bin/sh

call stack shell (5 Replies)
Discussion started by: julia_sus
5 Replies

2. Linux

Determining Values for NIce and Priority items in limits.conf file

I've been looking online trying to find the correct value nice and priority can take in the limits.conf file. ON the man page it says; Does this mean priority can be any negative number and any positive? Then Does this mean any number between -20 and 19 also what does the definition of nice... (13 Replies)
Discussion started by: matthewfs
13 Replies

3. UNIX for Dummies Questions & Answers

fuser: difference with bin/sh and bin/ksh shell script

Hi, I have a problem I don't understand with fuser. I launch a simple shell script mysleep.sh: I launch the command fuser -fu mysleep.sh but fuser doesn't return anything excepted: mysleep: Then I modify my script switching from #!/bin/sh to #!/bin/ksh I launch the command fuser -fu... (4 Replies)
Discussion started by: Peuj
4 Replies

4. Shell Programming and Scripting

/bin/sh and /bin/ksh problem

we have a shell script that we are using in KSH if ]; then _IFS=$IFS IFS=: and it's failing on /bin/sh . Is there a simple way to modify it to work on both . ( not with awk) Thanks in adv (3 Replies)
Discussion started by: talashil
3 Replies

5. UNIX for Dummies Questions & Answers

System call code - nice()

Hi there, i'm trying to find the implementation code for the system call nice(). Since it's a system call i'm having problems finding where it would be? is it in the linux kernel directory somewhere? I would assume it would be a file called nice.c or something like this. Thanks in advance! (2 Replies)
Discussion started by: sport23
2 Replies

6. 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

7. HP-UX

urgent help required on changing process priority using nice

Hi folks, Hope you can help me. I have a process that is currently running at nice 20 and need it to run faster (-10?). How do I change the process using nice? I have the process number and thought it would be along the lines of; nice -10 process_id but it doesn't seem to like that. (1 Reply)
Discussion started by: gshuttleworth
1 Replies

8. Shell Programming and Scripting

#!/usr/bin/ksh Command Interpreter in a sh script

Hi, I have a developer that is trying to start a script with sh "scriptname". In the script, he is specifying #!/usr/bin/ksh as the command interpreter. For some reason sh is ignoring the #!/usr/bin/ksh. We are running Solaris 8. Does anyone have any ideas what could be causing this? Here... (3 Replies)
Discussion started by: ckeith79
3 Replies
Login or Register to Ask a Question