1 / 11

Introduction to Expect

Introduction to Expect. Speaker : Wei-Lin Chen Date : 98/5/21. Outline. Introduction Example Command Autoexpect Used expect in Windows Demo. Introduction. Unix automation and testing tool Extension to the TCL scripting language Interactive application telnet, ftp, ssh, etc.

juliet
Download Presentation

Introduction to Expect

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Expect Speaker : Wei-Lin Chen Date : 98/5/21

  2. Outline • Introduction • Example • Command • Autoexpect • Used expect in Windows • Demo

  3. Introduction • Unix automation and testing tool • Extension to the TCL scripting language • Interactive application • telnet, ftp, ssh, etc. • Regular expression

  4. Example • ftp session (manual) • ftp <host> • Name : <name> • Password : <password> • ftp>put <file>

  5. Example(cont.) • ftp session (automated) • ./ftp.exp <host> <file>

  6. Command • Spawn • Establish application session • Set • Set variable • Expect • Expected events • Send • Send string

  7. Command(cont.) • Puts • Output string • Interact • Pass control from script to user • For, while, if…else, etc.

  8. Autoexpect • autosexpect ftp <host> • Name : <name> • Password : <password> • ftp>put <file> • ftp>bye • autoexpect done, file is script.exp

  9. Used expect in Windows • Install Cygwin • Category Interpretersexpect • Execute Cygwin Bash Shell

  10. Demo • vim ftp.exp • chmod +x ftp.exp • ./ftp.exp 10.10.21.115 Spongebob.jpg

  11. Reference • Expect – Wikipedia • http://en.wikipedia.org/wiki/Expect • Expect Tutorial • http://users.csc.calpoly.edu/~dbutler/tutorials/winter96/expect/tutorial.html • Cygwin Note • http://irw.ncut.edu.tw/peterju/cygwin.html • Regular Expression • http://en.wikipedia.org/wiki/Regular_expression

More Related