This is my first post here, and i need urgent help with a programming assignment.
I am working on an assignment which requires me to build a simple shell. My shell must handle simple commands with arguements and ones with piping and I/O redirection.
The problem is i have no idea how to implement this redirection. The shell does alot of other things. I'm only stuck at this!
To further explain, my program reads the user's input such as: "ls -1 > text.txt" and does what a normal shell does. The problem is redirecting one's output as an input and the reverse. I have to execute two of the commands by forking two children and execve-ing. Then i need to do the redirection thing.
I have no idea were to start. I suppose it has to do with piping? I'm not sure.
Thanks alot for your help!