Forum Discussion
Jul 05, 2014
correct syntax for boolean expressions
I experiencing errors with forming a simple boolean expression that would be valid in most "C like" languages ( if we added an equals sign = 😞
set var1 $var2 && !$var3
error: [wrong args][set ...
nitass
Jul 06, 2014Employee
e.g.
1
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when RULE_INIT {
set var_2 ""
set var_3 "null"
set var_1 [expr {[expr {$var_2 ne ""}] || [expr {$var_3 ne "null"}]}]
log local0. $var_1
}
}
[root@ve11a:Active:In Sync] config cat /var/log/ltm
Jul 5 21:36:55 ve11a info tmm[29362]: Rule /Common/qux : 0
Jul 5 21:36:55 ve11a info tmm1[29362]: Rule /Common/qux : 0
2
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when RULE_INIT {
set var_2 "test"
set var_3 "test"
set var_1 [expr {[expr {$var_2 ne ""}] || [expr {$var_3 ne "null"}]}]
log local0. $var_1
}
}
[root@ve11a:Active:In Sync] config cat /var/log/ltm
Jul 5 21:38:55 ve11a info tmm[29362]: Rule /Common/qux : 1
Jul 5 21:38:55 ve11a info tmm1[29362]: Rule /Common/qux : 1
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