Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhaliti/minishell
A tiny shell, just like a mini version of Bash
https://github.com/dhaliti/minishell
bash c command command-line homebrew shell shell-script terminal unix
Last synced: 16 days ago
JSON representation
A tiny shell, just like a mini version of Bash
- Host: GitHub
- URL: https://github.com/dhaliti/minishell
- Owner: dhaliti
- License: mit
- Created: 2022-05-23T07:40:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-31T18:05:51.000Z (about 2 years ago)
- Last Synced: 2024-11-11T10:53:16.469Z (2 months ago)
- Topics: bash, c, command, command-line, homebrew, shell, shell-script, terminal, unix
- Language: C
- Homepage:
- Size: 1.51 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MiniShell
MiniShell is a small and lightweight implementation of the popular Unix shell written in C. It features a number of built-in commands, including cd, env, and echo, as well as the ability to parse user input, execute external binaries, and handle pipes.
## Prerequisite
Readline is necessary to the project. Here is how to install it on your machine on macOS (assuming [Homebrew](https://brew.sh/) is already installed):
```
brew install readline
brew link --force readline
echo 'export C_INCLUDE_PATH="/usr/local/opt/readline/include:$C_INCLUDE_PATH"' >> ~/.zshrc
echo 'export LIBRARY_PATH="/usr/local/opt/readline/lib:$LIBRARY_PATH"' >> ~/.zshrc
source ~/.zshrc
```
Note: Replace ```~/.zshrc``` with ```~/.bashrc``` if you use bash instead of zsh## Getting started
To run MiniShell, simply clone this repository and run the ```make``` command to build the program. Then simply run the executable:
```
make && ./minishell
```## Features
-
Built-in commands: MiniShell includes a number of built-in commands, including cd for changing the current working directory as well as env, export, and unset for displaying and modifying the environment variables. -
External command execution: just like a reak shell, MiniShell can execute binaries by searching the directories specified in the PATH environment variable. -
Input parsing: MiniShell can parse and interpret user input, including support for command arguments pipeline operators, redirections, and heredoc. -
Pipe handling: Mini Bash can connect the standard output of one command to the standard input of another using the | pipe operator.
## Contributors
Project realised with [Jérémy Perras](https://github.com/jeremy-perras)
## Ressources
[Bash manual](https://www.gnu.org/software/bash/manual/bash.html)
[POSIX shell specification](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html)
[GNU C Library mannual](https://www.gnu.org/software/libc/manual/html_node/index.html)
[Linux man pages](https://linux.die.net/man/)
### Licence
MiniShell is released under the MIT License.
[![forthebadge](https://forthebadge.com/images/badges/made-with-c.svg)](https://forthebadge.com)