9.7.10 SPOOL

Purpose

The SPOOL command writes (spools) the results of commands to the specified file.

Syntax

SPO[OL] [file_name [ CRE[ATE] | REP[LACE] | APP[END] ] | OFF]

Usage Notes

If you issue SPOOL file_name with no option, then the output is spooled to that file whether or not the file already exists. The REPLACE option is the default behavior.

Table 9-14 SPOOL Options

Option Description

APPEND

Adds the results to the end of the file specified.

CREATE

Creates a new file with the name specified, and raises an error if the file exists.

file_name

Names the file to which the results are written. It can be specified with a fully-qualified path name, or with a partially-qualified path name relative to the current directory.

no option

Displays the name of the current spool target file, if any.

OFF

Stops writing (spooling) output to the file.

REPLACE

Replaces the contents of an existing specified file. If the file does not exist, then REPLACE creates the file. This is the default behavior.