Is a simple Unix/Linux shell implementation that allows users to execute commands and interact with the system. This shell is developed in C and provides a basic command-line interface for users to input commands and receive responses from the program.
-
Interactive Command Execution: Users can enter commands in the shell and receive responses from the program.
-
Command Execution: The shell can execute various system commands entered by the user.
-
Environment Variable Printing: The shell can display the system's environment variables using the "env" command.
To compile and run the Custom Shell on your system, follow these steps:
- Clone the repository:
git clone https://github.com/FoulTrip/tests-shell.git- Compile the source code using makefile:
make- Go to /bin and run the shell:
./hshOnce the shell is running, you can interact with it using the command-line interface. Here are some commands you can try:
-
Entering commands: Type in various commands and press Enter to execute them.
-
Exiting the shell: Use the "exit" command to exit the shell.
-
Displaying environment variables: Use the "env" command to print the system environment variables
The Custom Shell is divided into several modules:
-
main.c: This file contains the main function responsible for creating an interactive loop in which users can enter commands and receive responses from the program.
-
main.h: Header file containing function declarations and necessary includes.
-
executeCommand.c: This file defines the executeCommand function, responsible for executing user commands using the execve system call.
-
path.c: This file defines the findExecutable function, which helps locate the full path of executable commands.
-
printEnv.c: This file defines the printEnvironment function, which prints the system environment variables.
This project was made possible thanks to the collaborative efforts of David Vasquez: Developed the initial shell functionality and main loop and Ricardo Valdes: Implemented the command execution and environment printing functions.