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

https://github.com/scar027/basic-shell

Basic unix shell implemented by following the tutorial by Stephen Brennan with some additional features and tweaks.
https://github.com/scar027/basic-shell

c os shell unix unix-shell

Last synced: 2 months ago
JSON representation

Basic unix shell implemented by following the tutorial by Stephen Brennan with some additional features and tweaks.

Awesome Lists containing this project

README

          

# basic-shell
Basic unix shell implemented by following the [tutorial by Stephen Brennan](https://brennan.io/2015/01/16/write-a-shell-in-c/) with some additional features and tweaks.

## Compile and run
Compile and run the source code from the project directory after cloning.
```
gcc -o shell.out shell.c -Wall
./shell.out
```

## Additional Functionality
Some features added over the existing implementation from the tutorial are as follows:
1. Background process execution using `&` and management using additional helper functions and `sigchld_handler()`.
2. Properly terminate background processes on calling `exit()` to avoid zombie processes and ensure clean resource reclamation.

## Tweaks
Some changes compared to the original implementation of the tutorial:
1. Some additional error handling checks in the `launch()` function consistent with the documentation from the `man 2 wait` page.
2. Green colour for prompts.