mirror of
https://github.com/nushell/nushell.git
synced 2024-12-02 13:24:30 +01:00
23 lines
341 B
Markdown
23 lines
341 B
Markdown
|
---
|
||
|
title: keep while
|
||
|
layout: command
|
||
|
version: 0.59.0
|
||
|
---
|
||
|
|
||
|
Keep elements of the input while a predicate is true.
|
||
|
|
||
|
## Signature
|
||
|
|
||
|
```> keep while (predicate)```
|
||
|
|
||
|
## Parameters
|
||
|
|
||
|
- `predicate`: the predicate that kept element must not match
|
||
|
|
||
|
## Examples
|
||
|
|
||
|
Keep while the element is negative
|
||
|
```shell
|
||
|
> echo [-1 -2 9 1] | keep while $it < 0
|
||
|
```
|