3

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?

2

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.

  • 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
1

Try:

ulimit -t unlimited

for setting cputime limit, and

man bash

for more options of ulimit bash built-in command

  • 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
0

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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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