Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zpty woes
- X-seq: zsh-workers 25039
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: zpty woes
- Date: Thu, 15 May 2008 16:26:27 +0100
- In-reply-to: <20080515145054.GC5190@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <34AE8142-F5DA-44FD-96BA-61BDE12BC74E@xxxxxxx> <200805151318.m4FDIvKS015244@xxxxxxxxxxxxxx> <20080515145054.GC5190@xxxxxxxxxxxxxxx>
Stephane Chazelas wrote:
> On Thu, May 15, 2008 at 02:18:57PM +0100, Peter Stephenson wrote:
> > Jaime Vargas wrote:
> > > In the script attached, when trying to follwing line always fails.
> > >
> > > zpty -r scppty line "*:" || echo "no password asked" && exit
> > >
> > > It appears that the "password" string from the ssh session is discarded
> > > by the psuedo terminal.
> > >
> > > Is there a way to fix this? or Am I missing something?
> >
> > To work around this, you need to use non-blocking mode, i.e. start with
> > "zpty -b scppty ...".
>
> It works for me without "-b", why would you say "-b" is
> necessary?
OK, it works without -b if and only if you have the pattern. That
stops it needing the newline. I said the code was tortuous.
> The problem I've found is that zpty -r doesn't return when the
> command in the pty has terminated. A strace -p shows:
>
> read(12, 0xb7ba04c8, 1) = -1 EIO (Input/output error)
Highly plausible. That's likely to be the loop where it waits for the
pattern regardless.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author