Hello, world,
I wrote a few lines programm doing the following,
the main program create two pipes, then fork-exec
another which is just "sh", then the parent read from stdin and write to
the pipe(the child has dup2 the other end of pipe to 0,
and 1, 2 to an end of the another pipe), and read from the
other pipe and write to stdout.
(Actualy the parent will write the output of "sh" to a socket)
Sounds like a simple program, and it works, for instance
I can set the DISPLAY, and type xterm the forked "sh" will run the xterm,
or I can do other interactive things.
The problem is it seems "sh" does not write the PROMPT to stdout or stderr,
since I duped both 1,2, but I do not get the prompt.
Any ideas where the PROMPT goes?
Dongxiao