build-set-grub

build_set_grub.exp
code format="bash"
 * 1) !/usr/bin/expect -f

set force_conservative 0 ;# set to 1 to force conservative mode even if			  ;# script wasn't run conservatively originally if {$force_conservative} { set send_slow {1 .1} proc send {ignore arg} { sleep .1 exp_send -s -- $arg } }


 * 1) 2) differing output - Some programs produce different output each time
 * 2) they run.  The "date" command is an obvious example.  Another is
 * 3) ftp, if it produces throughput statistics at the end of a file
 * 4) transfer.  If this causes a problem, delete these patterns or replace
 * 5) them with wildcards.  An alternative is to use the -p flag (for
 * 6) "prompt") which makes Expect only look for the last line of output
 * 7) (i.e., the prompt).  The -P flag allows you to define a character to
 * 8) toggle this mode off and on.
 * 9) Read the man page for more info.
 * 10) -Don
 * 1) Read the man page for more info.
 * 2) -Don
 * 1) -Don

set timeout -1 spawn /remote/bin/update /boot/grub/grub.conf match_max 100000 expect "#" send -- "/" send -- "password\r" send -- "l" expect -exact "p" send -- "l" expect -exact "a" send -- "l" expect -exact "s" send -- "l" expect -exact "s" send -- "l" expect -exact "w" send -- "l" expect -exact "o" send -- "l" expect -exact "r" send -- "l" expect -exact "d" send -- "l" expect -exact " " send -- "l" expect -exact "-" send -- "l" expect -exact "-" send -- "l" expect -exact "m" send -- "l" expect -exact "d" send -- "l" expect -exact "5" send -- "l" expect -exact " " send -- "C" expect -exact "[?25l[32;1H[1m-- INSERT --[m[15;16H[K[15;16H[?12l[?25h" send -- [lindex $argv 0] send -- "" expect "$" send -- "ZZ" expect eof code