Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

writing a shell

Name: Anonymous 2009-09-19 22:39

I was hoping for some advice from someone more knowledgeable than myself. I'm messing around and trying to learn how to write a shell. So far, I've successfully used flex to parse input and properly put it into a char**. Then I fork() and run execvp() in the child process and wait() in the parent process. Works fine, except that when I run one command it works, but when I run another, it doesn't. What gives?

>echo itworks
itworks
>ls
>echo itworks
>wtf
>^C


Any advice would be appreciated. I don't understand why this would happen. ps doesn't list and child processes, either.

Name: Anonymous 2009-09-20 4:31

>>7 thank you. I think it is the best type of indentation and I always use it.

>>10
yes, I considated all the error handling functions into one. Though, I don't understand by what you mean by saying that my loop isn't long enough. If you're referring to the fact that I only handle one pipe per line, I do plan on expanding it to general cases once I see that I have the logic down.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List