https://github.com/bsach64/bhshell
A Simple Shell which supports piping and redirection
https://github.com/bsach64/bhshell
c linux shell
Last synced: about 2 months ago
JSON representation
A Simple Shell which supports piping and redirection
- Host: GitHub
- URL: https://github.com/bsach64/bhshell
- Owner: bsach64
- Created: 2024-02-10T10:00:40.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-25T12:13:23.000Z (about 2 years ago)
- Last Synced: 2025-03-14T03:09:59.318Z (over 1 year ago)
- Topics: c, linux, shell
- Language: C
- Homepage:
- Size: 40 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
- [x] Understand how creating processes actually works
- [x] Simulate the "|" operator
- [x] Rewrite for better organisation and error handling
- [x] Rewrite to use xmalloc
- [x] Add tests
- [x] prompt shows current working directory
- [x] Remove `exit(EXIT_FAILURE)`
- [x] Rewrite the Parser {Basically}
- [x] Simulate the ">" operator of $BASH
- [x] 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)