take while

Take elements of the input while a predicate is true.

Signature

> take while (predicate)

Parameters

  • predicate: the predicate that element(s) must match

Examples

Take while the element is negative

> echo [-1 -2 9 1] | take while $it < 0