Forum Discussion
Oct 02, 2015
BIG-IP : tcl boolean logic for string comparisons
F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi
What is correct syntax for boolean operations around string comparisons ?
set a "a"
set b "b"
set result 0
if { { $a eq "a" } && { $b eq "b" } } {
set result 1
}
This compiles but throws a runtime exception :
expected boolean value but got " $a eq "a" " while executing "if { { $a eq "a" } && { $b eq "b" } ...
- Hannes_RappNimbostratus
Hello,
Your logic is correct, however, the use of double curly brackets does not seem right.
Try the following as your conditional statement:
if { ( $a eq "a" ) && ( $b eq "b" ) } {
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