Neil Jerram <neil <at> ossau.uklinux.net> writes:
> Well, as the manual says:
> 
>  -- Macro: expect clause ...
>      [...]   The procedures
>      are called in turn after each character is read from the port,
>      [...]
> 
>      The test is successful if the procedure returns a non-false value.
> 
> Your lambda returns *unspecified*, which counts as a non-false value.
> So the whole (expect ...) invocation completes after reading just one
> character.

I must've missed that "each character" bit.

Maybe it would be better to post my original program that would just
hang.  I was only using expect to print debugging messages; my
original program used expect-strings.

--Aidan

#! /usr/bin/guile -s
!#

(use-modules (ice-9 expect))
(use-modules (ice-9 popen))

(define ie-io (open-pipe* OPEN_BOTH
                          "/usr/bin/telnet"
                          "ienabler.canterbury.ac.nz" "259"))
(let ((expect-port ie-io))
  (expect-strings
   ("^User:" (begin (display "[snip]\n" ie-io) (display "gave user")))
   ("^passwd:" (begin (display "[snip]\n" ie-io) (display "gave passwd")))))



Reply via email to