A Unix shell built from scratch in C, running on macOS.
- Command execution โ run any system command (
ls,pwd,echo, etc.) - cd & exit โ built-in navigation and exit
- Pipes โ chain commands together (
ls | grep .c) - Output redirection โ save output to files (
ls > output.txt) - Colored prompt โ green and blue styled prompt
- Error handling โ friendly messages for unknown commands
git clone https://github.com/Baranidharanv06/myshell.git
cd myshell
gcc shell.c -o myshell -L/opt/homebrew/opt/readline/lib -I/opt/homebrew/opt/readline/include -lreadline
./myshellmyshell> ls
myshell> pwd
myshell> echo hello world
myshell> cd ..
myshell> ls | grep .c
myshell> ls > output.txt
myshell> cat output.txt
myshell> exit- How a Unix shell works under the hood
- Process creation using
fork()andexecvp() - Inter-process communication using
pipe() - File descriptors and I/O redirection with
dup2() - Parsing and tokenizing user input in C
- Language: C
- Platform: macOS (Apple Silicon)
- Library: readline