testing version of LuaBIOS and OpenOS
people were having issues getting them to work so now we promote consistency
This commit is contained in:
23
data/OpenOS/bin/set.lua
Normal file
23
data/OpenOS/bin/set.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
local args = {...}
|
||||
|
||||
if #args < 1 then
|
||||
for k,v in pairs(os.getenv()) do
|
||||
io.write(k .. "='" .. string.gsub(v, "'", [['"'"']]) .. "'\n")
|
||||
end
|
||||
else
|
||||
local count = 0
|
||||
for _, expr in ipairs(args) do
|
||||
local e = expr:find('=')
|
||||
if e then
|
||||
os.setenv(expr:sub(1,e-1), expr:sub(e+1))
|
||||
else
|
||||
if count == 0 then
|
||||
for i = 1, os.getenv('#') do
|
||||
os.setenv(i, nil)
|
||||
end
|
||||
end
|
||||
count = count + 1
|
||||
os.setenv(count, expr)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user