Forum Discussion

Mike_S_59924's avatar
Mike_S_59924
Icon for Nimbostratus rankNimbostratus
Apr 14, 2008

comparison other than equals

Looks like irules only support equals and not equals. Is there any way to simulate greater than and less than.

 

 

The problem.

 

 

We have a web site w/ 240 virtual directories. We want to change to distributiong to 4 web servers. So essentially I want to say something like (in Englis)

 

for urils who start w/ anthying less than "Ko" goto web 1 else if it start w/ anyting less than "ME" goto web to, etc....

 

 

I really want to go to the 2nd letter so I can evenly distribute.

 

 

Thanks.

14 Replies

  • the -glob argument for switch put's it in "string match" compatibility mode. If you check out the docs for "string match", you'll see the options:

     

     

    http://www.tcl.tk/man/tcl8.5/TclCmd/string.htmM40

     

    Click here

     

     

     

    -Joe
  • Joe and Aaron,

     

     

    You guys rock.

     

     

    I have a proof of concept working w/ Aaron's

     

     

    Joe's seems to all fall through to the default statement. Any chance of a syntax error in the glob?

     

     

  • I got Joe's version working. * missing from rules other than first one in example. Thanks again guys.
  • Doh! Sorry about that. I re-typed it from when I was testing it and must have left those out. I've updated my post with the fix.

     

     

    -Joe