@kyanny's blog

My thoughts, my life. Views/opinions are my own.

2014-05-28から1日間の記事一覧

jq で条件にマッチするデータ構造だけ出力する

$ curl http://b.hatena.ne.jp/entry/json/?url=http://localhost/ | \ jq '.bookmarks[] | if .user == "otsune" then . else empty end' { "tags": [], "user": "otsune", "timestamp": "2013/02/26 16:43:11", "comment": "" } bookmarks というキーに Ar…