Report missing Shell Variables

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5481 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-10 04:50:57 +00:00
parent 46a97b0a0a
commit b7bb78c03d

View File

@ -3435,9 +3435,17 @@ sub finish_section ( $ ) {
sub process_rule1 ( $$$$$$$$$ );
#
# Macros and actions can have shell variables embedded. This function expands them.
#
sub expand_shell_variables( $ ) {
my $line = $_[0];
$line = $1 . $ENV{$2} . $3 while $line =~ /^(.*?)\$([a-zA-Z]\w*\b)(.*)$/;
while ( $line =~ /^(.*?)\$([a-zA-Z]\w*)(.*)$/ ) {
fatal_error "Shell variable \$$2 not found" unless $ENV{$2};
$line = $1 . $ENV{$2} . $3 ;
}
$line;
}