Description
Writes data to file or standard output and standard error output.
Synopsis
puts [channelID] string
Options
Specify the channel ID acquired as the return value of the open command. Specifying stdout and stderr enables writing to the standard output and standard error output. If omitted, writing to the standard output is enabled.
Specify the text data to write.
Caution
An end-of-line code is always added to the end of the text when written.
Examples
The following example outputs error messages to both the log file and the standard error output.
[Windows]
set errlog [open {c:\var\tmp\log.txt} a] puts $errlog $ErrMsg puts stderr $ErrMsg close $errlog
[UNIX]
set errlog [open /var/tmp/log.txt a] puts $errlog $ErrMsg puts stderr $ErrMsg close $errlog