This is my own shell program, Mav shell (msh), similar to bourne shell (bash), c-shell (csh), or korn shell (ksh). It accepts commands, forks a child process and executes those commands. The shell, like csh or bash, will run and accept commands until the user exits the shell.
- This program prints out a prompt of msh> when it is ready to accept input. It reads a line of input and, if the command given is a supported shell command, it executes the command and displays the output of the command.
- If the command is not supported, the shell prints the invalid command followed by “: Command not found.”
-
After each command completes, the program prints the msh> prompt and accepts another line of input.
-
Shell will exit with status zero if the command is “quit” or “exit”.
-
If the user types a blank line, the shell quietly prints another prompt and accepts a new line of input.
-
Mav shell supports up to 10 command line parameters in addition to the command.
-
The shell supports and executes commands located in /bin, /usr/bin, /usr/local/bin, and the current working directory.
-
Mav shell is implemented using fork(), wait(), and one of the exec family of functions.
-
The shell supports the
cdcommand to change directories and handlescd ...
-
The shell saves the last 50 commands and command line parameters.
-
The shell prints the history log, excluding blank line entries, when the user types
history.
msh> history
[1] ls
[2] mkdir foo
[3] cd foo
[4] cd ..
[5] history
-
The user re-runs any command in the history by typing
!#, where#is the number of the command to rerun. -
The shell supports redirection. The syntax
[process] > [file]redirects the process’s standard output to a file. -
The shell supports pipes between programs.
-
The program blocks the SIGINT and SIGTSTP signals.



