What is this
cshell is an alternative to the standard sh shell written entirely in c and all in a single file within ~500 LOC.
It supports pipes, redirections, history, and more. Comes with a customized prompt.
Inspiration
Most Operating Systems classes have a project for creating a shell. I never got to around to do that. This is my shot at creating my own shell.
Prerequisites
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of
gcc, make
Getting cshell
To install cshell, follow these steps:
git clone https://github.com/2kabhishek/cshell
cd cshell
make cshellUsing cshell
You can link the cshell executable to your $PATH or just run it from the command line.
./cshellThis will start the shell and display the a help message along with the prompt. You can use it like any other shell.
How it was built
cshell was built using c
Challenges faced
- Struggled somewhat in the begining to handle signals, but eventually got it working.
What I learned
- Learned a lot about
cand it's different syscalls. - Understood the internal workings pipes and redirections.
What's next
Clean up the code and make it more readable, add more features, and make it more robust.
Hit the β button if you found this useful.
