summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2016-10-10 21:56:07 +0100
committerGitHub <noreply@github.com>2016-10-10 21:56:07 +0100
commit2dee2124085ca3c88bcb550d2d4542224d5886c6 (patch)
tree3b5e09efa68d0f38842db78d772aecbea30721e1
parent151152b446332ebe99654f8264cde337039aaebc (diff)
parentad2ee80eb68955f5c0415d0a784edbfcafa23925 (diff)
downloadale-2dee2124085ca3c88bcb550d2d4542224d5886c6.zip
Merge pull request #83 from neersighted/master
Fixup stdin-wrapper
-rwxr-xr-xstdin-wrapper9
1 files changed, 3 insertions, 6 deletions
diff --git a/stdin-wrapper b/stdin-wrapper
index 09e9436e..c1758df0 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-XXXXXXXXX$file_extension")
+trap 'rm $temp_file' EXIT
while read -r; do
echo "$REPLY" >> "$temp_file"