mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 03:10:39 +01:00
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:
parent
46a97b0a0a
commit
b7bb78c03d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user