Simple Process Automate using Expect

Below is a simple example expect script which can be used as a starting point for the automation of interactive processes. Feel free to use it for anything you deem useful.

#!/usr/bin/expect --
 
spawn ./flash_the_firmware.sh
 
set timeout -1
 
expect "Do you want to enter the system part number*" {send "n\r"}
expect "Do you want to enter the system serial number*" {send "n\r"}
expect "Do you want to enter the asset tag*" {send "n\r"}
 
expect "Registering new image...Done*" {send "\r"}
 
interact

Copyright 2002-2014 ClusterVision BV