Skip to content

Corg-Labs/Shell-in-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

cshell

Minimal Unix shell with pipes and redirection, in C.

A small, self-contained demo written in pure C — no external libraries, just the standard library and POSIX. Part of the Corg-Labs collection of single-file C programs.


How It Works

  1. A command line is split on the pipe character into stages
  2. fork() + execvp() run each stage as a child process
  3. pipe() and dup2() wire one stage's output to the next's input
  4. < and > redirect a stage's input/output to files

Build

gcc cshell.c -o cshell

Run

./cshell

Controls

Built-ins: cd, exit. Try ls | grep .c | wc -l or cat < in > out.

About

► Minimal Unix shell with pipes and redirection, in C.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages