Forum Discussion
Opher_Shachar_6
Feb 26, 2012Nimbostratus
Looking for a terse expression to get the (base) name of a Virtual
Hello all,
Given that [virtual name] evaluates to "/Common/Lishka.app/Company_vip"
What is the most terse expression to split that into
"/Common/Lishka.app/" and "Company_vip"
...
hooleylist
Oct 25, 2012Cirrostratus
Hi Opher,
I think the string commands actually work best to parse a VS name with or without folder(s):
when RULE_INIT {
set vsnames [list "/dir1/dir2/myvs" \
"/Common/myvs" \
"myvs" \
]
foreach vsname $vsnames {
log local0. "$vsname parsed as [string range $vsname [expr {[string last "/" $vsname]+1}] end]"
}
}
Logs:
: /dir1/dir2/myvs parsed as myvs
: /Common/myvs parsed as myvs
: myvs parsed as myvs
Aaron
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