LPIC-1 Exam 1: 103.4 Lesson 1: Part 2

TechYes Public Learning Channel
TechYes Public Learning Channel
10 بار بازدید - 11 ماه پیش -
https://learning.lpi.org/en/learning-...

What is Standard Input (stdin)
Standard input (stdin) is a channel used by programs to receive input data. Here's what qualifies as stdin:

Keyboard Input: By default, stdin reads input from the keyboard. When a program is waiting for input, you can type it directly into the terminal.

Redirected Files: You can redirect a file to be the standard input for a command using the less than operator. The contents of the file become the stdin for that command.

Piped Commands: Using the pipe | operator, you can take the standard output of one command and use it as the standard input for another command.

What is Not Standard Input (stdin)
Here's what does not qualify as stdin:

Command-Line Arguments: When you pass arguments directly to a command, those are not read from stdin. They are processed by the program as parameters, not input data.

Environment Variables: These are not part of stdin. They are variables that can be accessed by programs but are not read from the standard input channel.

Hardcoded Values in a Program: If a value is hardcoded into a script or program, it's not coming from stdin.

Output to the Screen (stdout) or Error Messages (stderr): These are separate channels used for displaying information and are not part of stdin.

In essence, stdin is a specific channel used for inputting data into a program, whether from the keyboard, a file, or another command's output. Anything outside of this specific channel, such as command-line arguments or environment variables, does not qualify as standard input.
11 ماه پیش در تاریخ 1402/05/30 منتشر شده است.
10 بـار بازدید شده
... بیشتر