Skip to content

Operating Systems Portfolio Project: Small Shell

License

Notifications You must be signed in to change notification settings

allenjbb/smallsh

Repository files navigation

smallsh

smallsh is a shell program that implements a subset of features of well-known shells, such as Bash.

Installation

Unix Systems

After cloning the repo or downloading and extracting the source files, navigate to the project folder in the terminal and use the Makefile to compile the project by using the following command:

make

To remove the object files and the executable, navigate to the project folder in the terminal and use the following command:

make clean

Windows Systems

For Windows users, it is recommended to use WSL (Windows Subsystem for Linux) to provide a Unix-like environment. Once WSL is set up with your preferred Linux distribution, follow the Unix installation instructions above.

Execution

Once the program has been compiled, it can be run in the terminal via the following command:

./smallsh

To exit the program, type exit and press Enter/Return.

Features

Provides a prompt for running commands:

smallsh-1

Ignores blank lines and comments (lines beginning with the # character):

smallsh-2

Provides expansion for the variable $$, replacing it with the PID:

smallsh-3

Executes status, cd, and exit via code built into the shell and other commands via new processes forked by the exec family of functions:

smallsh-4

Supports input and output redirection using < and > respectively:

smallsh-5

Supports running commands as background processes with & or foreground processes without:

smallsh-6

Uses custom handlers for 2 signals, SIGINT and SIGTSTP, to terminate foreground child processes or toggle foreground-only mode by pressing Ctrl-C or Ctrl-Z respectively:

smallsh-7

Feedback

Any and all feedback is greatly appreciated. If you have a suggestion to improve this project, feel free to leave your thoughts in the Discussions Tab!

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

About

Operating Systems Portfolio Project: Small Shell

Topics

Resources

License

Stars

Watchers

Forks