0
Hier ist mein CodeShell Script Json, Mac
function poke() {
json="curl -s -X GET http://pokeapi.co/api/v2/type/bug.json";
prop="half_damage_to"
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##*|}
}
Das Problem hierbei ist, dass das Endgerät nur die ersten JSON Artikel ausdrucken, half_damage_to:[name|fighting
wenn es sie alle zu drucken werden soll. Wie genau bekomme ich es, alle Elemente im JSON-Wörterbuch zu drucken, die innerhalb half_damage_to
liegen?