/Shell

A basic shell with piping, history and output redirection written in C.

Primary LanguageC

Shell

A basic shell with piping, history and output redirection written in C.

Usage:

Piping

Prepend command with PP and use -> to pipe commands:

example(bash): wc -l > out.txt

example(shell): PP wc -l -> out.txt

Output redirection

Prepend command with OR and use -> to pipe commands:

example(bash): ls -l | wc -l

example(shell): OR ls -l -> wc -l

Output redirection and piping

Prepend command with ORPP and use -> to pipe commands:

example(bash): ls -l | wc -l > out.xt

example(shell): ORPP ls -l -> wc -l -> out.txt

History

  1. Type history too see previous commands
  2. use the bang(!) to execute the command id.

example:

history
 0  ls
 1  cat out.txt
 2  rm out.txt
 3  ls
 4  history
!2
rm out.txt