Stan_Ward_01_13
Oct 26, 2015Nimbostratus
warning: [use curly braces to avoid double substitution]
I'm getting this a lot while converting irules from v10.2.4 to v11.5.3, and I don't understand either the warning or the fix.
Here are a few random (unrelated) lines with the warning:
- if [catch {virtual name} virtualName]
- set aclmr_virtualSite [lindex $aclmr_parts [expr [llength $aclmr_parts] - 2]]
- if [catch "matchclass $aclmr_clientIP equals $aclmr_ipLookupClass" val] {
- set lWay [expr $lWay - 1]
- set virtualSite [lindex $parts [expr [llength $parts] - 2]]
What is the general situation that the warning is about, and how should it be corrected? I've seen comments that you should just add another layer of {} around expressions, but that has sometimes generated bad values at runtime (where the original lines, with warnings, work fine). Other answers I've seen posted just said "change xxx to yyy and it will work" without explanation.