osx - Error when using lua filename.lua -


i'm new lua, , i've been trying create lua file using textwrangler, execute file in terminal (using mac). create following in textwrangler file:

for i=1,10   print ("hello")     end   print ("that's all!") 

and save test.lua. move file lua directory, ~/lua-5.2.3. start lua, , use following command:

lua test.lua 

and following error:

stdin: 1: syntax error near 'test' 

what doing wrong here? i've looked everywhere online solution to, assume, simple oversight on part, have found nothing. first thought was putting file in wrong place, have moved everywhere same result.

you can execute script typing lua test.lua in terminal.

if enter interpreter mode, can use dofile "test.lua". there no lua command(function ) there, unless declare somewhere.

there pil section stand-alone interpreter usage , more up-to date reference section.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -