Differences

This shows you the differences between two versions of the page.

Link to this comparison view

shell [2019/01/17 21:12]
dblume [jq Tips]
shell [2019/01/17 21:25] (current)
dblume [jq Tips]
Line 496: Line 496:
 <code> <code>
 $ jq '.fruits|del(.count,.open)|with_entries(.value |= .price)' fruits.txt $ jq '.fruits|del(.count,.open)|with_entries(.value |= .price)' fruits.txt
 +{
 +  "apple": 2,
 +  "banana": 3
 +}
 +
 +# with_entries(f) is an alias for to_entries | map(x) | from_entries
 +
 +jq '.fruits|del(.count,.open)|to_entries|map(.value |= .price)|from_entries' f
 { {
   "apple": 2,   "apple": 2,
shell.txt · Last modified: 2019/01/17 21:25 by dblume
 
Recent changes RSS feed Driven by DokuWiki