2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: all?
|
|
|
|
layout: command
|
2022-03-04 13:10:09 +01:00
|
|
|
version: 0.59.1
|
2022-02-14 03:22:51 +01:00
|
|
|
---
|
2021-05-30 02:57:04 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Test if every element of the input matches a predicate.
|
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
|
|
|
```> all? (predicate)```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
- `predicate`: the predicate that must match
|
2021-05-30 02:57:04 +02:00
|
|
|
|
|
|
|
## Examples
|
2022-02-14 03:22:51 +01:00
|
|
|
|
|
|
|
Find if services are running
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
|
|
|
> echo [[status]; [UP] [UP]] | all? status == UP
|
2022-02-14 03:22:51 +01:00
|
|
|
```
|
2021-05-30 02:57:04 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Check that all values are even
|
2021-05-30 02:57:04 +02:00
|
|
|
```shell
|
|
|
|
> echo [2 4 6 8] | all? ($it mod 2) == 0
|
2022-02-14 03:22:51 +01:00
|
|
|
```
|