all
for filters> all {flags} (predicate)
predicate
: a closure that must evaluate to a booleaninput | output |
---|---|
list<any> | bool |
table | bool |
Check if each row's status is the string 'UP'
> [[status]; [UP] [UP]] |all {|el| $el.status==UP }
true
Check that each item is a string
> [foobar2baz] |all {|| ($in|describe) =='string' }
false
Check that all values are equal to twice their index
> [0246] |enumerate|all {|i| $i.item==$i.index*2 }
true
Check that all of the values are even, using a stored closure
>letcond= {|el| ($elmod2) ==0 }; [2468] |all$cond
true
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/all.html