Folks,
I am at a loss... Im trying to use 'string match' to compare 2 items in a list. However, the 2 items contain special characters. This all falls into a much larger script that I wrote but I wrote a small one here to show what I am doing as an example.
#!/usr/local/bin/expect
set MasterList
I am at a loss... Im trying to use 'string match' to compare 2 items in a list. However, the 2 items contain special characters. This all falls into a much larger script that I wrote but I wrote a small one here to show what I am doing as an example.
#!/usr/local/bin/expect
set MasterList
lappend MasterList {\"B\"}
lappend MasterList {\"B\"}
puts "MasterList=$MasterList"
set value [lindex $MasterList 0]
set value1 [lindex $MasterList 1]
if {[string match $value $value1] != 1} {
puts "They do not match"
} else {
puts "They match"
}
I'm just stuffing 2 strings(with special chars) into the list. Then pulling them out individually and comparing them. The 'string match' comparison is always returning a 0, saying they dont match....
Any ideas as to how to compare strings with special chars like this?
Thanks in advance for your help!