take – Compile using Terminal in Lua


I'm starting now to study the Lua programming language, but I'm having a problem, when I make a c program to compile the algorithm in the terminal I write:

**gcc nome-do-programa.c** and then put **./a.out**

and it brings a value or something like that depends on what is being asked, in lua I should write lua program-name and "should do what my script was asking and bring the result", but not what it brings I feel like something's missing.


./a.out x y z

gets the strings "x" , "y" , "z" into argv , starting at argv[1] .

This works exactly the same in Lua:

lua myscript.lua x y z

gets the strings "x" , "y" , "z" in arg , starting at arg[1] .

Note that it is arg in Lua, not argv .

Scroll to Top