On Wed, Sep 18, 2013 at 4:20 PM, Alain Williams <a...@phcomp.co.uk> wrote:

> On Wed, Sep 18, 2013 at 04:13:39PM +0200, Remi Collet wrote:
> > Le 18/09/2013 16:04, Alain Williams a écrit :
> >
> > > What is needed is for this to NOT be called if the standard output is
> not
> > > connected to a tty.
> >
> > From your previous message:
> >
> > >     ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon
> echo ...}) = 0
> > >     ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon
> echo ...}) = 0
> >
> > Which is standard input, not standard output
>
> Yes - a typeo, sorry.
>
> > I can get it to not do this by connecting stdin to /dev/null:
> >
> >     ./myScript < /dev/null | less
> >
> > qed
> >
> > > Should I raise this as a bug ?
> >
> > So, I don't think there is any bug there.
>
> The redirection of stdin to /dev/null is NOT a solution. You don't need to
> do
> this with scripts written in other languages (eg shell, perl). It makes
> using
> the script for the end user more difficult and strangely different from
> scripts
> written in other languages.
>
>
One could use ltrace -l to trace library calls.

On my laptop (Debian) :

ltrace -l /usr/lib/x86_64-linux-gnu/libedit.so.2 php -a

using_history(1, 38, 0x250000000f, 712, 0x1087900)                      = 0
Interactive shell

tilde_expand(0xd48ef1, 0x24a0ae8, 0, 17, 149464)                        =
0x24c61c0
read_history(0x24c61c0, 0x7f0a6eb9f986, 0x8e0f5f, 0x7f0a6eb9f986, 0)    = 0
readline("php > "php >


Julien.Pauli

Reply via email to