Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

expect, why does this pattern not match?

Status
Not open for further replies.

ls62

Programmer
Oct 15, 2001
177
US
Hi,

I'm running an expect script and am having problems getting this pattern to match. I can figure out why expect is not matching this pattern. Can anyone help?

Thanks. LEE

Here's the part of my expect script:
expect {
-re "226 Transfer complete.*ftp> $" {
send_user "FTP session completed.\n"
}
timeout {
send_user "Timeout receiving file $ofile. +180 sec.\n"
set ERR 41 ; set nodel 1 ; err_receiving
}
eof {
send_user "Unexpected output!\n"
set ERR 42 ; set nodel 1 ; err_receiving
}
}

Here's the debug output from expect:

expect: does "close\r\n221 Goodbye!\r\nftp> " (spawn_id 4) match regular expression "221 Goodbye*ftp> $"? no
 
To all,

Ahh! sorry I figured it out. My expression wasn't correct. I needed the ".*" in expression.... not just "*".

Maybe this will help someone else at some point.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top