# Executable Extension with Lua

#### Jay Sage

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

#### vefatica

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)``````

#### rconn

Can someone tell me what I am doing wrong here? I defined an executable extension for LUA, but it doesn't seem to work.
Why are you using an executable extension instead of the internal Lua support?

#### Steve Fabian

Isn't the OP's executable extension LUA a shorthand to the internal command LUA? That's how it works with internal commands ALIAS and FUNCTION, etc.

#### vefatica

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)``````

#### Jay Sage

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?