any one know how to write shell code
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
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
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



