/bhshell

A Simple Shell which supports piping and redirection

Primary LanguageC

A Simple Shell

A shell written in C to help understand processes.

Features

Has 3 built in commands => [cd, help, exit].
Also supports redirection and piping.
So, a command like ping -c 5 google.com | grep rtt > response.txt works. But, multiple pipes are not supported.

Build

git clone https://github.com/bsach64/bhshell.git
cd bhshell
make bhshell
If you want to run tests
make test
./bhshell

TODO

  • Understand how creating processes actually works
  • Simulate the "|" operator
  • Rewrite for better organisation and error handling
    • Rewrite to use xmalloc
    • Add tests
  • prompt shows current working directory
  • Remove exit(EXIT_FAILURE)
  • Rewrite the Parser {Basically}
    • Simulate the ">" operator of $BASH
    • Allow for the "|" operator of $BASH
  • Maybe
    • Support multiple ">" {allowing for ls > file1.txt > file2.txt}
    • Escape characters etc {echo "wow" should print wow instead of "wow"}
    • Implement some level of globbing (Meaning *.txt means all .txt files in the current dir)