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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

expect script - nested if-ifelse-else

Status
Not open for further replies.

davidbelarus

Programmer
Oct 21, 2011
26
0
0
US
I got an interesting result here.
the nested if worked fine when i put numbers in. when i put a letter in, i expected it to go to the else(non-standard case i presumed) for some reason it went to the ifelse statement.



#!/usr/bin/expect -f

set version "x"

send "Version is $version\n"
expect "cfe> "
if {$version <1300} {
puts "version is less than 1300"
} elseif {$version >= 1300} {
puts "version is more than 1300"
} else {
puts "version exactly 1300"
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top