mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 23:47:53 +00:00
parallel: --shebang now works even if crazy people name their executable "<> or space.
This commit is contained in:
parent
f8d0d43c7b
commit
2c29653012
|
@ -860,10 +860,9 @@ sub read_options {
|
||||||
# Program is called from #! line in script
|
# Program is called from #! line in script
|
||||||
$ARGV[0]=~s/^--shebang *//; # remove --shebang if it is set
|
$ARGV[0]=~s/^--shebang *//; # remove --shebang if it is set
|
||||||
$ARGV[0]=~s/^--hashbang *//; # remove --hashbang if it is set
|
$ARGV[0]=~s/^--hashbang *//; # remove --hashbang if it is set
|
||||||
my $argfile = pop @ARGV;
|
my $argfile = shell_quote_scalar(pop @ARGV);
|
||||||
# exec myself to split $ARGV[0] into separate fields
|
# exec myself to split $ARGV[0] into separate fields
|
||||||
exec "$0 --skip-first-line -a $argfile @ARGV";
|
exec "$0 --skip-first-line -a $argfile @ARGV";
|
||||||
#exec "tail -n +1 $argfile | $0 @ARGV";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Getopt::Long::Configure("bundling","pass_through");
|
Getopt::Long::Configure("bundling","pass_through");
|
||||||
|
|
|
@ -21,14 +21,14 @@ chmod 755 /tmp/shebang
|
||||||
/tmp/shebang
|
/tmp/shebang
|
||||||
|
|
||||||
echo '### Test of #! with 2 files as input (2 columns)'
|
echo '### Test of #! with 2 files as input (2 columns)'
|
||||||
cat >/tmp/shebang <<EOF
|
cat >'/tmp/she <bang>"' <<EOF
|
||||||
#!/usr/local/bin/parallel --shebang -rk --xapply -a /tmp/123 echo
|
#!/usr/local/bin/parallel --shebang -rk --xapply -a /tmp/123 echo
|
||||||
A
|
A
|
||||||
B
|
B
|
||||||
C
|
C
|
||||||
EOF
|
EOF
|
||||||
chmod 755 /tmp/shebang
|
chmod 755 '/tmp/she <bang>"'
|
||||||
seq 1 3 >/tmp/123
|
seq 1 3 >/tmp/123
|
||||||
/tmp/shebang
|
'/tmp/she <bang>"'
|
||||||
echo '### bug #36595: silent loss of input with --pipe and --sshlogin'
|
echo '### bug #36595: silent loss of input with --pipe and --sshlogin'
|
||||||
seq 10000 | xargs | parallel --pipe -S 10/localhost cat | wc
|
seq 10000 | xargs | parallel --pipe -S 10/localhost cat | wc
|
||||||
|
|
Loading…
Reference in a new issue