0
İşte burada sorun, hepsini basılması gerekirken terminali sadece ilk JSON öğesi half_damage_to:[name|fighting
çıktısını olmasıdır kodumKabuk Senaryo 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##*|}
}
olduğunu. half_damage_to
içinde bulunan JSON sözlüğündeki tüm öğeleri yazdırmak için tam olarak nasıl alabilirim?