Reputation: 47
I have three string variables in my TCL script now. Var1 Var2 and Var3.
I want to append them to the end of the output.txt with having blank space between them.
so the added line would be like this:
Var1 Var2 Var3
Upvotes: 0
Views: 1698
Reputation: 81
set fp [open output.txt a]
puts $fp "${Var1} ${Var2} ${var3}"
close $fp
Upvotes: 1
Reputation: 246807
You would open the file in append mode. Then, write the string to the opened channel. You'll probably want the string to be a double-quoted string so variables can be substituted. Then, close the file.
Upvotes: 0