[TriLUG] grr... my expect book is at home and google isn't helping

Greg Brown gwbrown1 at gmail.com
Fri Jan 20 14:11:33 EST 2006


People.. I need to do a fairly simple if/then in expect.  I've found some
examples but not the one I'm loooking for.  Here's what I want, maybe
someome can help:

I pass a hostname to an expect script, hosts start with either "RTP" or
"IND"

what I want do is:

if $hostname starts with RTP {

do this

}

elsif $hostname starts with IND {

do this

}

else {

don't do anything

}

I'm still googling, but maybe a helpful expect superperson could shed some
light here?  Thanks in advance.

Greg



More information about the TriLUG mailing list