A lightweight Unix shell written in C, built from scratch as a systems programming exercise. It supports command execution, I/O redirection, sequential commands separated by semicolons, and single-pipe piping between two commands.
- Interactive prompt showing the current working directory
- Command execution via
execvpwith full argument support - Built-in
chdirfor directory navigation - Built-in
quitto exit the shell - I/O redirection —
<for stdin,>for stdout - Sequential commands separated by
; - Single pipe (
|) between two commands
gcc -Wall -O2 -o hy345sh hy345sh.c./hy345shYou will be greeted with a prompt like:
<4581>-hy345sh@sfyrixtras:/home/user $
<4581>-hy345sh@sfyrixtras:~ $ ls -la
<4581>-hy345sh@sfyrixtras:~ $ ls > output.txt
<4581>-hy345sh@sfyrixtras:~ $ sort < input.txt
<4581>-hy345sh@sfyrixtras:~ $ ls ; pwd ; echo hello
<4581>-hy345sh@sfyrixtras:~ $ ls | grep .c
<4581>-hy345sh@sfyrixtras:~ $ chdir /tmp
<4581>-hy345sh@sfyrixtras:~ $ quit
- Pipes support only a single
|(two-command pipeline) - No background process support (
&) - No environment variable expansion
- No command history
hy345sh/
└── hy345sh.c # Full shell implementation
Stylianos Athanasiou — CSD4581