Skip to content

ghiyascode/shell-replica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

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.

Functionality

  1. 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.

main

  1. If the command is not supported, the shell prints the invalid command followed by “: Command not found.”

main

  1. After each command completes, the program prints the msh> prompt and accepts another line of input.

  2. Shell will exit with status zero if the command is “quit” or “exit”.

  3. If the user types a blank line, the shell quietly prints another prompt and accepts a new line of input.

main

  1. Mav shell supports up to 10 command line parameters in addition to the command.

  2. The shell supports and executes commands located in /bin, /usr/bin, /usr/local/bin, and the current working directory.

  3. Mav shell is implemented using fork(), wait(), and one of the exec family of functions.

  4. The shell supports the cd command to change directories and handles cd ...

main

  1. The shell saves the last 50 commands and command line parameters.

  2. 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
  1. The user re-runs any command in the history by typing !#, where # is the number of the command to rerun.

  2. The shell supports redirection. The syntax [process] > [file] redirects the process’s standard output to a file.

  3. The shell supports pipes between programs.

  4. The program blocks the SIGINT and SIGTSTP signals.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors