Please, can you to explain to me the lines :
for {set i 0} {$i < [llength $item]} {incr i} {
log local0. [lindex $item $i] sorry to confuse you. actually, it is same as foreach loop.
root@ve1110(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when RULE_INIT {
set init [class get ActionBasedOnUrl]
log local0. "\$init: $init"
foreach entry $init {
log local0. "\$entry: $entry"
foreach item $entry {
if {$item ne ""} {
log local0. "\$item: $item"
foreach x $item {
log local0. "\$x: $x"
}
}
}
}
}
}
[root@ve1110:Active] config cat /var/log/ltm
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $init: {{/ wls cookie1 pool_internet} {}} {{/docs wls cookie2 pool_internet} {}}
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $entry: {/ wls cookie1 pool_internet} {}
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $item: / wls cookie1 pool_internet
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $x: /
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $x: wls
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $x: cookie1
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $x: pool_internet
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $entry: {/docs wls cookie2 pool_internet} {}
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $item: /docs wls cookie2 pool_internet
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $x: /docs
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $x: wls
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $x: cookie2
Feb 14 08:32:49 tmm info tmm[7321]: Rule /Common/myrule : $x: pool_internet