Created
May 14, 2019 04:40
-
-
Save nna774/11942cfda11657dc4c9b7cab20188460 to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
# どうせjsonっぽいものにしか使わないから有限長でしょ。 | |
STDIN=$(cat) | |
echo "${STDIN}" | jq "$@" > /dev/null 2>&1 | |
if [ $? -eq 0 ]; then | |
# 前段で出力をバッファしたりすると、色とかが消えちゃうのでもう一回実行する。 | |
echo "${STDIN}" | jq "$@" | |
else | |
echo "${STDIN}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment