Use this command to copy standard input (stdin) and write it to
both standard output (stdout) and to specified files.
Requirements and Restrictions
- The parameters for this command are case-sensitive. You
must enter the parameters exactly as shown in the syntax
diagram.
- You can enter this command only in CRAS state or higher.
Format
- -a
- appends the specified file rather than overwriting it.
- path
- is the path name of a file you want to overwrite or append. If
multiple path names are specified, the ZFILE tee command will overwrite or
append all specified files.
Additional Information
- Online help information is available for this command. To display
the help information, enter one of the following:
ZFILE HELP tee
ZFILE HELP
ZFILE ?
In addition, the correct command syntax is displayed if you enter the syntax
incorrectly.
- You can use a vertical bar, or pipe (|), to direct data so the output from
one process becomes the input to another process. This type of one-way
communication allows you to combine ZFILE commands on one line to create a
pipeline. For example, the following pipeline uses the standard output
(stdout) stream from the ZFILE ls command and redirects it to the
standard input (stdin) stream of the ZFILE grep command to search
for those lines containing the word Jan.
ZFILE ls -l | grep Jan
The result is filtered output from the ZFILE ls command displaying only
the lines containing the word Jan in any position.
You can use pipes only with a combination of ZFILE commands where the
command on the left-hand side of the pipe provides data through
stdout and the right-hand side accepts data through
stdin.
- You can redirect the standard input (stdin) stream from the
keyboard to a file by specifying the redirection character (<)
followed by the file name from which you want the input read.
You can redirect the standard output (stdout) stream from the
display terminal to a file by specifying one of the redirection characters
(> or >>) followed by the file name to which you want
the output written. The > character writes the output to a
file. The >> character appends the output to an existing
file.
You can redirect the standard error (stderr) stream from the
display terminal to a file by specifying one of the redirection characters
(2> or 2>>) followed by the file name to which you want
the error output written. The 2> character writes the error
output to a file. The 2>> character appends the error output
to an existing file.
- Note:
- When you use the > or 2> character, if the file that
you are redirecting data to already exists, the file is overwritten and any
data in that file is lost. If you do not want to overwrite the file,
ensure that you use the >> or 2>> character.
- The ZFILE tee command is based on a subset of the tee utility of the
Portable Operating System Interface for Computer Environments (POSIX)
standards.
- You can use the following wildcard characters in the path name to select
files that satisfy a particular name pattern:
- Wildcard
- Description
- *
- Matches any string, including the empty string.
- ?
- Matches any single character.
- [..]
- Matches any one of the characters between the brackets. You can
specify a range of characters by separating a pair of characters with a dash
(-).
Examples
In the following example, the stdout from the ZFILE ls command
is piped to the ZFILE tee command and then printed on the screen. The
file named ls.output is overwritten.
+--------------------------------------------------------------------------------+
|User: ZFILE ls | tee ls.output |
| |
|System: FILE0001I 08:14:31 START OF DISPLAY FROM ls | tee ls.output |
| dev |
| etc |
| tmp |
| usr |
| END OF DISPLAY |
+--------------------------------------------------------------------------------+
Related Information
See Information Technology--Portable Operating System Interface
for Computer Environments (POSIX) for more information about the POSIX
standards.