Skip to content

Instantly share code, notes, and snippets.

@mrsrvman
Created March 22, 2021 16:50
Show Gist options
  • Save mrsrvman/2414828a91d4e8eb31902b3b794f2f77 to your computer and use it in GitHub Desktop.
Save mrsrvman/2414828a91d4e8eb31902b3b794f2f77 to your computer and use it in GitHub Desktop.
# Use `jq` with both JSON and non-JSON lines.
function jjq {
jq -R -r "${1:-.} as \$line | try fromjson catch \$line"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment