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?

1

3 Answers 3

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.

1
  • 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. Dec 17, 2009 at 23:17
1

Try:

ulimit -t unlimited

for setting cputime limit, and

man bash

for more options of ulimit bash built-in command

1
  • 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. Dec 17, 2009 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.

1
  • 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. Dec 17, 2009 at 12:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .