commit f0e1e8235df1cac298dd3ce076b9f9b9fc48e8e5
parent 45097d13b0ae1cd53a4349c1cb14a2fe8635b1be
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 18 Jun 2020 12:45:15 +0200
Avoid generating extra temporary file
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.config/mutt/muttprint-groff.sh b/.config/mutt/muttprint-groff.sh
@@ -7,7 +7,8 @@ mkdir -p "$PDIR"
infile="$(mktemp "$PDIR"/mutt_XXXXXX)"
tmpfile="$(mktemp "$PDIR"/mutt_XXXXXX)"
-outfile="$(mktemp "$PDIR"/mutt_XXXXXX).pdf"
+outfile="$(mktemp "$PDIR"/mutt_XXXXXX)"
+mv "$outfile" "${outfile}.pdf"
printf 'infile = %s\n' "$infile"
printf 'tmpfile = %s\n' "$tmpfile"