Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iker-gonzalez/minishell
A Bash-inspired shell with a prompt and a working history developed in C
https://github.com/iker-gonzalez/minishell
42cursus builtins c child-process environment-variables pipes quotes readline redirection signals
Last synced: 1 day ago
JSON representation
A Bash-inspired shell with a prompt and a working history developed in C
- Host: GitHub
- URL: https://github.com/iker-gonzalez/minishell
- Owner: iker-gonzalez
- Created: 2022-01-31T15:02:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-25T16:32:45.000Z (over 2 years ago)
- Last Synced: 2024-02-26T17:07:46.787Z (9 months ago)
- Topics: 42cursus, builtins, c, child-process, environment-variables, pipes, quotes, readline, redirection, signals
- Language: C
- Homepage:
- Size: 2.73 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minishell
42 project, a Bash-inspired shell with a prompt and a working history. A program capable of parsing a prompt and launching executables with arguments, along with a few built-in functions.
### How to use it
Using ``make`` will create the ``minishell`` executable.
Simply run it with :
```
./minishell
```### Available options
Minishell runs executables from an absolute, relative or environment PATH (``/bin/ls`` or ``ls``), including arguments or options. ``'`` and ``"`` work the same as bash, except for multiline commands.
You can use redirections ``>`` ``>>`` ``<`` and pipes ``|``.
Environment variables are handled, like ``$HOME``, including the return code ``$?``.
Finally, you can use ``Ctrl-C`` to interrupt and ``Ctrl-\`` to quit a program, as well as ``Ctrl-D`` to throw an EOF, same as in bash.
A few of the functions are "built-in", meaning we don't call the executable, we re-coded them directly. It's the case for ``echo``, ``pwd``, ``cd``, ``env``, ``export``, ``unset`` and ``exit``.
### Credit
This two-person project was done with [isolinis](https://github.com/isolinis).
I was responsible for the parsing, argument checking, environment variables, built-in functions and signal handling.
Solinis took care of pipes, redirections and execution.