[plug] writing to file and screen

Cameron Patrick cameron at patrick.wattle.id.au
Fri Mar 12 14:26:30 WST 2004


Hi,

Ryan Smith wrote:

| It is very hard to see what I am typing when I use my_program >
| output.txt.

In theory you should be able to do "something | tee output.txt" and
get the output sent to stdout as well as to output.txt.  However, this
won't capture stdin, and you might find that this suddenly introduces
extra buffering as the system decides that its output is going to a
pipe rather than directly to a terminal.  So you may be better off
using script instead.  From 'man script':

      It is useful for students who need a hardcopy record of an
      interactive session as proof of an assignment, as the typescript
      file can be printed out later

Cameron.



More information about the plug mailing list