From f94bd859f5a556d0f2d03f356e179deb2c8ecf8d Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Wed, 15 Jan 2020 21:43:49 -0500
Subject: script timestamps and cleans up after itself
---
minimun | 9 ++++++---
1 file 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 (){
print;
}
close(DOC);
+unlink "$timestamp.pdf", "$timestamp.log";
--
cgit