bash - Json Parsing using shell script -
bash - Json Parsing using shell script -
this question has reply here:
parsing json unix tools 33 answersafter doing curl query getting output in format shown below:
{"result":[]} {"result":[{"alternative":[{"transcript":"good morning how feeling today"}, {"transcript":"good morning go how feeling today"}, {"transcript":"good morning 2 go how feeling today"}, {"transcript":"good morning how feeling"}, {"transcript":"good morning how today"}],"final":true}], "result_index":0}
i want retrieve "good morning how feeling today" first transcript.
please tell me how it? thanks!
piping curl next emit string in question if have jq installed:
jq -r '.result[0].alternative[0].transcript' | egrep -v '^null$' | head -n 1
json bash shell scripting
Comments
Post a Comment