RosettaCodeData/Task/Take-notes-on-the-command-line/Tcl/take-notes-on-the-command-line.tcl
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

17 lines
364 B
Tcl

# Make it easier to change the name of the notes file
set notefile notes.txt
if {$argc} {
# Write a message to the file
set msg [clock format [clock seconds]]\n\t[join $argv " "]
set f [open $notefile a]
puts $f $msg
close $f
} else {
# Print the contents of the file
catch {
set f [open $notefile]
fcopy $f stdout
close $f
}
}