So, the most important thing to review for the, for the midterm, are the assignments and to make sure you understand the assignments you should review the tutorials.
So, we are recording Yeah, I'm going to start recording now.
Okay. Good morning, let's uh let's go ahead and get started here. Um, so today's midterm review. This will be a bit of a shorter class I normally find actually meant to reuse tend to be shorter.
So it actually works out but I need to head to the airport.
So, Let's, let's start talking.
You know here. So, first off, I'm going to go through assignment to solutions which I've posted here.
They're not here they are, if you go here to the, to the assignments your assignment to solutions, you'll see, they'll see solutions and now here and it's right there.
So let's talk about this.
Um, if we read from dev know what data do we get how can we verify this.
No.
That's what you get.
It's always empty.
So, and in fact if you if you I'll put it to a file, you'll notice that there's nothing there.
To 3000 capture requires commands to be fully qualified path names. How can you modify to encapsulate commands and have a slash. So, basically, copy the find binary function from 3000 shell.
And then you call it now, I kind of did this a little bit of a messy way because I just put all the pieces together I could have said put this at the top but actually if you just insert this as it is, it will compile really should move these declaration
the top of the function and you should move this top of the file but the important code is this, which is literally, if there's not a path to the default path from find binary and
so his exact VP next central answer for question too.
Um
hmm.
Yeah, I think so.
Exactly pic, I always forget which one.
Exactly P.
I always forget which I think there's there's various versions of this.
So,
okay,
there's no way to post a screenshot for question was why split it normally exactly that's what you want to do, instead of getting a call us find them.
Yes, you could use find them but you'd have to copy the code to find them to it.
Do we have to write exactly what this will create a method to get them variable.
So if you just say a method to get the variable, you would have to be a little specific about what the method was because otherwise go like okay you need to get the variable it's like there's not any, there's no, there's no demonstration that you know
that technical concept.
So why do I have to check if there's a PATH variable, isn't it always set by default, it is normally set by default, but it is in principle possible for that variable to not exist.
If for some reason you are given an empty environment, there's no technical reason that that can't happen. So you could you normally shouldn't assume environment variables will have the values you want, you should normally have things because anyone who
know whoever called you can be certainly environmental to any sort of value. So, and in fact actually a big security thing is you have to check environment variables, if you're running his route that they don't have any funny business because that's actually
been a number of security vulnerabilities by people just putting garbage into environment variables and programs just trusting environment variables.
And probably wing it myself, horses.
Do you parse the RX diva contains a slash sort of trophy and then find binary.
Find binary does the slash part you don't need to do it explicitly.
Yeah. So, so you know, there's different ones and, you know, your TA will try to figure out the nice thing about how we do grading now is the TA, get the questions, all in, you know, you know, once he is reading all of question one are all a question
to all of us, so they can make sure their uniform in their grading.
So, and know that these are whatever you get, you know, but of course if there's a problem we can you know I'm happy to look at it but
what is the purpose of the flash.
So, this was something I haven't directly discussed, but you should, if you do the experiment of removing the flesh and running the program you should quickly see that, oh the dots all print at once as opposed to printing what individually and so.
Turns out the standard C library doesn't do a right system call every time you do a print effort or something to standard out it buffers them in some sort and then does it all one so that way instead of doing like 10 system calls, if you do like 10 printouts
it potentially does one big system call, but it does automatically when we flush, whenever you have a new line.
So here we're just flushing it manually. So you can see those dots on the same line go by.
How could you fix the lead capture so it sends its output to the file specified by the capture environment variable. So, you know again.
Why do was I changed the output function to be output function to fall because we need to have a default place. And then I made output function, you know basically did get em and if it's not there set it.
So, as, as we discussed, again, we can't assume like anytime you get anything from environment variable it is input and input may not be provided or it might be all messed up.
So you should always check it for sanity and do where his yeah here we're just, you know, we're going to check to the world in the file or not but, you know, we're not doing too much so at least we're making sure it exists.
And where do we need to find reasonable If not, how many processes counties create and how many fuels doesn't run. So, what I was hoping for you to do was run execs new BPF trace.
In one window and then run countdown me if you want you could just output this to a file, and then run countdown. And then when you run it what you should see.
Is that what you should see like this like okay there's the process running countdown. And then there's the sequence command which generates you know that's actually a separate program that's creating one through 10 me, you'll notice sometimes Unix commit
you know you run an entire program to do almost something trivial, not to sound trivial in Shell programming but that's the way shell programming is up, and then you see a calls to the sleep program for, you know, 10 times.
And you notice the process number is incremental one by one. So you know, there aren't any other processes being created during this time. So we've got, you know, 1011, probably our countdown itself is creating 11 prophecies, with two executable one asleep.
And what a sequence.
Well if you guys 12 process I mean if you count, count down he's a counter itself is creating a process I mean, that's fine.
The one I wouldn't work off by one is just explaining you should explain that you know there's countdown, and then there's the other ones, but notice countdown countdown technically didn't create this process, whoever did exactly he created that process.
Where did exactly which would be the shell, did the executive was actually created, not 5962. And then, it did the exact ve so countdown itself, only created these processes.
But why are the two or three are sequence like exactly
sleeps sleep.
So, there's no, a process is just a process, it can be running any code here. Sleep is an executable sequences an executable, but to run them, they must run inside of a process sequences running inside the process, 5963 Sleep is running inside the process
at 5964 I mean it's just like you have a USB stick with the program, it's not running, you got it loaded into memory, and that's what our processes.
Oh, look who came to visit.
Say hi here.
Yes, hello, or even said hi to class.
So, what this cat, same, but this is shift. Hello shift, I should say, and I should is okay you're insisting on attention yeah okay we'll just keep you.
Yes. Hello. Hello.
Okay. Where were we. So, So yeah, so make sure you have understanding of what the differences between a binary a program binary, and a process. The process is a running program with arbitrary you know whatever code in it.
Oh you're sitting down and getting comfortable Okay, fine.
Yes. Oh, okay. Good, now you're going. Okay.
And she's done, such as the nature of cats,
she'll ever 10 prophecies and what executable. Um, I can't give you 10 prophecies and what executable because then you miss sequence. So
I think the formal results have many duplicates, but you seem to do.
So there's 11 processes. So if I look at when you say an executable. I should talk about a file on disk.
You know, on a file system will talk about discuss a little complex the concept but there should be a file.
And so, I count two files here, sleep, and sequence is a user been sequence user been sleep. I'm pretty sure that's what those are. So,
there are there are 11 exactly the system calls, there are 11 v six, this isn't calls but how many executable does it run, like how many distinct executable are there.
You can be if you said that it's running exactly 11 times.
Um,
you know, I'll leave it to the TA decide how to interpret that but it's, you know, there's only two programs, sleep, and that's actually the key idea here is I want to so the mapping between executable and prophecies.
You know, you can have one process that can run one executable than another executable. And you can have many processes running the same executable.
That's the thing. It's not a one to one mapping.
Open Snoop can potentially work too but the only true with open Snoop is you don't know what
opens new causes you probably, I don't know if open Snoop works for exactly is near. But
you're not. I mean, you have to see what you output but I don't think it does that,
um, there are there are other programs like there's like, I think things that show the number of PhDs it's like if you use that and it shows you the number process.
question.
That's a judgment call that's up to the TA but I want you to have now make sure you understand executable.
Our programs on disk processes are running programs.
And we're running program versus why this is a very different thing. And you should have those concepts separate.
So, again, so what is child exit for why is it needed.
So, this is so child exit you just say something about the signal handler wants to communicate with parents, that the child is terminated. We don't want the single handler do everything because remember it's unsafe to do too much of a signal handler.
So that's how we send a message back to the main loop. Using this flag.
Yeah.
How can I, how can you create a shell script that sends a cig term signal to whatever process, you know, that ran. Oh, by the way, with this sort of thing is, you should have had an intuition about what how many what was happening here.
You should have some sort of intuition by looking at the program and then you do this and go like do I understand the program there wasn't this run a program you get an output you're good, whenever you get output from a computer, you should always go
like, Is that the right output Do I understand that output. Does it make sense because, you know, garbage in, garbage out, you know, mental model. So,
exact Snoop Yes, yes, and it's exact Snoop watch. Yes, yes the exact Snoop
was, was a child actor we talked about how can you create a shell script that sends a sick term signals were across that ran it.
So here, some of you were using dollar dollar, dollar dollar is the process of script dollar PP ID is the process of the is the parent process.
Notice that you really need to use a built in some provision of bash to figure this out rather than trying to run a program because you use a command you can start another process and then it will, if you try to fight it's better process it's going to
be this, except if you had made a program that then she found its grandparent process which would be this one's parents. I mean, you could do that but that sounds very painful.
So when bash has this built in proceeding of things.
You don't need the echoes the echoes aren't necessary but I would put echoes and so this will even say what the heck's going on.
That's why I put them in there so I want to make sure is that scripting and being run.
Um, you know, so we are at the output and you'll you'll see waiting terminated. Yeah.
Oh by the way, though I like so. After this I, I saw this, this right here basically is what I'm expecting for the answer, but I wanted to explain more for you all.
So I kind of I go through a made it a little fancier. So, here's an enhanced version. So what this does is it.
It shows, it's basically what it's doing is, it is doing a little special version of PS which is outputs this information, and what the thing I wanted you to show is that we've indeed killed the parent of this.
And notice that kill parent has now a parent process of one. So it is so certainly it got repaired wanted to in it, or you know system D is it on know be systems but you know so I got reprinted there, and that shows you that the parent died.
Oh,
yeah, yeah, yeah kill 15 fine yeah kill 1515 is a terrific term.
But, so this part I was definitely not expecting you to do this, but this is just an extra stuff for you to like, make sure you understand what's going on.
Okay, um, question eight.
How can you verify that the shell script from the previous question is actually saying the right Singleton using DPF trace.
If we run the kill Snoopy pf trace where we see output like this. So if you do this, then you'll see that kill parent, you know, set signal to it you know 6424 its parent process was 645, years.
So, so here we see 615, we look it up, and we see that St Thomas 15.
So are we supposed to write the output and the answers are Can you just explain them. Um, you can explain them, what you get. But, you know, more precision is better I mean it.
If you accomplish it with dollar dollar. It's okay. I'm, I'm pretty sure.
Okay.
Bass pi the expense of the process ID of the current batch process is different from dollar dollar under certain circumstances, some shelter or Bashi initialize assignments a basket of no effective batches and set.
So, normally dollar dollar is the batch process so this is not the parent process. This is the process ID of the bash thing that's running killed it so if US dollar dollar you almost certainly got the wrong answers.
One second is to make sure it Yes, Exactly. So we're moving on here okay so
how could you change capture see this in your business weights once I know the reason why we have this wait one second in this description is so that you make sure that the single has been processed and the end of the process has taken whatever case as
it just shut down because it sometimes takes a second for policies to terminate themselves. So let's make sure actually happened.
As opposed to jumping the gun because if you check immediately.
That process probably wouldn't have terminated takes a little bit of time.
We don't have to wait a whole second, but you have to wait a little bit. So, So the solution here is a little, you know, there's a bit of stuff going on here and I'm happy to walk through it right now.
But, um,
for the exam, we should support it with code right off the bat we can explain. Actually, I would reverse that you're taught your, your time constrained on the exam, so I do not expect you mostly to be writing much code.
Your might write like maybe a line or two, but mostly on the exam you should be just writing things I mean, technically the test is open book open note open Internet, but I write it as if it was closed book you should be able to do everything without
referring to anything else.
In fact, you should plan to spend most of your time just, you know, doing because again the things to think about as opposed to just look up and do
in assignments I often have do this action. So when. So, for that case I'm like, okay, you did the action, what did it do show me what it did.
And then explain it.
So it's okay to save child p it as an intro and PIDT it turns out ca that strict on.
But technically the size of a process it might not be the same as that of an interface on the architecture and other things so you should normally use the type of good practice use the type associated with that.
If you use return 10 instead of exit 10 Is that okay since parent returns domains were talking about so if us return 10 It depends on where you did the return, and how you run your code in my code that wouldn't have worked.
So, but just explaining this. So, what do you have to do first, we got to have our. We got to do something on CIG user one, then we need to.
I made the child PhD.
I changed. I changed the declaration to the child p ID and make the idea global. And so because I wouldn't have to change the rest of the code and I could make it all refer to this and I said, and then I sign it so we've got it in the global in the parent.
Or I could have changed it so apparently this is lots of ways you could have done this, this is not particularly good style.
Again, there's not trying to good code is trying to explain concepts.
Then you modify the signal handler to handle it. So, at a little condition. If the signal happens and we print, and we send the kill.
And that we say that the child has been killed. So we set that flag.
You have the declaration to the top, and then you change the parent to check to see if a child is exited if it hasn't exited.
You know what we know a child hasn't exited then, if it's been killed.
Then you so so this this is normally there we're just adding this inside the loop, saying if it's killed, let's handle the killed child.
And then so now here the way with this is like if this function returned, it will continue with the loop and keep printing dots. We don't want to do that, we want once this function starts we want to terminate the program.
So that's why this program does exits explicitly and this you know checks the status and.
But you didn't know kill was a function.
Well, what you should see is, you should know that most.
So yeah looks out yeah I had a flight to see us a similar chart exit and check with the well okay okay thank you
decide it looks short and fairly hard after seeing the solutions. Well, it's no, this wasn't supposed to be
library calls different from different operating systems.
So.
so, you know, there's a concept of standard in standard out standard error and stuff in the standard library that directly maps on to Unix concepts, but the C library use a file struct while Unix uses.
Things like what you can tell is if you're looking at a program.
So notice this program. If you look at its header files.
So, standard the standard IO is, you know, standard IO is things like printer standard live is like Malik and I'm not sure trauma was instead of live here but then we get into this things like Eunice did that's a Unix standard system types, all the system
stuff. This is all this is all really unique specific.
But Unix is so common. When you program and see, even if you're on Windows or something you might start using stuff like this, I haven't really checked but.
Yes.
Does that make it easier for us f printed standard or print off
of print up to standard error versus print staff.
So there's a question whether you use f print the standard error versus.
Okay. So, is there any other way to send a signal and see without kill a, you could run a program to send the signal you could run Kill Command.
The system calls they don't of course my implementation and see. Yes, well then implement these are rappers.
You create a new function I mean, that's a stylistic thing. I definitely need to create a new function.
I don't expect you so.
so don't get too hung up on that so.
So, I have a question about BPF trace, you always tell us to verify using BPF trace do we use a link from tutorial for other ways to do it.
There are definitely other basic rule, other ways to do it equals yes
I don't know I'd have to check them in page.
But But in general, I mean, if you're writing multi, multi This is why multi cc sterilized was not designed with multi threading in mind.
The other bps trips even UC Merced.
Ok.
Okay. flush Okay.
Is kill the same as signal.
Okay, so how do programs handle the signals they receive they didn't add a hand signal. does it use a library.
Once
I use the wrong crowd he as a PPID by explaining the logic correctly on the assumption was right value will be so penalize.
So,
eggs, exactly i Jesse exactly, if you, if your logic was there, you'll probably get a lot of the points, but you should have definitely verified it for an assignment you know on the test of course you probably won't have time to verify.
But on an assignment, you should verify the answers. That's the whole point of having this you shouldn't just look something up and give the answer I expect you to do experiments because that's in fact what you have to do when you're developing code is.
You think you have a solution, you have a high, really it's always a hypothesis, you have to test it to make sure it works because all the time that your understanding will be limited
signals for signal headway so
you can definitely get partial marks, you know, me again yeah it's. So what I do is I give suggestions for the th and how to market and they're pretty fair.
And, you know, I'm about to use. I have just about assignment one great, I'll be posting that.
So that will give you an idea of how how things went but that's so so let's go back and let's say my say that the midterm is based on the assignments.
What do I mean, do I mean that I'm going to repeat these questions exactly know, although they couldn't be copied.
That is possible.
So, you know, the midterm is based on the assignments, and the assignments are based on the tutorials. So, but what I mean that so like if you look at this,
if not the question here so so what am I asking you about here I'm really asking about couple of things. One is I'm asking you about what the heck is def know.
And then also, you know, something weird about this is like always. So, what is dev know, it's like, what happens if you write to death. Now, did anyone check that.
But do you need to be connected to the VM for the midterm No, exactly, it disappears. Exactly. So, what I expect you just like did you look at death no it's a very useful thing.
It's like, no matter what you right to it, it always is empty.
And so, that means if you need an empty file, you're guaranteed that to always be empty.
And then here when I say by, you know, using fully cloud password like what I'm asking about here is, do you understand what happens when you type a command at a show.
The whole concept of you type of the command you either had to specify the exact path name or if you're going to search it's going to go into the value of the PATH environment variable, that's what I want you to understand, you know, but I don't want
you just to regurgitate it like I could just say what is the PATH environment, what is cost resolution, like, you could memorize and answering. Give me the exact thing but I don't want you just to repeat it to me.
I want you to understand it, which means the knowledge that you can apply to solve problems, which is what you were doing here.
I will talk BIT MORE ABOUT flush flush this out because that's what I haven't talked about much but that's.
To learn more about it.
So, so the whole thing is like if all these things are.
Yeah.
Data written the dev Nolan does your special files and raised from dev no ultra into fall risk, while reaching does zero for advice contains your characters.
Yes.
Question three took a lot of googling.
Um. Why did.
Question three shouldn't have taken a lot of googling because though so so how do you solve question three.
Question three how you should have solved it was. First off, you go to the code and you go like, Oh, here it is, first thing I would do to see what the code is delete the line.
Run the program, and see what happens. So you delete the line run the program see what happens, you would have seen an obvious change.
And so then you go, Hmm.
Why is it behaving differently. and then you would go, man. Flush
forces are right of all us a buffer data.
So there's buffering.
So, you shouldn't have needed to do one Google search for that question.
Before if you just, you know, use the things out your, your hand.
No. So, so Robert saying, um, will you have to search for things. So, the idea is that I'm not going to require you to search for anything because it's all going to be covering things like covered in the assignments, so you should already know it.
If you have to search for anything it's maybe something you quickly forgotten have to look it back up so know that I'm going to be asking about the same thing.
If you want to refresh it and stuff but yeah that will burn time I'm expecting you to be able to figure things out mostly on the test.
The exam isn't closed book because enforcing closed book online it's kind of stupid but honestly, if
you could try figure out that all the questions online if you like kind of like looking things up and stuff like that but if you do you won't get to the whole test.
I don't memorize the commands. I mean, if you need to quickly look them up use man dash K or something,
your
cursor.
Okay, so how many questions be on the midterm normally my midterms are more like
I haven't finished making up the midterm yet so I can't tell you the midterms normal like.
Remember it's, you have two assignments, there's 20 questions on those. It's probably order that, but they're simplified that they're organized in such a way that you shouldn't have to do searching that if you did the assignments and you did the tutorials
in a reasonable way.
I'm just testing those concepts.
So.
So the one thing this class I'm trying to I designed it to do is I, your first instinct. on solving a problem should not be to search your first instinct should be to think.
And then once you think about it, you may go like, Oh, I have certain questions about certain things.
Then you go and find information and maybe look at man pages or maybe do searches or other things but first thing you have to say what is going on here.
And, and then any searches for you then to test your mental model. So a lot of you are looking a lot of you are in the model mode of doing pattern matching question pattern match, find things out there try to answer it.
As you've noticed that the pattern matching approach is very inefficient.
For the questions I asked and often error prone.
Can you back and forth from bright space.
pattern matching verify after yeah that's that's it
gets all during class here at minutes.
Can you submit multiple times, you can submit multiple times. But
I.
Howdy Mr. I can expect an assignment to take assignments.
So assignments are very different things assignments are opportunities for learning how much time it takes like honestly, I expect assignment to just take a couple of hours.
If you spent the time on the tutorials. If you spent the time the tutorials the assignments, easy. If you haven't spent the time the tutorials to really understand things to that's the problem with searching.
If you search things and you do it and then like that you're just you're not thinking.
So you aren't learning.
You're just recognizing. So if you answering questions the turtles purely by searching and not thinking about them, you didn't build a much more mental model.
And so you're you, the assignment was real hard.
But you, the simple way to sell did I do the tutorial right. How hard was the assignment.
So,
so it's structured differently from, you know, so I mean,
that's good question. Um, I am curious to see what, but let's let's I can do that real quick here but I don't have much, I would rather, I'd rather than doing polls I'd rather answer people's questions.
Yeah tutorial three was hard tutorial three was.
I expect your tutorial three was a hard thing that had a lot of concepts.
You know, that was, that was what I expected you to spend time going like what the heck's going on here. That was definitely the hardest one but, again, it's just, you know, you have this, you know, 300 Line 340 Line program you have to understand and
if you lack some of the concepts here. This is going to be hard but again it's hard.
I think this would take less time to do if you think through it rather than searching for the answers,
is through total three the hardest tutorial in the course some.
Yeah, assignment two is definitely easier than tutorial free.
No question.
Is to trophy the hardest to throw in the course saw it might be. I don't know I haven't made up the rest of the ones I mean I've got one from past years finally changing things around.
So, we will see what we, how they turn out for the rest of the term.
What so you're not going to be downloading any code for the midterm because you're going to be answering questions. You're going to download a PDF and look at it.
I taught tutorial three minutes. So one of the reasons why I made tutorial for tutorial for was designed to be simple because I, you know, and basically consolidate the concepts in tutorial three, because I knew tutorial three was long.
You don't need to run anything for the midterm. Yeah, but you can if you want to check your ideas.
Can you show us where you're going to find the midterm, it's going to be on bright space, it's gonna be assignment, it'll just have a link to a PDF.
So, solutions to solutions to tutorial three, it's like, what do you what do you not understand about tutorial three I'm happy to discuss any of the questions for tutorial three.
No tutorial for is definitely useful for the midterm
tutorial tutorial for his death because I'm good, I can ask you about things like.
So let's look at the know but again, I'm but that's not the big thing, the big thing is the assignments.
So like, you should understand all these questions to
other previous midterms on my wiki oh yes there are.
If you'll be able to message me on teams, and I'll have an open zoom. During the midterm. If you have questions during the midterm.
Question 11 on tutorial three.
Okay, let's review in previous midterms, um, it's useful to see the kind of general thing by don't cover exactly the same materials so that can be misleading, you only make sense to look at the previous year's midterms in the context of previous years
assignments.
There's no penalty for googling stuff you should give.
I'll give you know I'll give you a grace period like within five minutes that's fine yeah so, um, yeah during lunch time.
I'll look, I mean if you want to look at just the style of questions. Yeah, but let's say so you have questions about like the last one, let's talk the last parts of this tutorial threes.
So let's, let's go here so this is pretty easy there's just a difference in the interface, make POS outputs apparent process idea of each process. So, what did you do for 11 for 11.
You go into fine p list.
And what I would do here is I would make the equivalent of setup calm function that does the exact same but instead I would have the status file name, is that setup setup status file name.
And so, then I'll have a status file name, I would open that.
And then I would read each line until I saw one I'd make a separate function that does this that then returned the parent process ID, and that function would just open the file.
Read each line, check the first couple of characters to see if there are ppl ID. when it gets one that's PP ID that, you know, grabs a couple of, you know, last couple of characters and turns it into a number, and if it doesn't that return like minus
find the process ID or something so that's us have to make a function that does that it's just open read I mean, it's basic pray for one stuff just opening a file and reading it.
Yeah. Yep. If stream would work. Yep.
starts falling yet so you use you put references and Google on there but honestly if you spend a lot of time in Google and you're probably not going to do do well.
But if you need a look at one or two things. Sure.
Right.
When you see I will, I will post to graded which question.
But no, I'm not going to post a great question. If you have questions on grading of assignments. I want them to come to me, because I want to find out what's the problem because I need to make the call.
So um
so yeah so anyway, going back here, so that's certainly this is just read a file extract a line from it.
You know, and then put it into the printout, that's where it's got the print off that just adding a little thing there parentheses, I mean, invalid redirection of standard error.
Employee redirection a standard error is just, I mean you could have done a lot of ways, but we've already got it implemented the code for.
So where is it probably run program. So, single handler.
Mainly, oh yeah here so here's the main loop. here's where we do redirection of standard out.
So you need to do something like this, but instead of matching this you'd have to match, maybe making another character or match to end this, and then do the exact same thing, except now you're, and then you have to have something use self sacrifice their
their function, I mean it's it's annoying because you have to copy the code or maybe you want to abstract it so both of these work using the same way or, but it's a.
But yeah, it's really saying can you do you understand what's happening with this program with redirecting standard air. Now if you understand how this program we direct standard error I can talk about that you send it out I can talk about that.
Okay, 12 invalid redirection standing out for p list here, you just have to change p lists, you know, either you do you change what standard out is.
So, so the trick is p list doesn't start up a new process. So you probably want to write this to a separate file descriptor that you just open and use f print to a new file descriptor.
and that that's, you know, so if so, uh.
Okay, do too. Okay. Yeah, exactly. The dupe two is where you redirect standard. So what's the Duke to call
the dupe to call here the idea is when you do this open this create this create gives you a file descriptor. This will be some high end number file descriptor by calling do to, you're basically copying it to file descriptor one so now that's redirected
to standard out.
And then you close the existing phone scripts those.
So for p list, i mean the redirection, you have that syntax is fine but you have to change p list to do that.
solutions or tutorials are not going to be posted.
I do have to run sure I'd release early So, thanks.
Oh, You were just like commanded not to modify 3000 show.
Well, if you didn't modify 3000 shell to actually go to standard air.
I don't understand.
You know what it is, um, if you ask me if you ask me over the next couple of days I can post some, I can post some code fragments for part of these things to see you know the answers.
If you ask specific questions about the tutorial I can know, or maybe actually honestly, if you all want to share your solutions for the tutorials that's perfectly fine.
As I said you can collaborate live tutorials if any of you want to post two teams to say, here's my solution to this question from the tutorial.
Go ahead.
That's perfectly fine. Let me get this.
What redirecting quit potentially would involve due to the main thing is not necessarily the trick with PP list exercise is, this is in the show process.
This is a starting up a new process.
So, when you do this, what do you call it so probably when you do p list.
Where's yeah so we do p list. This is in the main 3000 shell processes not starting a child.
So since it doesn't start a child you don't want to mess up things.
So really what you want to do here is just all these print apps, you want to do. Just change these two f print apps, and then open the file that specified, and then close it done.
You could do right. Yeah, right.
So the idea is that the state so redirecting standard error.
So notice when I do LS, I do this.
If I do LS here.
Where is the output of LS gone, it's gone to temp food I redirected standard out for food but where is standard out of Basheer, it's still the terminal, I didn't change anything.
So, I didn't change anything it's still there. So, um.
So, yeah, I gotta go.
So anyway, thank you all. Um, yeah you're all allowed to give someone the answer on teens before the tutorials do it. Yeah, exactly. Well, I don't want you to post answers the tutorials before their do because, well, That would be, you know, you're potentially