https://github.com/dsite42/minishell
42 project - minishell - This project involves creating a simplified version of a Unix shell.
https://github.com/dsite42/minishell
42 minishell shell
Last synced: about 2 months ago
JSON representation
42 project - minishell - This project involves creating a simplified version of a Unix shell.
- Host: GitHub
- URL: https://github.com/dsite42/minishell
- Owner: Dsite42
- Created: 2023-05-15T13:37:26.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-10T08:16:54.000Z (over 2 years ago)
- Last Synced: 2025-01-14T00:14:41.091Z (over 1 year ago)
- Topics: 42, minishell, shell
- Language: C
- Homepage:
- Size: 1.69 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minishell
The Minishell project involves creating a simplified version of a Unix shell.
It requires implementing basic shell features like displaying a prompt, handling command history, and executing programs based on the PATH environment variable.
The project focuses on handling special characters, quotes, implementing redirections, pipes, and managing environment variables.
It also requires implementing a few built-in commands like echo, cd, pwd, export, unset, env, and exit.
Additionally, the project deals with signal handling, specifically for ctrl-C, ctrl-D, and ctrl-\.
## Features
- **Prompt Display:** Displays a prompt when waiting for new commands.
- **Command History:** Maintains a working history of commands.
- **Executable Search:** Searches and launches executables based on PATH or given paths.
- **Global Variable Limitation:** Utilizes no more than one global variable.
- **Special Characters:** Does not interpret unclosed quotes or non-essential special characters like `\` or `;`.
- **Quotes Handling:**
- Single quotes `'` prevent meta-character interpretation.
- Double quotes `"` prevent meta-character interpretation except for `$`.
- **Redirections:**
- `<`: Redirects input.
- `>`: Redirects output.
- `<<`: Reads input until a line containing the given delimiter.
- `>>`: Redirects output in append mode.
- **Pipes:** Implements pipes (`|`) where output of one command is piped as input to the next.
- **Environment Variables:** Handles expansion of environment variables (`$`).
- **Exit Status:** `$?` expands to the exit status of the most recently executed foreground pipeline.
- **Signal Handling:**
- `ctrl-C`: Displays a new prompt on a new line.
- `ctrl-D`: Exits the shell.
- `ctrl-\`: No action.
- **Builtins:**
- `echo` with `-n`
- `cd` with relative or absolute path
- `pwd` with no options
- `export` with no options
- `unset` with no options
- `env` with no options or arguments
- `exit` with no options

[Subject PDF](minishell%20subject.pdf)