Someone recommended using an expect script for an issue I was having so I tried writing one but of the 3 expected prompts on the screen, it only see responds to the first one. The code is:
#!/usr/local/bin/expect -f
spawn /usr/local/bin/rcs -u1.1 xyz.fmb
expect "Do you want to break the lock?"
send "y\n"
# expect "or end of file)" # This line and the following don't work
expect ">>" # This expect line fails to
send "prod install\r\n" # This is never sent
expect ">>"
Send ".\n"
======================================================
The result is:
pjones@server [32] ./83172-prod-unlock.sh
spawn /usr/local/bin/rcs -u1.1 xyz.fmb
RCS file: RCS/xyz.fmb,v
Revision 1.1 is already locked by test.
Do you want to break the lock? [ny](n): y The 'y' is sent correctly
State the reason for breaking the lock:
(terminate with single '.' or end of file)
>> pjones@server [33] ---------------------> This is where it should send "prod install"
Does anyone see anything that stands out?
Thanks