lua-users home
lua-l archive

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


On Sat, Jan 8, 2011 at 02:26, Henning Diedrich <hd2010@eonblast.com> wrote:
> on Mac OS 10.5.8 / Darwin Kernel Version 9.8.0 i386 for 5.2.0-alpha
>
>
> 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
>>

For Lua-5.1.4 on Linux Ubuntu 10.04 (and 9.04) with libreadline
versions 6.1 (and 5.2) and using bash, redirection echoes the input
while cat+pipe does not:

leor@meson:/tmp$ echo $SHELL
/bin/bash
leor@meson:/tmp$ echo $BASH_VERSION
4.1.5(1)-release
leor@meson:/tmp$ echo "print(1)" > inp
leor@meson:/tmp$ lua -e"_PROMPT='' _PROMPT2=''" -i < inp
print(1)
1

leor@meson:/tmp$ cat inp | lua -e"_PROMPT='' _PROMPT2=''" -i
1


--Leo--