lua-users home
lua-l archive

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


Hi Leo, hi Liuz,

the prompts simply don't show up when redirecting input from file

on Mac OS 10.5.8 / Darwin Kernel Version 9.8.0 i386 for 5.2.0-alpha

This is different from 5.1.4 (5.1.4 not compiled with its test libs in, if that makes a difference).

Note the missing ">":
$ echo "print(1)" > in
$ ../src/lua -i < in
Lua 5.2.0 (alpha)  Copyright (C) 1994-2010 Lua.org, PUC-Rio
1

$ lua -i < in
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print(1)
1
>
On 1/7/11 3:25 PM, Leo Razoumov wrote:
On Thu, Jan 6, 2011 at 22:22, Henning Diedrich <hd2010@eonblast.com> wrote:
To pass these tests on Lua-5.1.4 I use a modified version of the patch
proposed by Duck in
[snip]

It does not make a difference whether I use a pipe or an input re-direction.

$ echo "print(1)" | ../src/lua -i
Lua 5.2.0 (alpha)  Copyright (C) 1994-2010 Lua.org, PUC-Rio
1

$ echo "print(1)" | lua -i
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print(1)
1
>

Thank you very much Leo, for hinting at that possible problem so quickly, but it was not it. The fact that only the last of the four tests using < failed also made it unlikely.

Setting the prompt doesn't help either, it is having no effect
$ echo "print(1)" > in
$ ../src/lua "-e_PROMPT='alo'" -i < in
Lua 5.2.0 (alpha)  Copyright (C) 1994-2010 Lua.org, PUC-Rio
1

$ lua "-e_PROMPT='alo'" -i < in
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
aloprint(1)
1
alo

If you don't redirect or pipe in, the prompt shows up as it should:
$ ../src/lua "-e_PROMPT='alo'" -i
Lua 5.2.0 (alpha)  Copyright (C) 1994-2010 Lua.org, PUC-Rio
alo
Cheers,
Henning