summaryrefslogtreecommitdiff
path: root/stdin-wrapper
diff options
context:
space:
mode:
authorBjorn Neergaard <bjorn@neersighted.com>2016-10-10 14:26:29 -0500
committerBjorn Neergaard <bjorn@neersighted.com>2016-10-10 14:31:17 -0500
commite68800a28dfd71fbf2171de8be1e7c8abb1405e3 (patch)
treeb2d562d484b4b43465b8a433d39a600c4016fdf0 /stdin-wrapper
parent151152b446332ebe99654f8264cde337039aaebc (diff)
downloadale-e68800a28dfd71fbf2171de8be1e7c8abb1405e3.zip
Fixup stdin-wrapper
* Use a more universal shebang. * Use the template feature of mktemp to avoid silly gymnastics.
Diffstat (limited to 'stdin-wrapper')
-rwxr-xr-xstdin-wrapper9
1 files changed, 3 insertions, 6 deletions
diff --git a/stdin-wrapper b/stdin-wrapper
index 09e9436e..0b52f2ad 100755
--- a/stdin-wrapper
+++ b/stdin-wrapper
@@ -1,4 +1,4 @@
-#!/bin/bash -eu
+#!/usr/bin/env bash
# Author: w0rp <devw0rp@gmail.com>
# Description: This script implements a wrapper for any program which does not accept
@@ -10,11 +10,8 @@
file_extension="$1"
shift
-temp_file=`mktemp`
-mv "$temp_file" "$temp_file$file_extension"
-temp_file="$temp_file$file_extension"
-
-trap "rm $temp_file" EXIT
+temp_file=$(mktemp --tmpdir "ale-XXX$file_extension")
+trap 'rm $temp_file' EXIT
while read -r; do
echo "$REPLY" >> "$temp_file"