Released as 20240522 ('Tbilisi')
[parallel.git] / src / parcat.pod
blobf41e53044f05e4c9f0a18ff91516820b61d849c9
1 #!/usr/bin/perl
3 # SPDX-FileCopyrightText: 2021-2024 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
4 # SPDX-License-Identifier: GFDL-1.3-or-later
5 # SPDX-License-Identifier: CC-BY-SA-4.0
7 =head1 NAME
9 parcat - cat files or fifos in parallel
11 =head1 SYNOPSIS
13 B<parcat> [--rm] [-#] file(s) [-#] file(s)
15 =head1 DESCRIPTION
17 GNU B<parcat> reads files or fifos in parallel. It writes full lines
18 so there will be no problem with mixed-half-lines which you risk if
19 you use:
21 (cat file1 & cat file2 &) | ...
23 It is faster than doing:
25 parallel -j0 --lb cat ::: file*
27 Arguments can be given on the command line or passed in on stdin
28 (standard input).
30 =head1 OPTIONS
32 =over 9
34 =item -B<#>
36 Arguments following this will be sent to the file descriptor B<#>. E.g.
38 parcat -1 stdout1 stdout2 -2 stderr1 stderr2
40 will send I<stdout1> and I<stdout2> to stdout (standard output = file
41 descriptor 1), and send I<stderr1> and I<stderr2> to stderr (standard
42 error = file descriptor 2).
44 =item --rm
46 Remove files after opening. As soon as the files are opened, unlink
47 the files.
49 =back
51 =head1 EXAMPLES
53 =head2 Simple line buffered output
55 B<traceroute> will often print half a line. If run in parallel, two
56 instances may half-lines of their output. This can be avoided by
57 saving the output to a fifo and then using B<parcat> to read the two
58 fifos in parallel:
60 mkfifo freenetproject.org.fifo tange.dk.fifo
61 traceroute freenetproject.org > freenetproject.org.fifo &
62 traceroute tange.dk > tange.dk.fifo &
63 parcat --rm *fifo
66 =head1 REPORTING BUGS
68 GNU B<parcat> is part of GNU B<parallel>. Report bugs to
69 <bug-parallel@gnu.org>.
72 =head1 AUTHOR
74 Copyright (C) 2016-2024 Ole Tange, http://ole.tange.dk and Free
75 Software Foundation, Inc.
77 =head1 LICENSE
79 This program is free software; you can redistribute it and/or modify
80 it under the terms of the GNU General Public License as published by
81 the Free Software Foundation; either version 3 of the License, or
82 at your option any later version.
84 This program is distributed in the hope that it will be useful,
85 but WITHOUT ANY WARRANTY; without even the implied warranty of
86 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
87 GNU General Public License for more details.
89 You should have received a copy of the GNU General Public License
90 along with this program. If not, see <http://www.gnu.org/licenses/>.
92 =head2 Documentation license I
94 Permission is granted to copy, distribute and/or modify this
95 documentation under the terms of the GNU Free Documentation License,
96 Version 1.3 or any later version published by the Free Software
97 Foundation; with no Invariant Sections, with no Front-Cover Texts, and
98 with no Back-Cover Texts. A copy of the license is included in the
99 file LICENSES/GFDL-1.3-or-later.txt.
101 =head2 Documentation license II
103 You are free:
105 =over 9
107 =item B<to Share>
109 to copy, distribute and transmit the work
111 =item B<to Remix>
113 to adapt the work
115 =back
117 Under the following conditions:
119 =over 9
121 =item B<Attribution>
123 You must attribute the work in the manner specified by the author or
124 licensor (but not in any way that suggests that they endorse you or
125 your use of the work).
127 =item B<Share Alike>
129 If you alter, transform, or build upon this work, you may distribute
130 the resulting work only under the same, similar or a compatible
131 license.
133 =back
135 With the understanding that:
137 =over 9
139 =item B<Waiver>
141 Any of the above conditions can be waived if you get permission from
142 the copyright holder.
144 =item B<Public Domain>
146 Where the work or any of its elements is in the public domain under
147 applicable law, that status is in no way affected by the license.
149 =item B<Other Rights>
151 In no way are any of the following rights affected by the license:
153 =over 9
155 =item *
157 Your fair dealing or fair use rights, or other applicable
158 copyright exceptions and limitations;
160 =item *
162 The author's moral rights;
164 =item *
166 Rights other persons may have either in the work itself or in
167 how the work is used, such as publicity or privacy rights.
169 =back
171 =item B<Notice>
173 For any reuse or distribution, you must make clear to others the
174 license terms of this work.
176 =back
178 A copy of the full license is included in the file as
179 LICENCES/CC-BY-SA-4.0.txt
182 =head1 DEPENDENCIES
184 GNU B<parcat> uses Perl.
187 =head1 SEE ALSO
189 B<cat>(1), B<parallel>(1)
191 =cut