|
>> $ lua -e "if x then"It seems that this is caused by the lack of end of line in the chunk
>> lua: (command line):1: 'end' expected near <eof>
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 -n 'if x then' | lua -
$ echo 'if x then' | lua -
lua: stdin:2: 'end' expected (to close 'if' at line 1) near <eof>
lua: stdin:1: 'end' expected near <eof>