我有以下的JSON文件:bash腳本過濾JSON文本
{
"error": 0,
"data": {
"0": {
"orderid": "40007600",
"price": "9.99",
"listingname": "iPhone 8",
"smallphoto": "https://images-eu.ssl-images-amazon.com/images/I/51b5iaLTjgL._SL160_.jpg",
"photo": "https://images-eu.ssl-images-amazon.com/images/I/51b5iaLTjgL.jpg"
},
"1": {
"orderid": "40007598",
"price": "9.99",
"listingname": "iPhone 8 Plus",
"smallphoto": "https://images-eu.ssl-images-amazon.com/images/I/51CVLqsSNkL._SL160_.jpg",
"photo": "https://images-eu.ssl-images-amazon.com/images/I/51CVLqsSNkL.jpg"
},
"4": {
"orderid": "40007595",
"price": "9.39",
"listingname": "Nadelflaschen",
"smallphoto": "https://images-eu.ssl-images-amazon.com/images/I/41OHDP2rAeL._SL160_.jpg",
"photo": "https://images-eu.ssl-images-amazon.com/images/I/41OHDP2rAeL.jpg"
},
}
}
我如何可以篩選出bash腳本的一切,所以我得到「smallphoto」的所有圖像的URL到一個文本文件?
f.e.來自「Nadelflaschen」的https://images-eu.ssl-images-amazon.com/images/I/41OHDP2rAeL.SL160.jpg
我嘗試了awk和jq命令。但我只是爲了理解jq語法而傾倒。
awk是可能的,但我只得到與反斜槓的未過濾鏈接,這是行不通的。
歡迎StackOverflow上。不幸的是,這既不是教程網站,也不是網絡搜索替代品我們可以幫助解決[某些問題](https://stackoverflow.com/help/on-topic),但它是**你的**工作[付出一些努力](http://meta.stackoverflow.com/questions/261592)首先,包括。小學[(重新)搜索](https://google.com/)。大多數新手的問題不是獨一無二的,並且已經被多次回答。 –