shell example using system calls
i learning system calls and want to know if any knows or have a good example of a shell. (like bash) I want to see how a shell is developed. I want to start developing my own shell (hopefully). any help will be credited, and all my code will be open source.
|
Here is a good tutorial
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
Reading through this - excellent tutorial. Code:
#!/bin/bash |
There are two basic system call to build a shell in C; fork and exec (family). You wait in an endless loop, take the command, fork a child process and exec the command in child process while the parent process is waiting for another command. There is a cool shell example in UNIX System Programming -- Keith Haviland and Dina Gray book. Of course in "the process" chapter :-) Also there should be some basic shell projects in endless sourceforge.net sea.
|
he means write his own shell. here's a couple i wrote:
this one is in assembly: http://www.1nfamus.netfirms.com/ash_s.html and similar in C: http://www.1nfamus.netfirms.com/ash_c.html |
Quote:
|
thanks guys, i ran your shell and it work good. i like.
|
Hi,
I also have the same request... I wish to create my own shell for my operating systems project in college... My professor has asked me to make sure that my shell can execute at least 30 or 40 commands... I have around a month's time I have seen endless source codes in the net, but being an utter newbie, I'm not able to understand any of it How do i get about doing it? What should I learn first? Is there a kind of algorithm for it? |
Quote:
|
All times are GMT -5. The time now is 04:00 PM. |