Compile using the Terminal in Lua

3

I'm now initializing studies of the Lua programming language, but I'm having a hard time, when I make a program in c 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 requested, on moon I should write moon program-name and "should do what my script is requesting and bring the result" , but it is not and what it brings I feel that something is missing.

    
asked by anonymous 25.02.2016 / 23:04

1 answer

0
./a.out x y z

get the strings "x" , "y" , "z" in argv , starting in argv[1] .

This works exactly the same way in Lua:

lua myscript.lua x y z

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

Note that it is arg on Moon, not argv .

    
01.03.2016 / 13:42