Help! Need to design and implement a basic shell

Hi guys. Please any input from you will be very helpful. I am trying to design a shell with the following requirements.

The most rudimentary shell is structured as the following loop:
1. Print out a prompt(e.g.,"Shell$");
2. Read a line from the user;
3. Parse the line into the program name and an array of parameters;
4. Use the fork() system call to spawn a new child process;
5. The child process then uses the exec()system call(or one of its variants)to launch the specified program;
6. The parent process (the shell) uses the wait() system call (or one of its variants) to wait for the
child to terminate;
7.Once the child(the launched program) finishes, the shell repeats the loop by jumping to 1.

It needs to support simple pipes
It needs to support cd command
Last edited on
There are lots of examples on the Google machine to help you. Try "fork and exec" for the process creation, and try "unix pipes" or something similar to help you find out about pipes.
Same thing for the cd command.

Good luck.
thanks, will search, if any prob I come back
Topic archived. No new replies allowed.