Note: This project is under construction. It lacks a lot of basic functionalities that you might expect from a shell like bash or zsh.
Note: This shell is only tested on Linux as of now. It may or may not work on MacOs. It doesn't work on Windows at all.
- Firstly, clone the repo:
git clone https://github.com/raghav-4002/unix-shell.git ~/unix-shell/
cd ~/unix-shell- Make sure that you have GCC installed in your system.
- If you also have GNU Make installed, run the command:
make- Otherwise, you have to manually compile it using:
gcc -Iinclude src/*.c -o shell
- You can run the shell using:
./shell- To exit, just run
exit.
- Handles all external executables, like
ls,pwd,man, etc. - Supported built-in commands:
cd: Change current working directory (not completed yet).exit: Exits the current shell session.exec: Execute an external program.help: Display available built-ins (not completed yet).
- Displays the username of the current logged in user and machine name.
- Displays the current working directory.
- Can execute multiple commands separated by semicolons.
- Allowing the user to edit the command before pressing enter.
- Executing semi-colon separated commands.
- Advanced logical precedence using parenthesis.
- Adding support for Pipelining.
- Adding IO redirection.
- Job control.
- Shell globbing and expansion.
- Tab auto-completion.
- Adding
.rcfile and history preview using arrow key andhistorycommand. - Scripting capabilities.
- Accepts user input in raw string format.
- Tokenizes the input using lexical analysis, separating commands from operators like
&&and||, into components namedelements. - Parses these
elementsinto an abstract syntax tree according to the precedence of logical operators. - Traverses the tree, executing commands.