2.7.1 Flashcards
_____________ is data that is typically streamed from the keyboard. If a bash command accepts input, by default, it is gathered from stdin.
Standard input (stdin)
________________ is data that is typically streamed to the console screen. By default, bash commands send their output to stdout.
Standard output (stdout)
_____________ is data that is also typically streamed to the console screen. If a command needs to output an error messages or give diagnostics, by default, it sends this output to stderr.
Standard error (stderr)
A Linux pipe is represented by a
vertical bar (|).
The pipe functionality is similar to that of using stdout redirection to write the output of one command to an intermediate file that is then used as input to a _______________ using stdin redirection.
second command
A plumbing pipe, where water enters from one end and exits the other, can be used as a mnemonic to help explain how the pipe (|)
Operator works.
The output from a command is piped to the
tee command.
The file used to store the output is added as a tee command __________
argument.
A plumbing tee, where water flow is divided from one pipe to two separate pipes, can help you understand how the tee command________
works.
__________ are file-like access point to hardware devices.
Device files
There are two __________that are often used with redirection and piping. /dev/tty and /dev/null.
device files
A _________ is a block of text that is redirected as input to a command
here document
Here documents are often used in ________ scripts.
shell
Command substitution is implemented using the ____________ operator.
$()
When the shell’s command line interpreter encounters the $() operator:
The shell creates a child process that runs the command specified.
The stdout from this first command is redirected back to the shell.
The shell parses the output from the first command into words separated by white space
The shell creates a new command by substituting the parsed output from the first command in place of the $() operator.
The shell creates another child process that runs the second command.