mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 22:17:54 +00:00
parallel.pod: man page for --shebang-wrap.
This commit is contained in:
parent
a8a451c60c
commit
cf8f1d924b
|
@ -924,7 +924,7 @@ sub read_options {
|
||||||
# @ARGV without --options
|
# @ARGV without --options
|
||||||
# This must be done first as this may exec myself
|
# This must be done first as this may exec myself
|
||||||
if(defined $ARGV[0] and ($ARGV[0]=~/^--shebang / or
|
if(defined $ARGV[0] and ($ARGV[0]=~/^--shebang / or
|
||||||
$ARGV[0]=~/^--shebang-wrap / or
|
$ARGV[0]=~/^--shebang-?wrap / or
|
||||||
$ARGV[0]=~/^--hashbang /)) {
|
$ARGV[0]=~/^--hashbang /)) {
|
||||||
# Program is called from #! line in script
|
# Program is called from #! line in script
|
||||||
# remove --shebang-wrap if it is set
|
# remove --shebang-wrap if it is set
|
||||||
|
@ -3553,6 +3553,7 @@ sub sshlogin_wrap {
|
||||||
if($opt::workdir) {
|
if($opt::workdir) {
|
||||||
$self->{'sshlogin_wrap'} =
|
$self->{'sshlogin_wrap'} =
|
||||||
($pre . "$sshcmd $serverlogin $parallel_env "
|
($pre . "$sshcmd $serverlogin $parallel_env "
|
||||||
|
. ::shell_quote_scalar("mkdir -p ".$self->workdir()."; ")
|
||||||
. ::shell_quote_scalar("cd ".$self->workdir()." && ")
|
. ::shell_quote_scalar("cd ".$self->workdir()." && ")
|
||||||
. ::shell_quote_scalar($next_command_line).";".$post);
|
. ::shell_quote_scalar($next_command_line).";".$post);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1159,6 +1159,55 @@ Use the replacement string I<replace-str> instead of B<{#}> for
|
||||||
job sequence number.
|
job sequence number.
|
||||||
|
|
||||||
|
|
||||||
|
=item B<--shebang>
|
||||||
|
|
||||||
|
=item B<--hashbang>
|
||||||
|
|
||||||
|
GNU B<parallel> can be called as a shebang (#!) command as the first
|
||||||
|
line of a script. The content of the file will be treated as
|
||||||
|
inputsource.
|
||||||
|
|
||||||
|
Like this:
|
||||||
|
|
||||||
|
#!/usr/bin/parallel --shebang -r traceroute
|
||||||
|
|
||||||
|
foss.org.my
|
||||||
|
debian.org
|
||||||
|
freenetproject.org
|
||||||
|
|
||||||
|
B<--shebang> must be set as the first option.
|
||||||
|
|
||||||
|
|
||||||
|
=item B<--shebang-wrap> (alpha testing)
|
||||||
|
|
||||||
|
GNU B<parallel> can parallelize scripts by wrapping the shebang
|
||||||
|
line. If the program can be run like this:
|
||||||
|
|
||||||
|
cat arguments | parallel the_program
|
||||||
|
|
||||||
|
then the script can be changed to:
|
||||||
|
|
||||||
|
#!/usr/bin/parallel --shebang-wrap /the/original/parser --with-options
|
||||||
|
|
||||||
|
E.g.
|
||||||
|
|
||||||
|
#!/usr/bin/parallel --shebang-wrap /usr/bin/python
|
||||||
|
|
||||||
|
If the program can be run like this:
|
||||||
|
|
||||||
|
cat data | parallel --pipe the_program
|
||||||
|
|
||||||
|
then the script can be changed to:
|
||||||
|
|
||||||
|
#!/usr/bin/parallel --shebang-wrap --pipe /the/original/parser --with-options
|
||||||
|
|
||||||
|
E.g.
|
||||||
|
|
||||||
|
#!/usr/bin/parallel --shebang-wrap --pipe /usr/bin/perl -w
|
||||||
|
|
||||||
|
B<--shebang-wrap> must be set as the first option.
|
||||||
|
|
||||||
|
|
||||||
=item B<--shellquote>
|
=item B<--shellquote>
|
||||||
|
|
||||||
Does not run the command but quotes it. Useful for making quoted
|
Does not run the command but quotes it. Useful for making quoted
|
||||||
|
@ -1512,22 +1561,6 @@ Compare these two:
|
||||||
|
|
||||||
See also B<--header>.
|
See also B<--header>.
|
||||||
|
|
||||||
|
|
||||||
=item B<--shebang>
|
|
||||||
|
|
||||||
=item B<--hashbang>
|
|
||||||
|
|
||||||
GNU B<Parallel> can be called as a shebang (#!) command as the first line of a script. Like this:
|
|
||||||
|
|
||||||
#!/usr/bin/parallel --shebang -r traceroute
|
|
||||||
|
|
||||||
foss.org.my
|
|
||||||
debian.org
|
|
||||||
freenetproject.org
|
|
||||||
|
|
||||||
For this to work B<--shebang> must be set as the first option.
|
|
||||||
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1241,6 +1241,70 @@ See also: @strong{man sem}
|
||||||
Use the replacement string @emph{replace-str} instead of @strong{@{#@}} for
|
Use the replacement string @emph{replace-str} instead of @strong{@{#@}} for
|
||||||
job sequence number.
|
job sequence number.
|
||||||
|
|
||||||
|
@item @strong{--shebang}
|
||||||
|
@anchor{@strong{--shebang}}
|
||||||
|
|
||||||
|
@item @strong{--hashbang}
|
||||||
|
@anchor{@strong{--hashbang}}
|
||||||
|
|
||||||
|
GNU @strong{Parallel} can be called as a shebang (#!) command as the first
|
||||||
|
line of a script. The content of the file will be treated as
|
||||||
|
inputsource.
|
||||||
|
|
||||||
|
Like this:
|
||||||
|
|
||||||
|
@verbatim
|
||||||
|
#!/usr/bin/parallel --shebang -r traceroute
|
||||||
|
|
||||||
|
foss.org.my
|
||||||
|
debian.org
|
||||||
|
freenetproject.org
|
||||||
|
@end verbatim
|
||||||
|
|
||||||
|
@strong{--shebang} must be set as the first option.
|
||||||
|
|
||||||
|
@item @strong{--shebang-wrap}
|
||||||
|
@anchor{@strong{--shebang-wrap}}
|
||||||
|
|
||||||
|
GNU @strong{Parallel} can parallelize scripts by wrapping the shebang
|
||||||
|
line. If the program can be run like this:
|
||||||
|
|
||||||
|
@verbatim
|
||||||
|
cat arguments | parallel the_program
|
||||||
|
@end verbatim
|
||||||
|
|
||||||
|
then the script can be changed to:
|
||||||
|
|
||||||
|
@verbatim
|
||||||
|
#!/usr/bin/parallel --shebang-wrap /the/original/parser --with-options
|
||||||
|
@end verbatim
|
||||||
|
|
||||||
|
E.g.
|
||||||
|
|
||||||
|
@verbatim
|
||||||
|
#!/usr/bin/parallel --shebang-wrap /usr/bin/python
|
||||||
|
@end verbatim
|
||||||
|
|
||||||
|
If the program can be run like this:
|
||||||
|
|
||||||
|
@verbatim
|
||||||
|
cat data | parallel --pipe the_program
|
||||||
|
@end verbatim
|
||||||
|
|
||||||
|
then the script can be changed to:
|
||||||
|
|
||||||
|
@verbatim
|
||||||
|
#!/usr/bin/parallel --shebang-wrap --pipe /the/original/parser --with-options
|
||||||
|
@end verbatim
|
||||||
|
|
||||||
|
E.g.
|
||||||
|
|
||||||
|
@verbatim
|
||||||
|
#!/usr/bin/parallel --shebang-wrap --pipe /usr/bin/perl -w
|
||||||
|
@end verbatim
|
||||||
|
|
||||||
|
@strong{--shebang-wrap} must be set as the first option.
|
||||||
|
|
||||||
@item @strong{--shellquote}
|
@item @strong{--shellquote}
|
||||||
@anchor{@strong{--shellquote}}
|
@anchor{@strong{--shellquote}}
|
||||||
|
|
||||||
|
@ -1617,24 +1681,6 @@ Compare these two:
|
||||||
|
|
||||||
See also @strong{--header}.
|
See also @strong{--header}.
|
||||||
|
|
||||||
@item @strong{--shebang}
|
|
||||||
@anchor{@strong{--shebang}}
|
|
||||||
|
|
||||||
@item @strong{--hashbang}
|
|
||||||
@anchor{@strong{--hashbang}}
|
|
||||||
|
|
||||||
GNU @strong{Parallel} can be called as a shebang (#!) command as the first line of a script. Like this:
|
|
||||||
|
|
||||||
@verbatim
|
|
||||||
#!/usr/bin/parallel --shebang -r traceroute
|
|
||||||
|
|
||||||
foss.org.my
|
|
||||||
debian.org
|
|
||||||
freenetproject.org
|
|
||||||
@end verbatim
|
|
||||||
|
|
||||||
For this to work @strong{--shebang} must be set as the first option.
|
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@chapter EXAMPLE: Working as xargs -n1. Argument appending
|
@chapter EXAMPLE: Working as xargs -n1. Argument appending
|
||||||
|
|
Loading…
Reference in a new issue