Limit qalc cpu time

This commit is contained in:
Pragmatic Software 2017-10-05 19:37:05 -07:00
parent 0fcbaaad4b
commit cfc8ec9f06
1 changed files with 2 additions and 4 deletions

View File

@ -9,14 +9,12 @@ use strict;
my $args = join ' ', @ARGV;
my $qargs = quotemeta $args;
if (not length $qargs) {
if (not length $args) {
print "Usage: qalc <expression>\n";
exit;
}
my $result = `qalc $qargs`;
my $result = `ulimit -t 2; qalc '$args'`;
$result =~ s/^.*approx.\s+//;
$result =~ s/^.*=\s+//;