Forum Discussion
uni
Altocumulus
Sep 13, 2007Preventing interpreting variable as TCL
I have an iRule which is parsing the each field in a URI query. I am getting an occasional problem with a TCL error if $parameter starts with "-", as the interpreter assumes it is an option to the ...
uni
Altocumulus
Oct 11, 2007For anyone who cares, the solution to this was to add "--" after the switch statement, to ensure it parses the next item as the test value rather than one of the command switches:
switch -- [string tolower [lindex [split ${parameter} "="] 0]] {hoolio's test didn't pick it up, because it was a problem with the switch command syntax, which he didn't use in his test.
Joe's suggestion is not correct: the {curly braces} protect the variable name, not the variable contents.
Thanks for your suggestions.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
