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...
J_LE_42749
Jun 05, 2014Nimbostratus
Thanks a bunch Kevin! I forgot to subscribe to the post so I just discover your input.
Meanwhile I did the work with regex:
proc script::run {} {
...
set dump [tmsh::list apm all-properties]
set last_acl [lindex [lsort -integer [regexp -all -inline -- {\d+} \
[regexp -all -inline -- {\yacl-order\y\s\d+} $dump] ]] end-1]
set cmd "$name acl-order $acl_id application-uri $uri description \"$desc\" "
puts "\t$cmd"
...
}
NB: the 65535 ID for the ACL is reserved in our environment
I am not sure this is the most sexy way to do that, however 🙂
I'm also concerned about performances: is it better to use regexp(s) or go with loop as suggested by Kevin? I would say that regex eats more but looping through such a big output can also take a while.
Any advice?
Thanks Jérôme
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