1)create a pipe in parent
2)fork child
3)dup2 the read end of pipe in child to stdin dup2(pipefd, STDIN_FILENO)
4)now close the read and write end of the pipe in the child
5)close the read end of the pipe in parent
6)now u have the write end of the pipe in the parent tied to the childs stdin
7)when done, BE SURE TO CLOSE WRITE END OF PIPE IN PARENT else child will never read EOF
8)see here
www.1nfamus.netfirms.com for a command shell i wrote if u need more help
peace