• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 853
  • Last Modified:

Why can't I use "nice" in an bash shell script?

Hi there,

Why can't I use the nice command inside a script?  And what can I use instead?  

The code below does not work but if I remove the "nice +20" it works fine but I bully everyone else's jobs out of the queue.  any thoughts?



cd mydirectory
nice +20 ./myprogram1
nice +20 ./myprogram2
nice +20 ./myprogram3
nice +20 ./myprogram

PS when I preview the question my PLUS symbols disappear for some reason, but rest assured I use "nice" then a space then a plus then the number 20.....
1 Solution
hm, i check the syntax in man. try using "nice -n -20 ./program" to run it with most favorable scheduling, or "nice -n 19 ./program" fo least favorable.
WillFletcherAuthor Commented:
thanks very much, did the trick!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now