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

Shane O'Donnell shaneodonnell at gmail.com
Fri Jan 20 14:34:01 EST 2006


if { -re ^RTP } {
     commands
     } elseif
   { -re ^IND } {
     commands
     } else {}


I think...

Shane O.

On 1/20/06, Greg Brown <gwbrown1 at gmail.com> wrote:
> 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
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
>


--
Shane O.
========
Shane O'Donnell
shaneodonnell at gmail.com
====================



More information about the TriLUG mailing list