Default STDIN Stream for Command - Keyboard

Q

What is the default STDIN stream for a command? Can I use the keyboard to enter data for the STDIN stream?

✍: FYIcenter.com

A

By default, the STDIN stream for a command is mapped the keyboard. If the command is reading data from the STDIN stream, you can enter it from the keyboard.

For example, the "SORT" command reads lines from the STDIN stream, sorts them and print them back to the screen. You can try the following command to see how it works:

C:\fyicenter>sort
line 9
line 7
line 4
line 8
line 2
line 6
^Z

line 2
line 4
line 6
line 7
line 8
line 9

Note that:

  • The unsorted lines were entered from the keyboard.
  • Ctrl-Z was pressed to terminate the input stream. Ctrl-Z is used on Windows as the EOF (End Of File) character.
  • The sorted lines were printed by the "sort" command.

 

Redirect STDIN Stream for Command to File

Manage Space in Command Option

Windows Command Syntax

⇑⇑ Windows Batch File Tutorials

2022-12-03, 1700🔥, 0💬