https://github.com/debrunbaix/shellbrunbaix
Shell written in C to validate my C skills.
https://github.com/debrunbaix/shellbrunbaix
c shell
Last synced: about 2 months ago
JSON representation
Shell written in C to validate my C skills.
- Host: GitHub
- URL: https://github.com/debrunbaix/shellbrunbaix
- Owner: debrunbaix
- License: mit
- Created: 2024-10-26T12:06:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-29T08:38:25.000Z (over 1 year ago)
- Last Synced: 2025-04-03T15:32:02.786Z (about 1 year ago)
- Topics: c, shell
- Language: C
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ShellBrunbaix
## Description 📜
ShellBrunbaix is a basic shell written in C that reads user input, tokenizes the input, and executes commands. It mimics some basic functionalities of standard Unix shells by allowing users to execute external commands like `ls`, `pwd`, `echo`, etc., and includes the ability to exit the shell with the `exit` command and to change directory with the `cd` command.
### Features ⚙️
- Reads and processes user commands.
- Tokenizes the input into command and arguments.
- Uses `fork` and `execvp` to execute external commands in child processes.
- Handles simple error cases and displays appropriate messages.
- Allows exiting the shell with the `exit` command.
- Allows to change directory with `cd`.
- Prompt change based on the `username` & the `current directory`.
### Future Improvements 🔄
Here are some features that could be added to enhance the functionality of ShellBrunbaix:
- **Input/Output Redirection**: Allow users to redirect the output of commands using `>` or `<`.
- **Pipe Handling**: Implement support for piping (`|`) between commands.
- **Command History**: Keep track of previously entered commands and allow the user to access them.
- **Autocomplete**: Add support for tab-completion of commands and file paths.
### File Structure 📂
```bash
├── include
│ └── shell.h
├── LICENSE
├── Makefile
├── README.md
└── src
├── config.c
├── executor.c
├── intern.c
├── main.c
└── parser.c
```
## Compilation and Execution 🛠️
To compile and run the ShellBrunbaix, follow these steps:
1. **Clone the Repository** (if hosted on GitHub):
```bash
git clone https://github.com/your-username/shellbrunbaix.git
cd shellbrunbaix
```
2. **Compile the Source Code**:
The project uses a `Makefile` to simplify the compilation process. Simply run:
```bash
make
```
This will generate an executable named `shellbrunbaix`.
3. **Run the Shell**:
To start the shell, run:
```bash
./shellbrunbaix
```
You will see a custom prompt (`/>`) where you can enter commands.
4. **Use the Shell**:
- Enter commands like `ls`, `pwd`, or `echo Hello`.
- Type `exit` to close the shell.