mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-12-23 13:17:54 +00:00
Fixed with test: bug #36595: silent loss of input with --pipe and --sshlogin.
This commit is contained in:
parent
9489733155
commit
38ccd3f193
11
src/parallel
11
src/parallel
|
@ -66,6 +66,11 @@ my @fhlist;
|
||||||
if(not @fhlist) {
|
if(not @fhlist) {
|
||||||
@fhlist = (*STDIN);
|
@fhlist = (*STDIN);
|
||||||
}
|
}
|
||||||
|
if($::opt_skip_first_line) {
|
||||||
|
# Skip the first line for the first file handle
|
||||||
|
my $fh = $fhlist[0];
|
||||||
|
<$fh>;
|
||||||
|
}
|
||||||
if($::opt_header and not $::opt_pipe) {
|
if($::opt_header and not $::opt_pipe) {
|
||||||
my $fh = $fhlist[0];
|
my $fh = $fhlist[0];
|
||||||
# split with colsep or \t
|
# split with colsep or \t
|
||||||
|
@ -536,6 +541,7 @@ sub options_hash {
|
||||||
# Shebang #!/usr/bin/parallel --shebang
|
# Shebang #!/usr/bin/parallel --shebang
|
||||||
"shebang|hashbang" => \$::opt_shebang,
|
"shebang|hashbang" => \$::opt_shebang,
|
||||||
"Y" => \$::opt_retired,
|
"Y" => \$::opt_retired,
|
||||||
|
"skip-first-line" => \$::opt_skip_first_line,
|
||||||
"header=s" => \$::opt_header,
|
"header=s" => \$::opt_header,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -856,7 +862,8 @@ sub read_options {
|
||||||
$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 = pop @ARGV;
|
||||||
# exec myself to split $ARGV[0] into separate fields
|
# exec myself to split $ARGV[0] into separate fields
|
||||||
exec "tail -n +1 $argfile | $0 @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");
|
||||||
|
@ -2565,7 +2572,7 @@ sub simultaneous_sshlogin {
|
||||||
my $wanted_processes = shift;
|
my $wanted_processes = shift;
|
||||||
my $sshcmd = $self->sshcommand();
|
my $sshcmd = $self->sshcommand();
|
||||||
my $serverlogin = $self->serverlogin();
|
my $serverlogin = $self->serverlogin();
|
||||||
my $cmd = "$sshcmd $serverlogin echo simultaneouslogin 2>&1 &"x$wanted_processes;
|
my $cmd = "$sshcmd $serverlogin echo simultaneouslogin </dev/null 2>&1 &"x$wanted_processes;
|
||||||
::debug("Trying $wanted_processes logins at $serverlogin");
|
::debug("Trying $wanted_processes logins at $serverlogin");
|
||||||
open (SIMUL, "($cmd)|grep simultaneouslogin | wc -l|") or
|
open (SIMUL, "($cmd)|grep simultaneouslogin | wc -l|") or
|
||||||
::die_bug("simultaneouslogin");
|
::die_bug("simultaneouslogin");
|
||||||
|
|
|
@ -20,7 +20,7 @@ EOF
|
||||||
chmod 755 /tmp/shebang
|
chmod 755 /tmp/shebang
|
||||||
/tmp/shebang
|
/tmp/shebang
|
||||||
|
|
||||||
echo '### Test of #! with 2 files as input'
|
echo '### Test of #! with 2 files as input (2 columns)'
|
||||||
cat >/tmp/shebang <<EOF
|
cat >/tmp/shebang <<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
|
||||||
|
@ -30,4 +30,5 @@ EOF
|
||||||
chmod 755 /tmp/shebang
|
chmod 755 /tmp/shebang
|
||||||
seq 1 3 >/tmp/123
|
seq 1 3 >/tmp/123
|
||||||
/tmp/shebang
|
/tmp/shebang
|
||||||
|
echo '### bug #36595: silent loss of input with --pipe and --sshlogin'
|
||||||
|
seq 10000 | xargs | parallel --pipe -S 10/localhost cat | wc
|
||||||
|
|
|
@ -6,7 +6,9 @@ C
|
||||||
A
|
A
|
||||||
B
|
B
|
||||||
C
|
C
|
||||||
### Test of #! with 2 files as input
|
### Test of #! with 2 files as input (2 columns)
|
||||||
A 1
|
A 1
|
||||||
B 2
|
B 2
|
||||||
C 3
|
C 3
|
||||||
|
### bug #36595: silent loss of input with --pipe and --sshlogin
|
||||||
|
1 10000 48894
|
||||||
|
|
Loading…
Reference in a new issue