lua-users home
lua-l archive

Re: A Lua script and a Bash script in one file

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


On Tue, May 8, 2012 at 11:26 AM, Michael Wolf <miwo@gmx.at> wrote:
> If you replcae "@goto end" with "exit /B" you dont need the trailing
> goto which looks a bit nicer
This is cool, because it makes it possible to package Lua scripts as
batch files directly.
To get the arguments passed, a slight alternation:
rem='Lua'--[[
@lua.exe %0.bat %* && @exit /B
]]
print 'hello dolly'
for i,a in ipairs(arg) do print(i,a) end
(The '.bat' is needed if you wanted to invoke this just as 'hello')
D:\>hello one two three
D:\>rem='Lua'--[[
hello dolly
1 one
2 two
3 three
steve d.

AltStyle によって変換されたページ (->オリジナル) /