Im making a unix shell. I ask the user for input and then I have to parse that input and exectute the commands using fork and execvp, etc...
How would I parse an input such as:
ls -l | grep lib | less
so that I can correctly implement the commands in a pipe, etc...
I want to recognize commands like ";" to exectute commands right in a row and ">" and "<" to support file redirection.
Can someone please help me?
Right now, I have a strtok function collecting all of the tokens between spaces. What do I do next?
Thanks!
2006-09-27
16:14:06
·
4 answers
·
asked by
tom_a_hawk12
4
in
Computers & Internet
➔ Programming & Design