Forum Discussion
J_LE_42749
May 23, 2014Nimbostratus
TCL & TMSH command > unexpected argument "|" while using grep
Hello World!
I am currently struggling with TCL & TMSH grep & need some advice.
I'm trying to automate APM object creation and for that I need at some point to list the existing ACLs in ord...
Kevin_Stewart
May 23, 2014Employee
Not at all the prettiest thing in the world, but try this:
proc script::run {} {
set order 0
foreach x [split [tmsh::list apm all-properties] "\n"] {
if { [string trimleft $x] starts_with "acl-order" } {
set num [lindex [split [string trimleft $x]] 1]
if { [expr { $num > $order }] } {
set order $num
}
}
}
puts "largest: $order"
}
This will loop through each line of the tmsh command's result, find acl-order and its value, and then return the largest number.
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