UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2005, 03:07 PM
suzan suzan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 2 suzan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 42 sec
Reputation Power: 0
help with shells

well iam a bigener
any one can help me with this shell

The shell or command-line interpreter is the fundamental user interface to an operating
system. write a simple shell that has the following properties. The
shell will loop continuously to accept user commands; it will terminate when "exit" is
entered. The command line prompt must contain the pathname of the current directory.
Internal commands
The shell must support the following internal commands:
First: /ayed/ > cd [[<pathname>] <directory>]
Change the current default directory to <directory>. If the <directory> is not present,
report the current directory. If the directory does not exist an appropriate error message
should be reported.
e.g.
/ayed/> cd project or /ayed/> cd /ayed/project
Second: History
Display a history of the last 10 commands executed on the shell.
Third : exit
Quit the shell.
Other than that the program shall read, parse and interpret the command and call the
appropriate command from the existing shell.
For simplicity sake, assume that only the following commands can be input to the shell:
1. ls
2. ls -l
3. date
4. pico <filename>
5. history
6. man <subject>
7. diff <filename1> <filename2>
8. set
9. who
10. rlogin <host-name>
The shell should fork a new process for each executed command.
Program Skeleton:

while(! EOF) {
read input
handle regular expressions; // parse the next command by the user.
if(built-in command) {
execute command; continue; }
if(child = fork()) { // create a child to run command
child = wait(&res);
}
else { // command is run here
exec(command, argc, argv0, argv1, …)
}
}

Reply With Quote
  #2  
Old October 24th, 2005, 03:20 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,589 Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 1 m 37 sec
Reputation Power: 1001
Please do your own homework. Thread closed.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month
Looking for a perl job with kick-*** programmers in a well-known NASDAQ listed tech company with branches in the US and Europe? We're hiring. PM me for details. Requirements

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > help with shells


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT