lua-users home
lua-l archive

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

On 9 May 2012 10:55, Egor Skriptunoff <> wrote:
> 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.

That's because variable expansion happens for the entire line at once
and not per each command executed in that line[*].

> This line should be splitted in two lines to get correct exit code.

Strictly speaking, 'exit /b' already propagates the exit code from the
last command, so the second argument is needed only if you don't want



[*] at least that's the case for cmd.exe, e.g., Take Command
( behaves differently in that respect.