There is a JSON of this type.
{"response":{"upload_url":"url"}} How can I pick up url using only shell? I did not understand JSON.awk, jq is not supported in my case
To parse JSON on the command line, use the Jshon utility, it allows you to easily extract fields from an object of arbitrary complexity with automatic decoding of strings (if necessary). The program is written in pure C and only the Jansson library (apart from the standard libc ) requires dependencies.
For your case, the call will be like this:
echo '{"response":{"upload_url":"url"}}' | jshon -e response -e upload_url -u It can be found in the Debian archive in the package of the same name.
upl=$(cut -d'"' -f6 <<<$mus) upload_url=$(echo $upl | tr -d '\') Works
There is a cool fx https://github.com/antonmedv/fx
$ echo '[1,2,3]' | fx "this.map(x => x * 2)" [2, 4, 6] 
Source: https://ru.stackoverflow.com/questions/704080/
All Articles
grep -oP '"upload_url":"\K[^"]+'? - Mike\K- the beginning of the captured coincidence I don’t even know where it’s described, it’s from the pcre extension, but I don’t find any mention even of Larry Walla. goo.gl/XXogWS (chapter 5) - Mike