.BG
.FN sink
.TL
Send S Output to a File
.CS
sink(file, command, append = F)
.AG file
optional,
character string giving the name of a file.
.AG command
optional,
character string giving the name of a command.
.AG append
for writing to a file, should the output be appended to the end?
.PP
If `file' is given as a character string,
output is diverted to a file named `file'.
Otherwise, if `command' is given as a character string, output is
diverted through the named `command'.
If both `file' and `command' are omitted, diversion is ended.
Normally, `file' is truncated before diversion begins; if `append' is
`TRUE', diverted output is appended to the end of `file'.
.SE
When output is being diverted to a sink file,
nothing appears on the terminal
except prompt characters and error messages.
In particular, functions using the `unix()' interface
will not put standard output on the user's terminal.
This means that editor functions such as `ed()' and `vi()'
cannot be used when a sink is in effect.
.PP
Sink files cannot be nested, i.e., if `sink' is called when
output is being diverted to a sink file,
the previous diversion is terminated. 
.EX
sink("my.output")      # divert output to file
\&... now do anything
sink( )  # revert output to the terminal
sink(command='tee script')  # keep a session script
.KW file
.WR
