Skip to content

Instantly share code, notes, and snippets.

Created January 19, 2015 05:34
stdin
_jshon() {
shopt -s lastpipe
typeset input
{ tee /dev/fd/3 | jshon "$@" >&4; } 3>&1 |
input=$(</dev/fd/0)
((PIPESTATUS)) && printf %s "$input" >&2
} 4>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment