summaryrefslogtreecommitdiffstats
path: root/menu/tests/expand
blob: 5dbaac8d2939f4aeabfd7ffc75fe79ba8bdad8ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl

# This script performs expansion of environment variables of the form ${HOME}

while(<>)
{
  while (($a) = ($_ =~ /[^\$]*\$\{([^\}]*)\}.*/))
  {
     s/([^\$]*)(\$\{$a\})(.*)/$1$ENV{$a}$3/;
  }
  printf $_;
}