- Hammed Amusat Oriyomi
- Oludayo Jeremiah Adedayo
This project is a simple shell program written in C. It provides a command-line interface for users to interact with the operating system. The shell supports basic commands such as cd
, exit
, and can execute other system commands.
To compile the shell program, use the following command:
gcc simpleshell.c -o shell
To run the shell in interactive mode, simply execute the compiled binary:
./shell
To run a command directly from the command line, pass it as an argument to the shell binary:
./shell ls -l
- Supports basic commands:
cd
,exit
- Can execute other system commands
- Supports environment variables:
$$
,$?
,$PATH
The shell recognizes the following commands:
Change the current working directory.
Syntax:
cd <directory>
Example:
cd /home/user/documents
Exit the shell. Optionally, you can provide an exit status.
Syntax:
exit [<status>]
Example:
exit 0
The shell supports the following environment variables:
$$
: PID of the shell process.$?
: Exit status of the last command.$PATH
: Value of the PATH environment variable.
Set an environment variable.
Syntax:
setenv <VARIABLE> <VALUE>
Example:
setenv MY_VAR some_value
Unset an environment variable.
Syntax:
unsetenv <VARIABLE>
Example:
unsetenv MY_VAR
Echo the value of an environment variable.
Syntax:
echo $<VARIABLE>
Example:
echo $MY_VAR
To contribute to this project, fork the repository, make your changes, and submit a pull request. Please ensure that your code follows the project's coding style and conventions.
If you encounter any issues or have suggestions for improvement, please open an issue on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.