summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2009-10-10 11:48:09 +0300
committerLars Wirzenius <liw@liw.fi>2009-10-10 11:48:09 +0300
commitc9ecc35c1556cadc943d9a6482b692c697eaa505 (patch)
tree2350e55d5140a33be00d40131a3380cdf71cf0b8
parent107801a5fd8adc50c11ac1f17d078358a2c9a311 (diff)
downloadextrautils-c9ecc35c1556cadc943d9a6482b692c697eaa505.tar.gz
Wrote a simplistic onerror script.
-rwxr-xr-xonerror12
1 files changed, 12 insertions, 0 deletions
diff --git a/onerror b/onerror
new file mode 100755
index 0000000..3e5a927
--- /dev/null
+++ b/onerror
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+temp=$(mktemp)
+"$@" > "$temp" 2>&1
+ret=$?
+if [ $ret != 0 ]
+then
+ cat "$temp" 1>&2
+fi
+rm -f "$temp"
+exit $ret
+