From 895d84af652e8359a32311641e7c286924092836 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Wed, 17 Jul 2013 15:05:39 +0200 Subject: [PATCH] parallel: export of bash functions to remote servers working. --- src/parallel | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/parallel b/src/parallel index 19d47023..6de56b50 100755 --- a/src/parallel +++ b/src/parallel @@ -952,6 +952,8 @@ sub parse_env_var { @vars = grep { defined($ENV{$_}) } @vars; my @qcsh = map { my $a=$_; "setenv $a " . env_quote($ENV{$a}) } @vars; my @qbash = map { my $a=$_; "export $a=" . env_quote($ENV{$a}) } @vars; + my @bash_functions = grep { substr($ENV{$_},0,4) eq "() {" } @vars; + push @qbash, map { my $a=$_; "eval $a\"\$$a\"" } @bash_functions; # Create lines like: # echo $SHELL | grep "/t\\{0,1\\}csh" >/dev/null && setenv V1 val1 && setenv V2 val2 || export V1=val1 && export V2=val2 ; echo "$V1$V2"