Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyShell – Custom UNIX-like Shell in C

A fully functional custom UNIX-like shell implemented in C, built from scratch without relying on existing shell code.
Implements core shell features such as command execution, directory navigation, piping, redirection, and prompt customization.


Features

  • Command Execution – Runs any executable in the system’s $PATH using execvp
  • Multiple Commands per Line – Separate with ;
  • Change Directory – Built-in cd with home (~) expansion
  • Prompt Customization – Shows shortened current working directory
  • Exit Methods – Type exit or press Ctrl-D
  • Pipes – Basic single-pipe support using popen()
  • I/O Redirection< for input, > for output
  • Error Handling – Graceful handling of invalid commands and arguments

File Overview

  • main.c – Entry point and main program loop
  • shell.c – Core shell logic (command parsing, execution, pipes, redirection)
  • shell.h – Header file for shared functions and constants
  • makefile – Build automation (make, make clean)
  • .gitignore – Ignore compiled binaries and temp files

Quick Start

1. Build

make

Produces the myshell binary.

2. Run

./myshell

Usage Examples

ls -l
cd Documents
echo "Hello, World!" > output.txt
cat < input.txt | grep keyword
pwd; whoami; date

Exit the shell:

exit

or press Ctrl-D.


Clean Build Artifacts

make clean

Notes

  • Designed for POSIX-compliant systems (macOS, Linux)
  • No external dependencies beyond a C compiler
  • Simple single-pipe implementation; multiple pipes can be added with minor parsing changes

Skills Demonstrated

  • Low-level C systems programming
  • Process control with fork(), execvp(), and wait()
  • Command parsing using strsep() and tokenization
  • File descriptor manipulation for I/O redirection
  • Basic inter-process communication with popen()
  • Terminal prompt customization

Author

Developed by Andrew Choi, Victor Kamrowski, and Tony Chen.


Repository Note

This repository was imported in a single commit from a private development repo where it was originally created and maintained.
The commit history was reset to remove unrelated school references.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages