lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > lua.c in 4.0 adds everything it doesn't consider to be an argument to the
> > arg table. However, it adds the filename passed to -f as arg[1], which is
> > rather annoying, because this is effectively the program name, so should
> > surely be arg[0] (?).
> 	Sorry, but that's not correct.  I've just test the following (x.lua):
>
> #!/usr/local/bin/lua -f
> foreach(arg,print)
>
> 	And run: ./x.lua a b c  That gives:
>
> 0       ./x.lua
> 1       a
> 2       b
> 3       c
> n       3

Sorry, my bad. I had an intermediate script involved.

-- 
http://www.mupsych.org/rrt/ | impatience, n.  the urge to do nothing