Skip to content

mannatrajsingh/os-unix-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unix Shell from Scratch

A minimal Unix shell implemented in C using POSIX system calls, replicating core bash functionality such as process execution, background jobs, and signal handling.


Features

  • Command execution via fork() and execvp()
  • Built-in commands: cd, exit, jobs
  • Background execution using &
  • Job tracking and management
  • Signal handling (Ctrl+C, Ctrl+Z)
  • Error handling for invalid commands

Usage

Build

make

Run
./myshell

Example
myshell> ls
myshell> cd ..
myshell> sleep 5 &
myshell> jobs
myshell> exit

Implementation Highlights

Process management with fork, execvp, and waitpid

Signal forwarding using signal and kill

Modular design with separate components for parsing, execution, jobs, and signals

Tech Stack

C · POSIX APIs · Unix/Linux

Author

Mannat Raj Singh

About

Minimal Unix shell in C using POSIX system calls - command execution via fork/execvp, built-ins (cd, exit, jobs), background jobs with &, job tracking, and signal handling (Ctrl+C/Ctrl+Z).

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages