How to Write a Shell using C++ or C???
Can anyone help me out here????
I am trying to write a Shell using C++, I wanna use the fork() and exec() functions in unix, I wanna try come up with an output such as: my shell $ <...type in commands...> and the commands should basically execute as on a normal bash shell. would be great if anyone can help me find any information which makes pipes and redirection clear if possible with source code. Thanks... |
For a thorough introduction to Unix programming, including pipes and I/O redirection, see:
Code:
http://www.faqs.org/docs/artu/ Code:
http://www.gnu.org/software/bash/ |
Thanx...
I looked it up very helpful |
I had an assignment last week about writing a basic shell terminal program which parses the command line, forks and passing the proper arguments with path to execv, letting execv handle the job.
If you are interested in something like this, you should do this using a main loop, getting the command line with readline, parsing it (I had a simple parse code, doesn't support complex commands), adjusting the input output redirection flags and pipe flags, then forking and calling execv. |
All times are GMT -5. The time now is 10:59 AM. |