Skip to content

NoellaButi/code-tiny-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiny Shell — mysh 🐚⚡

Custom Unix-like Shell with Built-ins, Aliases, Pipes, and Redirection

Language License: MIT Build CI


✨ Overview

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)

🔍 Features

  • 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

🚦 Quickstart

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

📁 Repository Layout

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

📊 Demo

Demo

🔮 Roadmap

  • Add tab-completion for commands
  • Add background process support (&)
  • Add colored prompt themes

📜 License

MIT (see LICENSE)


About

A custom Unix-like shell in C, supporting built-ins, aliases, pipes, and redirection.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published