Environment Variables

Environment variables are a universal mechanism for conveying configuration information to Unix programs.

local secret = os.getenv("SECRET")
assert(secret ~= nil, "SECRET not set")
print(secret)
―――――
$ SECRET=12345 lua envtest.lua
12345


Next: Spawning Processes