gtpo1m6c | Operations |
Use this command to substitute or delete characters from the standard input (stdin) stream and pass the results to the standard output (stdout) stream. The results are displayed on the screen, but the input file is not changed.
Requirements and Restrictions
Format
|
Additional Information
ZFILE HELP tr
ZFILE HELP
ZFILE ?
ZFILE ls -l | grep JanThe 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 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.
Examples
In the following example, file tempfile contains string aaaabccccb. The -s parameter indicates that characters specified in string1 (abc) are replaced by corresponding, positional characters in string2 (xyz) while duplicated characters are eliminated:
+--------------------------------------------------------------------------------+ |User: ZFILE tr -s abc xyz < tempfile | | | |System: FILE0001I 08:14:31 START OF DISPLAY FROM tr -s abc xyz < tempfile | | xyzy | | END OF DISPLAY | +--------------------------------------------------------------------------------+
In the following example, file tempfile contains the following single string:
one two three
Each word is separated by two tab characters (\t). Note that in the display, the words one, two, and three have not been separated by the new-line (\n) character. The actions of the -s parameter take place after all other deletions and translations.
+--------------------------------------------------------------------------------+ |User: ZFILE tr -ds "\t" "\n" < tempfile | | | |System: FILE0001I 08:14:31 START OF DISPLAY FROM tr -ds "\t" "\n" < tempfile | | onetwothree | | END OF DISPLAY | +--------------------------------------------------------------------------------+
In the following example, all lowercase characters from a to s are replaced by their uppercase equivalent. File tempfile contains the following:
one two three
Each word is separated with a new-line character (\n).
+--------------------------------------------------------------------------------+ |User: ZFILE tr a-s A-S < tempfile | | | |System: FILE0001I 08:14:31 START OF DISPLAY FROM tr a-s A-S < tempfile | | ONE | | twO | | tHREE | | END OF DISPLAY | +--------------------------------------------------------------------------------+
Related Information
See Information Technology--Portable Operating System Interface for Computer Environments (POSIX) for more information about the POSIX standards.