I would like to ask about "WHY?" and some help with strange problem with file reading.
I have file with values like :
var1=home
var2=dog
In my code I am trying to find name of variable, get line where it is placed, trim it and receive value (e.g. home)
What I am using to get it:
puts [regexp { $var_name*\s*=\s*\s*(\S+)\s*} $line all ip_ftpAI]
I made also small check before:
if {[string match $var_name "var1"]} { puts " value ok:$var_name"
It is always as true
When I am changing $var_name to normal string like "home" it works but solution is just for one possibility.
Can someone give me some advice how to deal with the problem?