Executable Extension with Lua

Jun 2, 2008
407
3
Newton, MA
Can someone tell me what I am doing wrong here? I defined an executable extension for LUA, but it doesn't seem to work. However, the very command line reported by WHICH runs just fine. Here is a series of commands:

tcmd>set .lua
lua

tcmd>which test
test is an executable extension : lua C:\commands\lua\test.lua

tcmd>test
Lua: C:\Program Files\JPSoft\TCMD16x64\TCC.EXE:1: syntax error near char(144)

tcmd>lua C:\commands\lua\test.lua
a b
 
May 20, 2008
12,175
133
Syracuse, NY, USA
I get the same (rather mysterious) error message here.
Code:
v:\> type test.lua
print("ab")

v:\> lua test.lua
ab

v:\> set .lua=lua

v:\> test.lua
Lua: G:\TC16\TCC.EXE:1: syntax error near char(144)
 
May 20, 2008
12,175
133
Syracuse, NY, USA
Why are you using an executable extension instead of the internal Lua support?
I don't know about the OP, but it doesn't seem to matter. The error is the same.
Code:
v:\> set .lua
TCC: Not in environment ".lua*"

v:\> test.lua
Lua: G:\TC16\TCC.EXE:1: syntax error near char(144)
 
Jun 2, 2008
407
3
Newton, MA
Why are you using an executable extension instead of the internal Lua support?

I thought that I was trying to use the internal Lua support to run a file with the name test.lua without having to type the lua command.

I just defined the environment variable .alias=alias /r and was able to execute the file test.alias to load the aliases defined in that file. So executable extensions are not limited to external commands. Shouldn't one be able to invoke lua to execute a file by extension?
 

Similar threads