Before talking about redirection of streams, let me quickly summarize key points of what we know so
far.
Every process has three different data streams.
stdIn stdout and stderr.
And by default, when you are connected to shell and start corresponding process like mkdir you name
or something else.
Picture looks like this.
There was keyboard and using keyboard, you enter some commands and those commands are sent to stdin
of the shell.
Because Shell is also a process like bash, shell or shell and it also has those three data streams
stdin stdout and stderr.
And when you go to the terminal and enter ls, you actually interact with stdin of shell process.
And inside of that process it creates one more process and connects to stdin of that process.
In this example LS process also by default there will be connection from stdout and stderr data streams
of new process to corresponding shell process.
And that's why if I enter LHS here and press enter, I see this output in the terminal.
That's because data stream from LHS process STD out was redirected to Schell process and Schell process
has printed this result to the screen.
That's how it works.
Same applies to stderr data stream.
If I enter again mkdir without any arguments, I see text that was produced by stderr of mkdir process.
It was sent to Schell process and Schell process has produced this error to the screen.
That's how it works.
But afterwards, when I have tried to redirect output from stdout of specific process to the file,
we have tried that above using command.
This one, For example, we have redirected STD out data stream of RLS process to the file.
I have changed this default behavior and I have moved STD out stream to the file.
Here I have sent output from STD out to the file like this.
All right, let's now proceed.
And next, let me explain you what are numeric ids of stdin stdout and stderr and how you could redirect
simultaneously stdout data stream and stderr data stream.
And also I will show you first example of the process that accepts data via stdin data stream because
actually LHS and mkd are processes.
Don't accept any input via stdin.
You are not able to supply some additional text to stdin of LHS process.
All right, let's proceed and I will see you next.
Bye.