From bbc9a53ea5fc746a0a3ef7e8733dfcd61ff05eea Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Thu, 27 Dec 2012 23:06:17 +0100 Subject: [PATCH] Fixed bug #34241: --pipe should not spawn unneeded processes. --- src/parallel | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/parallel b/src/parallel index 5801b89f..63b3d5d2 100755 --- a/src/parallel +++ b/src/parallel @@ -3875,6 +3875,9 @@ sub start { . $job->seq() . "): $command\n"); if($opt::pipe) { my ($in); + $command = q{ + eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv _FIRST_CHAR_FILE /tmp/$$.first_char_file || echo export _FIRST_CHAR_FILE=/tmp/$$.first_char_file`; + dd bs=1 count=1 of=$_FIRST_CHAR_FILE >&/dev/null; test -s "$_FIRST_CHAR_FILE" && ( cat $_FIRST_CHAR_FILE; rm $_FIRST_CHAR_FILE; cat - ) | }. "($command)"; # The eval is needed to catch exception from open3 eval { $pid = ::open3($in, ">&OUT", ">&ERR", $ENV{SHELL}, "-c", $command) ||