summaryrefslogtreecommitdiff
path: root/test/env.lua
diff options
context:
space:
mode:
authorPeter Drahoš <drahosp@gmail.com>2010-09-30 03:36:03 +0200
committerPeter Drahoš <drahosp@gmail.com>2010-09-30 03:36:03 +0200
commit0a6d2ee18063746ba9fcc345174e884a87d57da2 (patch)
tree9a2fd7d20ae264bed7d2915dbe1861363c59c3f7 /test/env.lua
parent00dbc0c4ce548aed1ff09e71e68a7c9ff48c4158 (diff)
downloadlua-0a6d2ee18063746ba9fcc345174e884a87d57da2.tar.gz
Cloned from old repo
Diffstat (limited to 'test/env.lua')
-rw-r--r--test/env.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/env.lua b/test/env.lua
new file mode 100644
index 0000000..9e62a57
--- /dev/null
+++ b/test/env.lua
@@ -0,0 +1,7 @@
+-- read environment variables as if they were global variables
+
+local f=function (t,i) return os.getenv(i) end
+setmetatable(getfenv(),{__index=f})
+
+-- an example
+print(a,USER,PATH)