Welcome to my custom Unix shell written in C! This shell is designed to provide an advanced command-line environment with features such as symbol tables, word expansion, tilde expansion, and more. Whether you're a Unix veteran or a newcomer, this shell aims to enhance your command-line experience.
This Unix shell project includes the following features:
-
Command Execution: Execute basic commands like
ls
,cd
,pwd
,exit
, and more. -
Job Control: Bring jobs to the foreground with
fg
, send them to the background withbg
, and list current jobs withjobs
. -
Built-in Commands: Access a variety of commands built directly into the shell.
-
Signal Handling: Handle signals like
SIGINT
(Ctrl+C) andSIGTSTP
(Ctrl+Z) gracefully. -
Custom Prompt: Customize your shell prompt to suit your preferences.
-
Symbol Tables: Efficiently manage variables and streamline command parsing using advanced symbol tables.
-
Word Expansion: Experience flexible and dynamic command input with powerful word expansion capabilities.
-
Tilde Expansion: Seamlessly reference home directories using integrated tilde expansion for convenient shortcuts.
-
...and more: The shell incorporates various advanced concepts to deliver a comprehensive Unix experience.
To build this project, you will need to have make
and gcc
installed on your system. Once you have these prerequisites, you can build the project by following these steps:
-
Open a terminal and navigate to the root directory of the project.
-
Run the
make
command:make
.
├── builtins
│ ├── builtins.c
│ └── dump.c
├── executor.c
├── executor.h
├── initsh.c
├── main.c
├── Makefile
├── node.c
├── node.h
├── parser.c
├── parser.h
├── pattern.c
├── prompt.c
├── Readme.md
├── scanner.c
├── scanner.h
├── shell.h
├── shunt.c
├── source.c
├── source.h
├── strings.c
├── symtab
│ ├── symtab.c
│ └── symtab.h
└── wordexp.c
This project uses clang-format
for code formatting. The style is defined in the .clang-format
file in the root directory of the project.
To format your code, navigate to the root directory of the project in your terminal and run the following command:
find . -iname '*.c' -o -iname '*.h' | xargs clang-format -i
This project was created by Huzaifa Naseer.
Connect with me on LinkedIn.