lua通过命令行传参数
lua test.lua abc 123
--test.lua local params = {...} print(#params) print(params[1]) print(params[2])
测试一下:
~# lua test.lua abc 123 2 abc 123
local params = {...} params[1] -- first parameter, if any. params[2] -- second parameter, if any. #params -- number of parameters.