Drop While

Remove elements from the start of an array while a condition is true.

Code

General
echo "$arr" | jq --argjson t "$threshold" '. as $a | (first(range(length) | select($a[.] >= $t)) // length) as $i | .[$i:]'

Parameters

Array (JSON)

Drop while less than threshold

Server

More Bash Snippets