lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


In the command-line REPL, execute the following:

	setmetatable(_G,{__index=os.getenv})

In my caffeine-deprived state, I am at a loss to explain what happens:

rjek@octopus:~$ lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> setmetatable(_G,{__index=os.getenv})
bad argument #1 to '?' (string expected, got table)
rjek@octopus:~$ echo $?
1
rjek@octopus:~$

B.