1

I've installed lua 5.4 on a google cloud vm, linux/debian os

but I have a file modoverrides.lua but running

$ file modoverrides.lua

on terminal it shows file type as ASCII text.

how can i make the system read it as a lua file? without adding #!/usr/bin/lua (the parent script breaks when i do that)

  • 6
    A Lua file *is* ASCII text. And what error do you get when you add the `#!` line? Any Lua interpreter should allow that. – luther Jun 14 '21 at 14:13

1 Answers1

0

The file command puts out...

file mtest.lua 
mtest.lua: a /root/bin/lua script, ASCII text executable

...when the SHEBANG is: #!/root/bin/lua
With or without SHEBANG you can execute it with: lua mtest.lua
...if the lua interpreter is in the PATH variable.
From inside another lua script you can execute it with or without SHEBANG:

dofile("/path/to/mtest.lua")
koyaanisqatsi
  • 2,585
  • 2
  • 8
  • 15