Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to run ./a.out, but monitored (using mon) and nice'd to highest priority.

Here are the commands separately:

nice -n -20 /home/pi/a.out   //works fine

mon /home/pi/a.out   //works fine

mon nice -n -20 /home/pi/a.out   //doesn't work!

I get an "unrecognized flag -n" error...

How to do this?

Many thanks in advance,

share|improve this question
1  
It seems that mon considers -n as it's own option. I haven't worked with mon, but try putting the command after mon in '' – hpn Feb 22 '13 at 10:35
    
@hnik Yes, you're right. I believe mon thinks the -n is for it. Thanks for that. I'll try the quotes. I'll also try back-ticks. – Eamorr Feb 22 '13 at 10:43
    
@hnik Single quotes works. Thanks! – Eamorr Feb 22 '13 at 10:45
    
Another variation that will probably work is nice -n -20 mon /home/pi/a.out. In case it isn’t obvious, this differs in effect from what you are trying in that this command will run the mon program at high priority (in addition to your a.out), whereas your command runs mon at default priority, while elevating a.out. – Scott Feb 22 '13 at 22:46

You must log in to answer this question.

Browse other questions tagged .