Expect: How to expect clear screen

Expect: How to expect clear screen

Post by PM Wo » Tue, 13 Jun 1995 04:00:00



I was trying to use expect to telnet to other machines (all VAX/VMS)
and login with a certain user-id.
In all cases, my expect script works (see below) except for one
host which does an automatic clear screen before prompting for
Username :   What should I put into my script to handle this.

My script is as follow:

#!/usr/local/bin/expect --

set timeout 1000
spawn telnet 147.8.16.2
expect "Username:*"
send "HKULOPAC\r"
#

interact
#

--

                    \\\//
                    (o o)
[----------------ooO-(_)-Ooo---------------] PM Wong (System Support Programmer)
[User User User User User User User User Us] CTSC, Hong Kong Baptist University
[ser User User User User User User User Use] 224 Waterloo Road, Kln. HONGKONG
[er User User User User User User User User] Voice: (852)23397425  Fax: 3397888

 
 
 

1. Expect: expect vs. interact

Hey Don or any other expect person:

For comparable uses, which is faster, expect or interact, or is there
any difference?

By comparable, I mean:
    expect {
        -re .+ {
            send_user -raw -- $expect_out(buffer)
            exp_continue
        }
        -i $user_spawn_id -re .+ {
            send -- $expect_out(buffer)
            exp_continue
        }
    }

vs.

    interact

or (I know, slightly different semantics)

    expect {
        "crap" { exit }
        -re .+ {
            send_user -raw -- $expect_out(buffer)
            exp_continue
        }
        -i $user_spawn_id -re .+ {
            send -- $expect_out(buffer)
            exp_continue
        }
    }

vs.

    interact {
        "crap" { exit }
    }

--

http://www.ugcs.caltech.edu/~huyle

2. LILO and Win 95 - any problems?

3. Expect/Tcl Problem - "scripts expect Tcl version..."

4. Which is better: AMD Athlon XP 1800+ or Intel Pentium 2 GHz?

5. expect and expecting it this way or this way...?

6. VLANs (802.1q frame tags) and bridges connecting Xen domU guests

7. How to compile EXPECT was WANTED expect for Linux

8. Setting-up DNS via Cable Modem with Static IP

9. expect for AIX where can I find freeware.expect.rte

10. expect-send pairs and sub expect-send pairs in chat

11. clear command - Clear does not clear my screen.

12. 'clear' does not clear screen

13. Kermit and expect problems with 2.0