Koenig Shell is a simple shell implementation written in C. It provides basic shell functionalities while aiming to be easy to understand and modify. This shell is based on the Xv6 operating system framework.
- Basic Shell Operations: Supports executing commands, handling built-in commands, and managing processes.
- Command Line Editing: Provides basic command line editing functionalities using the readline library.
- Signal Handling: Implements signal handlers to handle SIGINT and SIGTSTP signals effectively.
These instructions will help you get a copy of the project up and running on your local machine for development and testing purposes.
You need to have the following installed on your system:
- C compiler (e.g., GCC)
- Readline library
-
Clone the repository:
git clone https://github.com/trevorkoenig/koenig-shell.git
-
Navigate to the cloned directory:
cd koenig-shell -
Compile the source code:
make
Alternatively, you can compile manually using:
gcc -g main.c sh.c get_path.c -o mysh
-
Run the shell:
./mysh
Once the shell is running, you can use it just like any other shell. It supports executing commands, handling built-in commands (e.g., cd, exit), and managing processes.
- exit: Exit the shell.
- which: Display the full path of the command.
- where: Display all instances of the command in the PATH.
- cd: Change the current directory.
- pwd: Print the current working directory.
- list: List all files and directories in a given directory.
- pid: Print the process ID of the shell.
- kill: Terminate a process by its process ID.
- prompt: Set or change the shell prompt.
- printenv: Print all environment variables or a specific environment variable.
- setenv: Set or modify environment variables.
- test: A placeholder for testing purposes.
The project includes a Makefile for easy compilation. You can use the following commands with the Makefile:
- make: Compiles the source code and creates the executable
mysh. - make clean: Removes object files and the executable.
- Trevor Koenig - GitHub Profile
This project is licensed under the MIT License - see the LICENSE file for details.
- This shell is based on the Xv6 operating system framework.
- Completed as a project for CISC361.