blob: dd32f46e9e499795b291c677155f9e9e7251370e (
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
35
36
37
38
39
40
|
.TH strjoin 1 2023-07-03 utils
.SH NAME
strjoin \- join words with a word
.SH SYNOPSIS
.B strjoin
.IR separator \ [ word\ ... ]
.SH DESCRIPTION
.B strjoin
is the command line equivalent of
.BR python (1)'s
.B str.join(...)
and java (1)'s
.BR Stream<String>.collect(Collectors.joining(...)) .
It is practically identical to
.B IFS=,;echo "$*"
in
.BR bash (1),
without having to set and reset the
.I IFS
variable.
The first parameter is the separator
that goes between the words.
All other parameters are the words.
(They don't have to be single words, but they are treated as such.)
This is useful for constructing paths,
like for example
.BR java (1)
classpaths for
.BR jar (1)
manifest files,
but also tab-separated value records,
and tons of other things.
.SH EXAMPLES
.B strjoin , foo bar baz
|