[cs631apue] Question about the chapter 15

bzhang41 bzhang41 at stevens.edu
Wed Oct 26 18:39:10 EDT 2016


Dear Prof.

I have questions about the 'popen', there are so many examples in the 
textbook in chapter 15 which make me very confused.

When the parent process call the 'popen', is there only one shell or two 
shells ?

Take the popen.c (on class website)for example,
line #38 seems to get the argv[1] from the parent 'shell'
but line #44 seems to print the content in line to the pipe which is the 
chid's 'shell'.

So my understanding is that in the child's 'shell', we can use command 
in 'pager' to print out the content stored in line, but why the content 
can appear in the parent's 'shell' finally?

And when the parent's 'shell' fetch the print out content from the 
child's shell ?

Thanks
Bo




More information about the cs631apue mailing list