blob: 8ca93587dcb79619fb20f0d8ded15fbdc8726e5d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
.TH reduce 1 2023-05-13 utils
.SH NAME
reduce \- apply a command to multiple arguments
.SH SYNOPSIS
.B reduce
.IR command\ accumulator \ [ arg \ ... ]
.SH DESCRIPTION
.B reduce
applies the first parameter to all other arguments in turn.
The first parameter is taken to be a command
that accepts two parameters,
which will be the accumulator
and all other arguments
one after another, respectively.
With each argument, the accumulator will be replaced with the output of the evaluation of the first parameter.
Admittedly, this is not as useful as it could be.
.SH EXAMPLES
.B reduce
.I 'echo -n' 0 1 2 3
.SH SEE ALSO
.BR map (1),\ xargs (1)
|