'Read multi-line output into other variable in shell
I have an output from a process that looks like this:
{
"v1": "x0482030ssj09645j34"
}
I need to parse this output in order to extract x0482030ssj09645j34.
Any help is appreciated. Thanks!
Solution 1:[1]
jq is a handy JSON parser. In this case, you can do
your_process | jq -r '.v1'
to output just that value
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | glenn jackman |
