summaryrefslogtreecommitdiffstats
path: root/menu/tests/expand
diff options
context:
space:
mode:
Diffstat (limited to 'menu/tests/expand')
-rwxr-xr-xmenu/tests/expand12
1 files changed, 12 insertions, 0 deletions
diff --git a/menu/tests/expand b/menu/tests/expand
new file mode 100755
index 0000000..5dbaac8
--- /dev/null
+++ b/menu/tests/expand
@@ -0,0 +1,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 $_;
+} \ No newline at end of file