Psush is a custom Linux shell. This shell replicates core functionalities of standard shells while adding custom features to enhance user interaction. Written in C, Psush focuses on efficiency, modularity, and error-free execution.
- bye: Exit the shell.
- cd: Change directory (
cd <dir>orcdto switch to the home directory). - cwd: Display the current working directory.
- history: Show the last 15 commands entered.
- echo: Echo the arguments passed, without variable expansion.
- Executes any external Linux command (e.g.,
ls,cat,grep) with full support for command-line options and arguments.
- Pipelines: Support for piped commands (e.g.,
ls | wc). - Input/Output Redirection:
- Redirect input (
wc < file.txt). - Redirect output (
ls > output.txt).
- Redirect input (
- Custom Prompt: Dynamically displays the current working directory, user name, and system name.
- Signal Handling: Graceful handling of
Ctrl+C(SIGINT) without terminating the shell. - Memory Management: No memory leaks, validated using
valgrind. - No Orphans/Zombies: Proper process handling to avoid orphaned or zombie processes.
A Makefile is provided for streamlined building and cleaning.
makemake cleanRun PSUsh from the terminal:
./psush- Development Environment: Linux
- Compiler: GCC with the following flags:
-g -Wall -Wshadow -Wunreachable-code -Wredundant-decls-Wmissing-declarations -Wold-style-definition-Wmissing-prototypes -Wdeclaration-after-statement-Wno-return-local-addr -Wuninitialized -Wextra -Wunused
- Language: C
- Command Parsing: Uses linked lists to handle pipelines and arguments.
- Dynamic Prompt: Displays user and system-specific details.
- Error Handling: Custom messages for failed commands and memory errors.
- Code Structure: Modular design with reusable components in
cmd_parse.candcmd_parse.h.