This file is indexed.

/usr/share/doc/parallel/sem.html is in parallel 20130922-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">



<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="#OPTIONS">OPTIONS</a></li>
  <li><a href="#EXAMPLE:-Gzipping-.log">EXAMPLE: Gzipping *.log</a></li>
  <li><a href="#EXAMPLE:-Protecting-pod2html-from-itself">EXAMPLE: Protecting pod2html from itself</a></li>
  <li><a href="#BUGS">BUGS</a></li>
  <li><a href="#REPORTING-BUGS">REPORTING BUGS</a></li>
  <li><a href="#AUTHOR">AUTHOR</a></li>
  <li><a href="#LICENSE">LICENSE</a>
    <ul>
      <li><a href="#Documentation-license-I">Documentation license I</a></li>
      <li><a href="#Documentation-license-II">Documentation license II</a></li>
    </ul>
  </li>
  <li><a href="#DEPENDENCIES">DEPENDENCIES</a></li>
  <li><a href="#SEE-ALSO">SEE ALSO</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p>sem - semaphore for executing shell command lines in parallel</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<p><b>sem</b> [--fg] [--id &lt;id&gt;] [--timeout &lt;secs&gt;] [-j &lt;num&gt;] [--wait] command</p>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>GNU <b>sem</b> is an alias for GNU <b>parallel --semaphore</b>.</p>

<p>It works as a tool for executing shell commands in parallel. GNU <b>sem</b> acts as a counting semaphore. When GNU <b>sem</b> is called with command it will start the command in the background. When <i>num</i> number of commands are running in the background, GNU <b>sem</b> will wait for one of these to complete before starting another command.</p>

<p>Before looking at the options you may want to check out the examples after the list of options. That will give you an idea of what GNU <b>sem</b> is capable of.</p>

<h1 id="OPTIONS">OPTIONS</h1>

<dl>

<dt id="command"><i>command</i></dt>
<dd>

<p>Command to execute. The command may be followed by arguments for the command.</p>

</dd>
<dt id="bg"><b>--bg</b></dt>
<dd>

<p>Run command in background thus GNU <b>parallel</b> will not wait for completion of the command before exiting. This is the default.</p>

<p>See also: <b>--fg</b></p>

</dd>
<dt id="j-N"><b>-j</b> <i>N</i></dt>
<dd>

<p>Run up to N commands in parallel. Default is 1 thus acting like a mutex.</p>

</dd>
<dt id="jobs-N"><b>--jobs</b> <i>N</i></dt>
<dd>

</dd>
<dt id="j-N1"><b>-j</b> <i>N</i></dt>
<dd>

</dd>
<dt id="max-procs-N"><b>--max-procs</b> <i>N</i></dt>
<dd>

</dd>
<dt id="P-N"><b>-P</b> <i>N</i></dt>
<dd>

<p>Run up to N commands in parallel. Default is 1 thus acting like a mutex.</p>

</dd>
<dt id="jobs-N1"><b>--jobs</b> <i>+N</i></dt>
<dd>

</dd>
<dt id="j-N2"><b>-j</b> <i>+N</i></dt>
<dd>

</dd>
<dt id="max-procs-N1"><b>--max-procs</b> <i>+N</i></dt>
<dd>

</dd>
<dt id="P-N1"><b>-P</b> <i>+N</i></dt>
<dd>

<p>Add N to the number of CPU cores. Run up to this many jobs in parallel. For compute intensive jobs <b>-j</b> +0 is useful as it will run number-of-cpu-cores jobs simultaneously.</p>

</dd>
<dt id="jobs--N"><b>--jobs</b> <i>-N</i></dt>
<dd>

</dd>
<dt id="j--N"><b>-j</b> <i>-N</i></dt>
<dd>

</dd>
<dt id="max-procs--N"><b>--max-procs</b> <i>-N</i></dt>
<dd>

</dd>
<dt id="P--N"><b>-P</b> <i>-N</i></dt>
<dd>

<p>Subtract N from the number of CPU cores. Run up to this many jobs in parallel. If the evaluated number is less than 1 then 1 will be used. See also <b>--use-cpus-instead-of-cores</b>.</p>

</dd>
<dt id="jobs-N2"><b>--jobs</b> <i>N</i>%</dt>
<dd>

</dd>
<dt id="j-N3"><b>-j</b> <i>N</i>%</dt>
<dd>

</dd>
<dt id="max-procs-N2"><b>--max-procs</b> <i>N</i>%</dt>
<dd>

</dd>
<dt id="P-N2"><b>-P</b> <i>N</i>%</dt>
<dd>

<p>Multiply N% with the number of CPU cores. Run up to this many jobs in parallel. If the evaluated number is less than 1 then 1 will be used. See also <b>--use-cpus-instead-of-cores</b>.</p>

</dd>
<dt id="jobs-procfile"><b>--jobs</b> <i>procfile</i></dt>
<dd>

</dd>
<dt id="j-procfile"><b>-j</b> <i>procfile</i></dt>
<dd>

</dd>
<dt id="max-procs-procfile"><b>--max-procs</b> <i>procfile</i></dt>
<dd>

