An open API service indexing awesome lists of open source software.

https://github.com/f0rkr/minishell

Making a shell using dummy C.
https://github.com/f0rkr/minishell

c descriptors minishell shell zsh

Last synced: about 1 month ago
JSON representation

Making a shell using dummy C.

Awesome Lists containing this project

README

          

# minishell

Coding a *shell* from scratch using low level C was one of the most powerfull project I made, constructing all those building block of a shell from parsing commands
through forking process creation and synchronisation, managing pipes and executing it. ✨

it's called wesh shell. aka ``Wesh a sat``

## Options created

Minishell runs executables from an absolute, relative or environment PATH (``/bin/ls`` or ``ls``), including arguments or options. ``'`` and ``"`` work the same as bash.

You can separate commands with ``;``, as well as 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``.

You can use arrow keys to edit commands and iterate through last executed ones (``history``). *managed with [termcap](https://man7.org/linux/man-pages/man5/termcap.5.html)*

# How to run it

```shell
f0rkr@shell$ make
f0rkr@shell$ ./minishell
wsh :: /Users/f0rkr/Documents/minishell » wesh a sat
```

# Teammate
- [teslazap](https://github.com/OussamaElouarti)

# Resources

https://www.gnu.org/software/bash/manual/bash.html