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.
- Reads and processes user commands.
- Tokenizes the input into command and arguments.
- Uses
fork
andexecvp
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
& thecurrent directory
.
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.
├── include
│ └── shell.h
├── LICENSE
├── Makefile
├── README.md
└── src
├── config.c
├── executor.c
├── intern.c
├── main.c
└── parser.c
To compile and run the ShellBrunbaix, follow these steps:
-
Clone the Repository (if hosted on GitHub):
git clone https://github.com/your-username/shellbrunbaix.git cd shellbrunbaix
-
Compile the Source Code:
The project uses a
Makefile
to simplify the compilation process. Simply run:make
This will generate an executable named
shellbrunbaix
. -
Run the Shell:
To start the shell, run:
./shellbrunbaix
You will see a custom prompt (
/>
) where you can enter commands. -
Use the Shell:
- Enter commands like
ls
,pwd
, orecho Hello
. - Type
exit
to close the shell.
- Enter commands like