Engine/Power - non turbo (All non turbo Imprezas) Who needs a turbo when you have 2500cc? Cams, intakes, exhausts, etc. The 2.2L and 1.8L Subies are cool too.

any one know how to write shell code

Thread Tools
 
Search this Thread
 
Old Oct 24, 2005 | 02:46 PM
  #1  
suzan's Avatar
Thread Starter
Registered User
 
Joined: Oct 2005
Posts: 1
From: colombia
Car Info: read
any one know how to write shell code

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

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, …)
}
}
Edit/Delete Message

forum
Old Feb 8, 2006 | 08:56 PM
  #2  
pbdavey's Avatar
Registered User
 
Joined: Jul 2005
Posts: 10
lol I just found this thread...I clicked on it and just stared in amazement and thought "WTF?"
Old Mar 5, 2006 | 03:09 PM
  #3  
Impooter's Avatar
Registered User
 
Joined: Apr 2004
Posts: 174
this isnt the place to be asking for help with your homework :P
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
22ndavewagon
Suspension, Handling, and Brakes
13
May 16, 2006 06:06 PM
subaruferrucci
Engine Management
1
Apr 11, 2006 12:51 PM
aeanbrennan
Hawaii
2
Jan 27, 2006 10:20 AM
KurleeDaddeeWRX
Bay Area
1
Aug 25, 2003 05:22 PM




All times are GMT -7. The time now is 06:31 AM.