Forum Discussion
- hooleylistCirrostratusHi Robbie,
switch -glob $var { "/here*" { Matched here } "/there*" { Matched there } default { Didn't match here or there } }
- Robert_47833Altostratusthanks,Aaron,
!({$var starts_with "/here"})
now I am trying to change it to switch
how to represent no or ! in switch?
There isn't an option to negate, but you could use a default case to match anything that isn't matched by a prior case:
switch -glob $var {
"/here*" {
Matched here
}
"/there*" {
Matched there
}
default {
Didn't match here or there
}
}
Aaron
I really learn a lot from u