I'm trying to do something that might be basic, but it is not working for me, and I suspect I'm missing something.
I appreciate if you can shed a light or offer an alternative.
In expect script, I'm opening a file i.e:
set file [open "myfile.txt" w]
I have a simple proc:
proc a {} { puts "Hello world"}
And I'm trying to do the follow:
puts $file [a]
And:
close $file
I wanted to see "Hello world" in myfile.txt, but it doesn't work, myfile.txt remains empty.
How can I make it work?
what is wrong the script?
Thanks in advanced
P.S I tried google it a lot, but couldn't find anything so far