Last active
November 10, 2017 12:21
-
-
Save hauleth/8e1da4808e93e679cc34d920855b7c3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eo pipefail | |
in="$(mktemp)" | |
out="$(mktemp)" | |
trap "rm '$in' '$out'" EXIT | |
cat /dev/stdin > "$in" | |
"$@" < "$in" 2>/dev/null > "$out" && cat "$out" || cat "$in" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment