ede/ede-panel/applets/start-menu/tests/expand

12 lines
225 B
Plaintext
Raw Permalink Normal View History

2009-10-03 11:33:08 +04:00
#!/usr/bin/perl
# This script performs expansion of environment variables of the form ${HOME}
while(<>)
{
while (($a) = ($_ =~ /[^\$]*\$\{([^\}]*)\}.*/))
{
s/([^\$]*)(\$\{$a\})(.*)/$1$ENV{$a}$3/;
}
printf $_;
}