Quantcast
Channel: Question and Answer » json
Viewing all articles
Browse latest Browse all 148

Saving a piped value went wrong

$
0
0

I installed jq to handle some JSON with bash.
But somehow piping the JSON string to jq in combination with saving it’s output to another variable went wrong.

TEST='{"foo": "bar"}'
PB_SIG=$TEST | jq '.foo'
echo $PB_SIG

It outputs just the whole TEST JSON string. Somebody?


Viewing all articles
Browse latest Browse all 148

Trending Articles