aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-01-15 21:43:49 -0500
committerHolden Rohrer <hr@hrhr.dev>2020-01-15 21:43:49 -0500
commitf94bd859f5a556d0f2d03f356e179deb2c8ecf8d (patch)
tree86a5149ffc247ee22d3b57b859d7c00d7d4de46a
parent5931b35f0a6f11e2365750eba01b857db46c112b (diff)
script timestamps and cleans up after itself
-rwxr-xr-xminimun9
1 files changed, 6 insertions, 3 deletions
diff --git a/minimun b/minimun
index 923426c..ac369cb 100755
--- a/minimun
+++ b/minimun
@@ -3,16 +3,19 @@ use strict;
use warnings;
use IPC::Run qw(run);
+use Time::HiRes qw( time );
-my ($in, $out);
+my $in;
$in .= "\\award\n";
$in .= "\\bye\n";
-run ['/usr/bin/pdftex', 'format.tex'], '<', \$in, '>', \$out;
+my $timestamp = time;
+run ['/usr/bin/pdftex', '-jobname', "$timestamp", 'format.tex'], '<', \$in;
print "Content-type: application/pdf\n\n";
-open(DOC, '<', 'format.pdf');
+open(DOC, '<', "$timestamp.pdf");
while (<DOC>){
print;
}
close(DOC);
+unlink "$timestamp.pdf", "$timestamp.log";