473,394 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Creating a shell.... howto?

2
Hi all, I'm currently doing my 3rd yr comp sci engineering. My group has been assigned a project, we have to create a shell coded in C and that has to run under a linux environment. I have no clue where to start of, please could anyone direct me to someful useful info. I'm well vesred in C, good with linux. Any help will be appreciated. Thanx in advance.
Sep 26 '07 #1
4 6743
ashitpro
542 Expert 512MB
Best way to write your own shell is to look at current shell and try to implement something like that.
When you type some command on shell it will create new process for executing that command, use the same approach

Your code should do the following things first.
- listen in while loop for user commands.
- once user enters the command, create the new process by system call 'fork'.
inside child process execute the command entered by user using 'exec' system
call
- Try to use 'system' system call, so that you can avoid extra work.

I don't think that this code will take more than 300 lines.
Sep 26 '07 #2
srinag
2
Best way to write your own shell is to look at current shell and try to implement something like that.
When you type some command on shell it will create new process for executing that command, use the same approach

Your code should do the following things first.
- listen in while loop for user commands.
- once user enters the command, create the new process by system call 'fork'.
inside child process execute the command entered by user using 'exec' system
call
- Try to use 'system' system call, so that you can avoid extra work.

I don't think that this code will take more than 300 lines.

Thank you for your pointers, much appreciated. Please could you also point me to some online documentation which will help me in making the shell. Thanx.
Sep 26 '07 #3
sicarie
4,677 Expert Mod 4TB
Thank you for your pointers, much appreciated. Please could you also point me to some online documentation which will help me in making the shell. Thanx.
http://www.google.com/search?hl=en&q...=Google+Search

Documentation is everywhere, you just have to look for it.
Sep 26 '07 #4
ashitpro
542 Expert 512MB
Try this link. This is sufficient for you.
Use your knowledge
Don't expect spoon feeding.

http://people.clarkson.edu/~jets/cs444/sp06/labs/lab1/Writing_Your_Own_Shell.html
Sep 27 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: mr_burns | last post by:
hi, i have recently used a system (oscommerce store) where you can backup your database. what happens is that when you click 'backup database', it creates an SQL string, stores it in a text file...
2
by: PK | last post by:
Hello, I am looking for help on the following. I'm trying to create a custom browser toolbar button that will do a few things. One that I'm trying to do at the moment is just simply return the...
4
by: Josef Sachs | last post by:
Is Andrew Kuchling's regex-to-re HOWTO available anywhere? I've found the following (dead) links on various Web pages: http://py-howto.sourceforge.net/regex-to-re/regex-to-re.html...
8
by: Millissa | last post by:
If someone can help me with examples of or info on how to create an advanced tables for the layout on my site, I would be very grateful! Thanks, M
0
by: musicloverlch | last post by:
I used to be able to create PDFs, automatically save them to a file, and mail them out to people. This was on Access 97 with Windows NT. We've changed to Windows XP and Access 2003. Doesn't work...
4
by: Excluded_Middle | last post by:
Hi, My teacher gave me an assignment to create a shell using ANSI C and system calls. The shell is going to be very simple that can handle IO redirection and pipes. so far I create a program...
9
by: John F | last post by:
This is a re-post of an earlier problem which I have not been able to solve yet. I'm running .NET 2003 on XP. I am trying to launch a Windows program from a VB Web app. The code I am using is; ...
9
by: Rotzooi | last post by:
Hi, I have a VB.NET Service application that's running fine under the Local System account. But for configuration purposes I don't want to be dependent on modifying the registry manually or...
15
by: Mike Driscoll | last post by:
Hi, I've had this niggling issue from time to time. I want to create a shortcut on the user's desktop to a website that specifically loads Firefox even if Firefox is not the default browser. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.