|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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, …) } } |
|
#2
|
||||
|
||||
|
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 |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > help with shells |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|