Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I’m using a modification of Paul Biggar’s LaTeX build system.

The core of this system is just a bash script that executes an infinite loop. The question is, how do I run this script?

At the moment I just run it by invoking it in the terminal:

$ ./build-it.sh report

However, there are two problems with this:

  1. It clutters the terminal with irrelevant output. Redirecting the standard output/error streams to /dev/null doesn’t help. In fact, every line that is executed in the script is also written to the console. Is this even normal?
  2. After some time (about 30 minutes, I’d say) the script terminates with an error (“Cputime limit exceeded”).

The first problem could probably be solved by using nohup and closing the terminal window. But this still leaves the second problem. I also feel that this isn’t a “clean” solution because I’d prefer to run the script normally in the background and prevent its standard output (and incidentally, not error messages).

Isn’t there a proper way to do this?

share|improve this question
    
See my edited answer. –  Dennis Williamson Dec 17 '09 at 19:18

3 Answers 3

up vote 2 down vote accepted

If you're using the script posted as an answer here, then you can remove the set -x which is for debugging.

If you redirect the stderr of the script, instead, it should suppress the debugging output, but it will also suppress any error messages.

Edit:

Also there's a ulimit -t 10 line in that script. Removing that will probably help.

share|improve this answer
    
Sweet. Thanks a lot. –  Konrad Rudolph Dec 17 '09 at 15:39
    
The ulimit -t 10 in the script needs to stay – and it shouldn’t affect the script itself: otherwise, the script would stop after only 10 seconds. –  Konrad Rudolph Dec 17 '09 at 23:17

You can invoke $ ./build-it.sh report & exit which will solve the first issue.

As for the second, it may have more to do with the actual script.

share|improve this answer
    
Not sure I can follow – the cputime limit doesn’t have anything to do with the script, that’s the same for all scripts. What I’d like to do is switch off the cputime limit for this specific script. –  Konrad Rudolph Dec 17 '09 at 12:45

Try:

ulimit -t unlimited

for setting cputime limit, and

man bash

for more options of ulimit bash built-in command

share|improve this answer
    
Unfortunately, that doesn’t work either: I used (ulimit -t unlimited; ./build-it.sh report) but the script stops after a time all the same. –  Konrad Rudolph Dec 17 '09 at 15:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.