Make new get_params work with bash

This commit is contained in:
Tom Eastep 2010-12-01 10:41:49 -08:00
parent 22580c5be0
commit 49cdc5d9eb

View File

@ -2907,14 +2907,31 @@ sub get_params() {
my $variable;
for ( @params ) {
if ( /^export (.*?)='(.*)'$/ ) {
$params{$1} = $2 unless $1 eq '_';
} elsif ( /^export (.*?)='(.*)$/ ) {
$params{$variable=$1}="${2}\n";
} else {
assert($variable);
$params{$variable} .= $_;
if ( $params[0] =~ /^declare/ ) {
for ( @params ) {
if ( /^declare -x (.*?)="(.*)"$/ ) {
$params{$1} = $2 unless $1 eq '_';
} elsif ( /^declare -x (.*?)="(.*)$/ ) {
$params{$variable=$1}="${2}\n";
} elsif ( /^declare -x (.*)\s+$/ ) {
$params{$1} = '';
} else {
assert($variable);
s/'$//;
$params{$variable} .= $_;
}
}
} else {
for ( @params ) {
if ( /^export (.*?)='(.*)'$/ ) {
$params{$1} = $2 unless $1 eq '_';
} elsif ( /^export (.*?)='(.*)$/ ) {
$params{$variable=$1}="${2}\n";
} else {
assert($variable);
s/'$//;
$params{$variable} .= $_;
}
}
}