blob: 1d7a5f5805420bb4338bc851b265a6ce048d3ce9 (
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
29
30
31
32
33
34
|
.TH map 1 2023-05-13 utils
.SH NAME
map \- apply a command to multiple arguments
.SH SYNOPSIS
.B map
.IR command \ [ arg \ ... ]
.SH DESCRIPTION
.B map
applies the first parameter to each other argument in turn.
The first parameter is evaluated and may contain
.I $1
anywhere, which will be replaced with the other arguments
one after another.
If it doesn't contain it, it will be supplied with the argument as its last, and possibly only, parameter.
Unlike
.BR xargs (1),\ map
reads the parameters from the command line
rather than from stdin.
.SH EXAMPLES
.B map
echo
.I 1 2 3
.BR map \ 'mv\ "$1"\ dir/'
.I arg1 arg2 arg3
.SH SEE ALSO
.BR xargs (1),\ reduce (1),\ fmap (1),\ mapl (1)
|