https://github.com/ganivetj/minishell
A simple shell built from scratch to explore how command-line interfaces operate, inspired by Bash.
https://github.com/ganivetj/minishell
c-programming cli educational minishell posix shell
Last synced: about 1 month ago
JSON representation
A simple shell built from scratch to explore how command-line interfaces operate, inspired by Bash.
- Host: GitHub
- URL: https://github.com/ganivetj/minishell
- Owner: ganivetj
- Created: 2024-11-09T15:37:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-09T22:21:14.000Z (over 1 year ago)
- Last Synced: 2025-03-14T15:49:19.940Z (over 1 year ago)
- Topics: c-programming, cli, educational, minishell, posix, shell
- Language: C
- Homepage: https://ganivetj.github.io/minishell/
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Overview
Minishell is a project designed to help students explore the inner workings of a shell:
- Introduces core aspects of system programming, including process management, file descriptors, and user input handling.
- Provides hands-on experience with building a fundamental tool for interacting with Unix-like systems.
## Features
- **Prompt Display**: Shows a prompt to indicate readiness for a new command.
- **Command Execution**: Searches for executables in the system's `PATH` and executes commands using either relative or absolute paths.
- **Environment Variable Support**: Expands `$VARIABLES` and manages `$?` to store the exit status of the last executed command.
- **Signal Handling**: Implements custom behavior for `ctrl-C`, `ctrl-D`, and `ctrl-\`.
- **Input/Output Redirection**:
- `<`: Redirects standard input.
- `>`: Redirects standard output.
- `<<`: Accepts input until a specified delimiter.
- `>>`: Appends standard output.
- **Pipes**: Connects the output of one command to the input of the next using `|`.
- **Builtin Commands**:
- `echo` (with `-n` option)
- `cd` (changes directory)
- `pwd` (prints current directory)
- `export` (manages environment variables)
- `unset` (removes environment variables)
- `env` (lists environment variables)
- `exit` (exits the shell)
## Project Documentation
The full documentation for the Minishell project can be found [here](https://ganivetj.github.io/minishell/).