This is a simple shell program written in C that provides basic command-line functionality. It supports a subset of common shell commands and features.
- Basic command execution
- Path resolution for command execution
- Environment variable handling
- Built-in commands: cd, env, setenv, unsetenv, alias
- Error handling for common system calls
- GCC (GNU Compiler Collection)
- Linux/Unix environment
gcc *.c -o simple_shell./simple_shellOnce the shell is running, you can enter commands as you would in a regular shell. Here are some examples:
$ ls
$ cd /path/to/directory
$ setenv MY_VARIABLE my_value
$ alias myalias='echo Hello, World!'
$ myaliasThe following functions and system calls are allowed in this shell:
access,chdir,close,closedir,execve,exit,_exitfflush,fork,free,getcwd,getline,getpid,isattykill,malloc,open,opendir,perror,read,readdirsignal,stat,lstat,fstat,strtok,wait,waitpid,wait3,wait4write
Contributions are welcome! If you have any improvements or bug fixes, feel free to submit a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/my-feature) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.