Here's a simple but useful tip that shows how to write to the log file using the Encounter command "Puts"...
In TCL, the "puts" command is use to write information to the console -or- to a file. For example:
encounter 63> puts "hi"hi
encounter 64> set outfile [open test "w"]file18encounter 65> puts $outfile "hi"encounter 66> close $outfileencounter 67> more testhi
But, how do you write information to the log file? Although it's possible to get the name of the current log file (and that's a useful tip in itself):
encounter 68> getLogFileNameencounter.log207
...it's not clear how to get the handle of the log file so that we can write to it with puts. It turns out- you don't need to because there's a special built-in command called "Puts" (note the capital "P") that writes to the screen -and- to the log file:
encounter 69> Puts "hi"hi
Note: that the string is still written to the console.
Note: too that the string is written to the log file:
encounter 70> tail -1 encounter.log207 hi
Writing to the log file can be particularly useful when troubleshooting a script and you want to write checkpoint statements that you can later search for using a text editor.
I hope this is useful.
Thanks bob, the command 'Put' is cool, very easy & useful.
I did some exploration in this space with another user just recently, and what we found was that it was an NFS caching issue. If we were looking at the log file on a different machine than the job was running on, it would take a certain quantity of data in the log file before it appeared on the disk where we were looking at the log file.
Is that the situation in your run environment too? What I've been doing sometimes is brining up an xterm on the machine I'm running on, or the log file viewer from within the tool.
I was unable to determine a way to force an nfs flush from within Encounter.
Bob, any guidance on how to flush the log and cmd channels? Often times I want to repeat a GUI type command (i.e. zoomBox) but have to wait for the file buffers to dump.