A basic implementation of a shell in C, allowing users to execute commands.
This project is a simple shell implementation in C, where users can enter commands similar to a Unix shell. The shell supports executing internal commands like "cd" as well as external commands available on the system.
- Execution of external commands
- Changing the current working directory using the "cd" command
- Interactive mode and non-interactive mode
- Basic error handling and clean code structure
To compile the shell, use the following command:
gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o myshellRun the shell in interactive mode by executing the compiled binary:
./myshellThe shell will prompt with ($), and you can enter commands to execute.
You can also use the shell in non-interactive mode by providing commands via input redirection:
echo "/bin/ls" | ./myshell($) /bin/ls
file1.txt file2.txt
($) cd ..
($) exitContributions are welcome! If you find a bug or have a suggestion, please create an issue or a pull request.