mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-12 18:54:25 +01:00
Make new get_params work with bash
This commit is contained in:
parent
22580c5be0
commit
49cdc5d9eb
@ -2907,15 +2907,32 @@ 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} .= $_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $debug ) {
|
||||
|
Loading…
Reference in New Issue
Block a user