File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -114,16 +114,18 @@ sub read_config_file
114114 exit 1;
115115 }
116116
117- # my $value = shift @parts;
118- my $raw_value = shift @parts;
119- my $value = '';
120- my @value_parts = split(/(\$\w+)|(\${\w+})/, $raw_value);
121- foreach my $seg (@value_parts)
122- {
123- next if (not defined($seg));
124- $seg = ($ENV{$1} || '') if ($seg =~ m/\${?(\w+)}?/);
125- $value .= $seg;
126- }
117+ # expand any embedded environment variable names as in
118+ # key=$ENVVAR or key=/home/${USER}/${SLURM_JOBID}
119+ # replaces variable with its value from the environment
120+ my $value = '';
121+ my $raw_value = shift @parts;
122+ my @value_parts = split(/(\$\w+)|(\$\{\w+\})/, $raw_value);
123+ foreach my $seg (@value_parts)
124+ {
125+ next if (not defined($seg));
126+ $seg = ($ENV{$1} || '') if ($seg =~ m/\$\{?(\w+)\}?/);
127+ $value .= $seg;
128+ }
127129
128130 # record the key value pair in the hash
129131 if (defined $master_key) {
You can’t perform that action at this time.
0 commit comments