Hi, I encountered this issue on both Solaris and Linux, with tcl version 8.3/8.4
please see the following code:
#!/usr/bin/tclsh
set pattern "this is * and *"
set str "this is tcl and c++"
switch -glob $str {
$pattern {
puts "matched pattern"
}
"this is * and *" {
puts "matched plain text"
}
default {
puts "matched none"
}
}
and the result is "matched plain text". I though it should have matched the $pattern... is this an incorrect usage of switch, or I am not giving correct pattern for -glob option?
please someone give some idea and it is better if you can tell how to modify the code to make it run with switch and variable.
Thanks! XM