[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: T T <t34www@...>
- Date: Wed, 9 May 2012 12:06:07 +0100
On 9 May 2012 10:55, Egor Skriptunoff <egor.skriptunoff@gmail.com> 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
that.
Cheers,
Tomek
[*] at least that's the case for cmd.exe, e.g., Take Command
(http://jpsoft.com) behaves differently in that respect.
- 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
- Re: A Lua script and a Bash script in one file, Egor Skriptunoff