lua-users home
lua-l archive

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


>> $ lua -e "if x then"
>> lua: (command line):1: 'end' expected near <eof>

It seems that this is caused by the lack of end of line in the chunk
because this works fine:

$ lua -e "if x then^M"
lua: (command line):2: 'end' expected (to close 'if' at line 1) near <eof>

(here I've typed ^V^M to get a newline in the string.)

Compare also

$ echo 'if x then' | lua - 
lua: stdin:2: 'end' expected (to close 'if' at line 1) near <eof>

$ echo -n 'if x then' | lua -
lua: stdin:1: 'end' expected near <eof>