Custom Unix-like Shell with Built-ins, Aliases, Pipes, and Redirection
This project implements a lightweight shell (mysh
) in C.
It started as an Operating Systems assignment and was extended into a practical developer tool.
It demonstrates:
- Process control (
fork
,execvp
,wait
) - System calls (I/O, file descriptors)
- User experience (history, aliases, configs)
- Dynamic prompt:
user@host:cwd$mysh>
- Built-ins:
cd
,pwd
,exit
,export
,alias
,unalias
,which
- Configurable startup (
~/.myshrc
) - Aliases & environment variable support
- Command history & search (GNU Readline: ↑ ↓,
Ctrl+R
) - Pipes & redirection (
|
,<
,>
,>>
) - Error handling with descriptive messages
Build and run:
make
./mysh
Example session:
mysh> alias ll="ls -la"
mysh> export PATH=$PATH:/usr/local/bin
mysh> cat file.txt | grep "hello" > out.txt
mysh> which python
/usr/bin/python
code-tiny-shell/
├─ src/ # source code (mysh.c + helpers)
├─ tests/ # sample scripts and test cases
├─ docs/ # design notes, demo screenshots
├─ Makefile # build rules (gcc + readline)
└─ README.md
- Add tab-completion for commands
- Add background process support (&)
- Add colored prompt themes
MIT (see LICENSE)