Executable Extension with Lua

Jun 2, 2008
284
1
Newton, MA
#1
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
 
#2
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)
 
Jun 2, 2008
284
1
Newton, MA
#6
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?