The each function is used to iterate through each item of an array. Comparable to a foreach loop.
each
The current item is accessible via the $this variable.
$this
The response values from an each call is ignored. each is useful when you want to modify values in-place.
Most commonly used with:
search
recursive descent
--root flag
--root
$ echo '[1,2,3]' | dasel -i json 'each($this = $this+1)' [ 2, 3, 4 ]
Last updated 1 month ago