</dd>
<dt id="P-procfile"><b>-P</b> <i>procfile</i></dt>
<dd>

<p>Read parameter from file. Use the content of <i>procfile</i> as parameter for <i>-j</i>. E.g. <i>procfile</i> could contain the string 100% or +2 or 10.</p>

</dd>
<dt id="semaphorename-name"><b>--semaphorename</b> <i>name</i></dt>
<dd>

</dd>
<dt id="id-name"><b>--id</b> <i>name</i></dt>
<dd>

<p>Use <b>name</b> as the name of the semaphore. Default is the name of the controlling tty (output from <b>tty</b>).</p>

<p>The default normally works as expected when used interactively, but when used in a script <i>name</i> should be set. <i>$$</i> or <i>my_task_name</i> are often a good value.</p>

<p>The semaphore is stored in ~/.parallel/semaphores/</p>

</dd>
<dt id="fg"><b>--fg</b></dt>
<dd>

<p>Do not put command in background.</p>

</dd>
<dt id="timeout-secs-not-implemented"><b>--timeout</b> <i>secs</i> (not implemented)</dt>
<dd>

</dd>
<dt id="t-secs-not-implemented"><b>-t</b> <i>secs</i> (not implemented)</dt>
<dd>

<p>If the semaphore is not released within <i>secs</i> seconds, take it anyway.</p>

</dd>
<dt id="wait"><b>--wait</b></dt>
<dd>

</dd>
<dt id="w"><b>-w</b></dt>
<dd>

<p>Wait for all commands to complete.</p>

</dd>
</dl>

<h1 id="EXAMPLE:-Gzipping-.log">EXAMPLE: Gzipping *.log</h1>

<p>Run one gzip process per CPU core. Block until a CPU core becomes available.</p>

<pre><code>  for i in *.log ; do
    echo $i
    sem -j+0 gzip $i &quot;;&quot; echo done
  done
  sem --wait</code></pre>

<h1 id="EXAMPLE:-Protecting-pod2html-from-itself">EXAMPLE: Protecting pod2html from itself</h1>

<p>pod2html creates two files: pod2htmd.tmp and pod2htmi.tmp which it does not clean up. It uses these two files for a short time. But if you run multiple pod2html in parallel (e.g. in a Makefile with make -j) you need to protect pod2html from running twice at the same time. <b>sem</b> running as a mutex will do just that:</p>

<pre><code>  sem --fg --id pod2html pod2html foo.pod &gt; foo.html
  sem --fg --id pod2html rm -f pod2htmd.tmp pod2htmi.tmp</code></pre>

<h1 id="BUGS">BUGS</h1>

<p>None known.</p>

<h1 id="REPORTING-BUGS">REPORTING BUGS</h1>

<p>Report bugs to &lt;bug-parallel@gnu.org&gt;.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Copyright (C) 2010,2011,2012,2013 Ole Tange, http://ole.tange.dk and Free Software Foundation, Inc.</p>

<h1 id="LICENSE">LICENSE</h1>

<p>Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc.</p>

<p>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or at your option any later version.</p>

<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>

<p>You should have received a copy of the GNU General Public License along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</p>

<h2 id="Documentation-license-I">Documentation license I</h2>

<p>Permission is granted to copy, distribute and/or modify this documentation under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the file fdl.txt.</p>

<h2 id="Documentation-license-II">Documentation license II</h2>

<p>You are free:</p>

<dl>

<dt id="to-Share"><b>to Share</b></dt>
<dd>

<p>to copy, distribute and transmit the work</p>

</dd>
<dt id="to-Remix"><b>to Remix</b></dt>
<dd>

<p>to adapt the work</p>

</dd>
</dl>

<p>Under the following conditions:</p>

<dl>

<dt id="Attribution"><b>Attribution</b></dt>
<dd>

<p>You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).</p>

</dd>
<dt id="Share-Alike"><b>Share Alike</b></dt>
<dd>

<p>If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license.</p>

</dd>
</dl>

<p>With the understanding that:</p>

<dl>

<dt id="Waiver"><b>Waiver</b></dt>
<dd>

<p>Any of the above conditions can be waived if you get permission from the copyright holder.</p>

</dd>
<dt id="Public-Domain"><b>Public Domain</b></dt>
<dd>

<p>Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.</p>

</dd>
<dt id="Other-Rights"><b>Other Rights</b></dt>
<dd>

<p>In no way are any of the following rights affected by the license:</p>

<ul>

<li><p>Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;</p>

</li>
<li><p>The author&#39;s moral rights;</p>

</li>
<li><p>Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.</p>

</li>
</ul>

</dd>
</dl>

<dl>

<dt id="Notice"><b>Notice</b></dt>
<dd>

<p>For any reuse or distribution, you must make clear to others the license terms of this work.</p>

</dd>
</dl>

<p>A copy of the full license is included in the file as cc-by-sa.txt.</p>

<h1 id="DEPENDENCIES">DEPENDENCIES</h1>

<p>GNU <b>sem</b> uses Perl, and the Perl modules Getopt::Long, Symbol, Fcntl.</p>

<h1 id="SEE-ALSO">SEE ALSO</h1>

<p><b>parallel</b>(1)</p>


</body>

</html>