The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell Implementation not working correctly AirBronto High Level Programming 14 02-15-2008 07:41 PM
Piping and redirection implementation mobile01 High Level Programming 7 12-20-2006 08:52 PM
need help with my implementation of cat in bash sanchopansa Shell Programming and Scripting 4 10-18-2006 03:28 AM
isascii & isextendedascii implementation anjan_kumar_k High Level Programming 2 07-21-2006 07:48 AM
Solaris Timer Implementation ulisses0205 High Level Programming 2 04-06-2004 10:03 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-02-2001
Registered User
 

Join Date: Oct 2001
Posts: 7
Question Shell Implementation

I want to implement my own simple multi tasking shell in Unix which will take care of redirection (<, >, >>) and piping.
I am just unable to get a concrete idea of how exactly I have to start. I have several books...some are..

1. Maurice Bach- Design Of Unix Operating System
2. Richard Stevens- Advanced Programming in Unix

However I find the language too high and complicated in these books.

Can someone please suggest how exactly I should go abt it...(step by step)

What are the things that I need to Learn to Implement this?
(anything and everything)


Forum Sponsor
  #2  
Old 10-02-2001
rwb1959's Avatar
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
Based on the GREAT books you mention, I gather you
are thinking about using C... yes?

IMHO an excellent choice. However, if you are new to C,
those books may be more confusing than helpful.

I would suggest a "friendlier" book. There are so many
books out there I would be hard pressed to recommend
any particular one. You may want to search through the FAQs
on this forum for some book titles.

If C is not your cup of tea... you can also use perl.

Anyway, sounds like a great learning project and with those
books, you are on the right track.
  #3  
Old 10-02-2001
Registered User
 

Join Date: Oct 2001
Posts: 7
Thanks rwb1959.......but thats not what exactly that I wanted....
A more detailed guidance would be really helpful for me...
  #4  
Old 10-02-2001
rwb1959's Avatar
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438

In general, you want to write a program that take "line" input
(i.e. gets() ) and parses it looking for "special" characters
(don't forget to process escape "\" characters as well). From
that point, you can use fork() exec() to actually run the commands
and use popen() to facilitate redirection to/from parent and
children processes.

I hope this gives you an idea of where to start. Note that in
at least one C programming book (I don't remember which),
they actually give you a rudimentary shell as a programming
example.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0