Ran into another problem. Is there a way to use a switch statement and have it look at the value of a variable for the comparison? In the following switch statement, the switch doesn’t recognize or match with $SegOne. Even though I get SegmentType as MSH, it never hits the SegOne case. I don’t want to hardcode MSH in the switch as that would defeat the purpose of using a variable.
Any thoughts? I’d appreciate it.
Thanks,
Nate.
set SegOne MSH
set SegmentType [lindex $seg 0]
switch -exact — $SegmentType {
$SegOne {
puts stdout “Inside with $SegOne”
}
default {
puts stdout “Outside with $SegmentType”
}
}