LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2007, 09:19 AM   #1
linux_geek
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Rep: Reputation: 0
designing a SHELL


hi guys.....i have an assignment to develope a SHELL. i just don't have any knowledge about it. Please help me design it or please give some links where i can find it..........
 
Old 02-28-2007, 09:38 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
What specifically do you want to know?

A good place to start would be with the source to an existing shell.
 
Old 02-28-2007, 09:51 AM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You will want to concentrate on two primary functions:
1. Launching child processes.
2. Interpretting command lines.

Judging by your question, anything further will be a significant challenge.

You haven't said even what language you are planning to use (curious omission in a Programming forum), but I will hazard a guess that you will do it in C or C++. In either case, you should look at the man pages for system calls such as fork(), exec() (in its many flavors), and wait(). This mostly covers the launching of child processes, but you may also want to look at the likes of dup(), dup2(), and freopen() for management of standard IO. The C language covers a lot of commandline parsing with the standard string processing functions declared in string.h. You will want to use these.
For more exotic commandline parsing and advanced shell functionality such as script execution, you may want to look at the likes of lex & yacc (flex and bison in linux-speak).
Come back here with more specific questions once you have done this and have have idientified more specifc obstacles.
--- rod.
 
Old 02-28-2007, 01:03 PM   #4
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 735

Rep: Reputation: 76
Hi.
Quote:
Originally Posted by nidupgels
i have an assignment to develope a SHELL. i just don't have any knowledge about it. Please help me design it or please give some links where i can find it
The article at http://en.wikipedia.org/wiki/Shell_%28computing%29 has a good overview and has a number of pointers.

If I were doing this I would probably do a prototype in perl or python before doing much in a compiled language.

It looks like a homework assignment, but even if not, you'll learn a lot by doing it.

Best wishes ... cheers, makyo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Designing a GUI squinn Programming 3 02-14-2005 03:05 PM
Designing themes zero000999 Linux - Newbie 1 12-24-2004 11:52 AM
Kernel Designing vibhory2j Linux - General 2 04-23-2004 12:46 PM
Designing a network Pimple Linux - General 2 05-27-2003 12:02 AM
Website designing KevStA Linux - Software 10 05-29-2002 01:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration