[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A Lua script and a Bash script in one file
- From: Michael Wolf <miwo@...>
- Date: Tue, 8 May 2012 11:26:37 +0200
2012/5/8 Egor Skriptunoff <egor.skriptunoff@gmail.com>:
>> A Bash script that's also a Lua script!
>
> That's funny!
> The same thing for .bat-files in Windows:
>
> rem = 'This is .BAT-file and .lua-script' --[[
> @echo This is .BAT-file
> @lua52.exe %0
> @goto end
> ]]
> print 'This is Lua script'
> --[[
> :end
> @rem ]]
>
Nice idea!
If you replcae "@goto end" with "exit /B" you dont need the trailing
goto which looks a bit nicer
rem = 'This is .BAT-file and .lua-script' --[[
@echo This is .BAT-file
@lua52.exe %0
@exit /B
]]
print 'This is Lua script'