Created
December 3, 2021 12:37
-
-
Save hkupty/a1f2073085bdb4c56caaad3cd96620cd to your computer and use it in GitHub Desktop.
bash function to extract json values, either using stdin or argument
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
function x_json() { | |
jq -creM "${1}" <([ -z ${2+x} ] && cat - || echo "${2}") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment