|Purpose:||Copy standard input to standard output, and then copy the specified file(s) to standard output|
|Format:||Y [/D /T /F"format"] file ...|
|file||The file or list of files to send to standard output.|
|/D||Prefix each line with the current date (yyyy-mm-dd)|
|/T||Prefix each line with the current time (hh:mm:ss.ms)|
|/F"format"||A custom time/date format string. See @DATEFMT for details on the format arguments.|
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.
For example, 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
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.