1 / 12

Expect

Automating MARC Extracts Using Expect ________________________________________________ MENA-IUG Annual Conference 30-31 October 2011. Expect. TCL extension – automate/manage interactive applications Use as a telnet/ ssh /ftp session manager Will not work in GUI environment

thora
Download Presentation

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. Automating MARC Extracts Using Expect________________________________________________MENA-IUG Annual Conference30-31 October 2011

  2. Expect • TCL extension – automate/manage interactive applications • Use as a telnet/ssh/ftp session manager • Will not work in GUI environment • Available for Windows – but scripts would have to be changed

  3. Expect Why? • Pricing • Easy to use • Readily Available • Run as cron job • Examples for III available

  4. Automation • Shift time to lower server load/use • Personnel considerations

  5. Easy to Use • Essentially a macro • Use the “expect” and “send” commands • Walk your way through the menus • Example: expect “Choose*” {send “B”}

  6. Scheduling/Date Start Date • User input? • Reference to current date. • Relation to cron job.

  7. Date Solutions • Set default • Allow for command line input • Example: set day [expr $cDay-1] ;# set default If {llength $argv} > 0} {set day [lindex $argv 0]}

  8. Using Examples • Use the existing examples as the starting point • Most of the issues have been worked out • Different approaches

  9. Modules • Expect can call other scripts – including other expect scripts • Analyze tasks by function • Craft the necessary function for each task

  10. Annoyance timeStamp=$( ls -l --time-style=+%y-%m-%d-%H-%M-%S $summon | awk '{print "zu-catalog-20"$6".marc"}' )

  11. Resources Exploring Expect by Don Libes O'Reilly Media, Inc., December 1, 1994 III Automated Export - Updates & Additions Script: http://community.summon.serialssolutions.com/index.php/III_Automated_Export_-_Updates_%26_Additions_Script Create List of New Items automated IUG Clearinghouse: http://innovativeusers.org/iug-clearinghouse-menu

  12. Resources Wikipedia http://en.wikipedia.org/wiki/Expect Shrew: http://code.google.com/p/shrew/ Expect for windows http://www.activestate.com/activetcl/expect User guide: http://docs.activestate.com/activetcl/8.5/expect4win/ Tutorial: http://npg.dl.ac.uk/MIDAS/manual/ActiveTcl8.5.7.0.290198-html/expect4win/ex_tut.html

More Related