summaryrefslogtreecommitdiffstats
path: root/menu/tests/expand
diff options
context:
space:
mode:
authorWaldo Bastian <waldo.bastian@intel.com>2003-08-13 20:32:05 +0000
committerWaldo Bastian <waldo.bastian@intel.com>2003-08-13 20:32:05 +0000
commitcd3f8b4a7987d23c9af7aa6a6b3e37b9ac2b2253 (patch)
tree0d25009a5bcc85a79d7b21608ca37fcc403db742 /menu/tests/expand
parent7f2c3443647b8f5a7d17c5b53b157d33794e9c6c (diff)
downloadxdg-specs-cd3f8b4a7987d23c9af7aa6a6b3e37b9ac2b2253.tar.xz
First attempt at a testsuit
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