in reply to Re: Parsing variables from login scripts
in thread Parsing variables from login scripts
In this case, $env_var{PATH} would equal ":/somewhere/else/someplace".PATH = /someplace PATH = $PATH:/somewhere/else
I'm afraid I can't find the original thread, but a fairly robust regular expression looked something like this:
This would interpolate stuff like $PATH, ${PATH}, etc.$value =~ s/$({?)(\w+)(?(1)})/$env_var{$2}/eg;
|
|---|