lua-users home
lua-l archive

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


On Fri, Jan 7, 2011 at 11:10, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> To pass these tests on Lua-5.1.4 I use a modified version of the patch
>> proposed by Duck in
>> http://lua-users.org/lists/lua-l/2008-02/msg00095.html
>
> Do you know why this works?
>
> -- Roberto

On my Linux box (Ubuntu-9.04 x86 32 bits) redirection does not work
(it echoes input lines) but pipe "cat file | lua ...." works fine.

I guess that in the case of a pipe, shell forks two processes - one
for 'cat' another for Lua. Somehow, child process running Lua fools
readline into thinking that it is not connected to an interactive tty
and it stops echoing its input.

--Leo--