[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: Egor Skriptunoff <egor.skriptunoff@...>
- Date: Wed, 9 May 2012 12:55:43 +0300
On 5/9/12, steve donovan <steve.j.donovan@gmail.com> wrote:
>> Neither %~f0 nor "%~f0" works correctly if filespec contains spaces.
>
> Ah, but we can always quote the argument - this version passes all
> tests (works from paths-with-spaces, correct errorlevel)
>
> ::lua::--[[
> @lua52.exe "%~f0" %* & @exit /b %errorlevel%
> ]]
Steve, this is a test that fails:
C:\Temp>type "my utils\hello.bat"
::lua::--[[
@lua52.exe "%~f0" %* & exit /b %errorlevel% ]]
print 'hello dolly'
C:\Temp>"my utils\hello.bat"
hello dolly
C:\Temp>"my utils\hello"
lua52.exe: cannot open C:\Temp\my utils\hello: No such file or directory
By the way, in the line
@lua52.exe "%~f0" %* & exit /b %errorlevel%
the %errorlevel% value is the value that was prior to calling lua52.exe.
This line should be splitted in two lines to get correct exit code.
- References:
- A Lua script and a Bash script in one file, Rena
- Re: A Lua script and a Bash script in one file, Egor Skriptunoff
- Re: A Lua script and a Bash script in one file, Michael Wolf
- Re: A Lua script and a Bash script in one file, Michael Wolf
- Re: A Lua script and a Bash script in one file, T T
- Re: A Lua script and a Bash script in one file, steve donovan
- Re: A Lua script and a Bash script in one file, Egor Skriptunoff
- Re: A Lua script and a Bash script in one file, Daurnimator
- Re: A Lua script and a Bash script in one file, Egor Skriptunoff
- Re: A Lua script and a Bash script in one file, steve donovan
- Re: A Lua script and a Bash script in one file, Egor Skriptunoff
- Re: A Lua script and a Bash script in one file, steve donovan