I have a command in a bash pipeline that returns me a JSON like the follow:
$ aws iot get-registration-code
{
"registrationCode": "abcd635"
}
I would to have the value abcd635
inside a variable code
that I can use somewhere in the code.
//Pseudo code
regCode = aws iot get-registration-code;
code = regCode.registrationCode
do some stuf with the code variable.
Is that a way to achieve this without the use of jq
? I think it is because jq is too much for this simple JSON.
Read
man cut
,man tr
and do something like: