Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Expect: suppress output from screen

709 views
Skip to first unread message

Derek Fountain

unread,
Apr 11, 2008, 10:01:29 AM4/11/08
to
I'm using expect to telnet to a remote box:

spawn -noecho /usr/bin/telnet $host
expect login:
...
etc

Which works fine, but at the 'expect' line all the banners from the
telnet server are being sent to the local screen. I'd like the script to
run the expect stuff silently.

The stty command seems to turn off screen echoing for the 'send'
command; can I turn off screen echoing for the 'expect' command?

vit...@gmail.com

unread,
Apr 11, 2008, 10:30:32 AM4/11/08
to

To turn the screen output off:
log_user 0

To turn it back on:
log_user 1

You can still capture the output with [expect] but won't see it on the
screen.

---Victor

Uwe Klein

unread,
Apr 11, 2008, 10:23:39 AM4/11/08
to
use
log_user 0

to switch of passthrough of all matched chars.

uwe

Derek Fountain

unread,
Apr 11, 2008, 10:34:48 AM4/11/08
to
> To turn the screen output off:
> log_user 0

Thanks to all who replied - it's clear as day in the man page, but
actually *finding* anything in that man page is somewhat tricky... :o}

Uwe Klein

unread,
Apr 11, 2008, 11:16:28 AM4/11/08
to

Right,
the order is aphabetic and not telpathic ;-)

I've had my share of ping-pong reading in that
man page too.

uwe

0 new messages