You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
322 B
10 lines
322 B
#!/bin/bash |
|
function jsonval { |
|
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` |
|
echo ${temp##*|} |
|
} |
|
|
|
json=`curl -s -X GET $1` |
|
prop='$2' |
|
val=`jsonval` |
|
echo $val
|
|
|