1
00:00:04,059 --> 00:00:09,820
Before talking about redirection of streams, let me quickly summarize key points of what we know so

2
00:00:09,820 --> 00:00:10,360
far.

3
00:00:10,390 --> 00:00:13,360
Every process has three different data streams.

4
00:00:13,540 --> 00:00:16,630
stdIn stdout and stderr.

5
00:00:17,140 --> 00:00:25,030
And by default, when you are connected to shell and start corresponding process like mkdir you name

6
00:00:25,030 --> 00:00:26,080
or something else.

7
00:00:26,110 --> 00:00:27,940
Picture looks like this.

8
00:00:28,860 --> 00:00:37,080
There was keyboard and using keyboard, you enter some commands and those commands are sent to stdin

9
00:00:37,110 --> 00:00:38,250
of the shell.

10
00:00:38,460 --> 00:00:45,540
Because Shell is also a process like bash, shell or shell and it also has those three data streams

11
00:00:45,780 --> 00:00:48,660
stdin stdout and stderr.

12
00:00:49,290 --> 00:00:57,630
And when you go to the terminal and enter ls, you actually interact with stdin of shell process.

13
00:00:58,140 --> 00:01:06,540
And inside of that process it creates one more process and connects to stdin of that process.

14
00:01:06,810 --> 00:01:15,780
In this example LS process also by default there will be connection from stdout and stderr data streams

15
00:01:15,780 --> 00:01:19,920
of new process to corresponding shell process.

16
00:01:20,760 --> 00:01:27,600
And that's why if I enter LHS here and press enter, I see this output in the terminal.

17
00:01:27,630 --> 00:01:36,840
That's because data stream from LHS process STD out was redirected to Schell process and Schell process

18
00:01:36,840 --> 00:01:39,510
has printed this result to the screen.

19
00:01:39,600 --> 00:01:41,070
That's how it works.

20
00:01:41,340 --> 00:01:44,820
Same applies to stderr data stream.

21
00:01:44,820 --> 00:01:53,880
If I enter again mkdir without any arguments, I see text that was produced by stderr of mkdir process.

22
00:01:53,910 --> 00:02:00,660
It was sent to Schell process and Schell process has produced this error to the screen.

23
00:02:01,410 --> 00:02:02,640
That's how it works.

24
00:02:02,970 --> 00:02:11,009
But afterwards, when I have tried to redirect output from stdout of specific process to the file,

25
00:02:11,100 --> 00:02:14,430
we have tried that above using command.

26
00:02:16,090 --> 00:02:22,300
This one, For example, we have redirected STD out data stream of RLS process to the file.

27
00:02:22,840 --> 00:02:29,360
I have changed this default behavior and I have moved STD out stream to the file.

28
00:02:29,380 --> 00:02:34,420
Here I have sent output from STD out to the file like this.

29
00:02:35,830 --> 00:02:37,480
All right, let's now proceed.

30
00:02:37,480 --> 00:02:46,750
And next, let me explain you what are numeric ids of stdin stdout and stderr and how you could redirect

31
00:02:46,750 --> 00:02:51,190
simultaneously stdout data stream and stderr data stream.

32
00:02:51,190 --> 00:02:59,500
And also I will show you first example of the process that accepts data via stdin data stream because

33
00:02:59,500 --> 00:03:02,260
actually LHS and mkd are processes.

34
00:03:02,290 --> 00:03:05,710
Don't accept any input via stdin.

35
00:03:05,740 --> 00:03:10,960
You are not able to supply some additional text to stdin of LHS process.

36
00:03:10,990 --> 00:03:13,330
All right, let's proceed and I will see you next.

37
00:03:13,330 --> 00:03:13,780
Bye.

