| Purpose: | Copy standard input to standard output, and then copy the specified file(s) to standard output |
| Format: | Y [/= /D /T /F"format" /Unicode=[UTF-16LE | UTF-8 | ASCII[,UTF-16LE | UTF-8 | ASCII]]] file ... |
| file | The file or list of files to send to standard output. |
| /= | Display the Y command dialog |
| /D | Prefix each line with the current date (yyyy-mm-dd) |
| /E | Regular expression to match |
| /T | Prefix each line with the current time (hh:mm:ss.ms) |
| /Unicode | Input encoding |
| /F"format" | A custom time/date format string. See @DATEFMT for details on the format arguments. |
See also: TEE, piping and redirection.
Usage:
The Y command copies input from standard input (usually the keyboard) to standard output (usually the screen). Once the input ends, the named files are appended to standard output.
If you are typing at the keyboard to produce input text for Y, you must enter a Ctrl-Z to terminate the input.
When using Y with a pipe you must take into account that the programs on the two ends of the pipe run simultaneously, not sequentially.
See Piping for more information on pipes.
Examples:
To get text from standard input, append the files MEMO1 and MEMO2 to it, and send the output to MEMOS:
y memo1 memo2 > memos
The Y command is most useful if you want to add redirected data to the beginning of a file instead of appending it to the end. For example, this command copies the output of DIR, followed by the contents of the file DIREND, to the file DIRALL:
dir | y dirend > dirall
Options:
| /= | Display the XSORT command dialog to help you set the command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog. |