Skip to content

This project is about creating a simple shell. Yes, your own little bash. You will learn a lot about processes and file descriptors. A deep dive into the inner workings of a shell by creating bash.

Notifications You must be signed in to change notification settings

Quilfort/42_School_minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell

Overview

Welcome to Minishell, a project from the 42 Network that aims to create a lightweight shell with essential functionality, fully written in C.

Features

  • Prompt display: A clean and responsive prompt appears when waiting for a new command.
  • History: The shell maintains a functional command history.
  • Executable Launch: The shell searches and launches the correct executable based on the PATH variable or specified relative/absolute paths.
  • Signal handling: Uses a single global variable to indicate a received signal, ensuring that signal handlers don't access critical data structures.

Usage guidelines

To ensure a smooth experience, please keep the following guidelines in mind:

  • Quotation marks and special characters: The shell does not interpret unclosed quotation marks or unnecessary special characters such as \ (backslash) or ; (semicolon).
  • Quotation marks: Use ' (single quote) to prevent interpretation of metacharacters and " (double quote) to allow interpretation of metacharacters except $ (dollar sign).
  • Redirections: Implements various redirections, including input (<), output (>), append mode output (>>), and a heredoc-like feature (<<).
  • Pipes: Supports pipes (|) to connect the output of one command to the input of the next.
  • Environment Variables: Recognises and expands environment variables ($ followed by a string).
  • Builtins: Implements essential builtins, including echo, cd, pwd, export, unset, env and exit.

Signal handling

  • ctrl-C:** Displays a new prompt on a new line in interactive mode.
  • ctrl-D:** Exit the shell in interactive mode.
  • ctrl-:** Has no special effect in interactive mode.

Memory Management

The readline() function can cause memory leaks, which are reported but not fixed. However, all heap allocated memory must be properly freed to avoid leaks.

Feel free to explor and enjoy this school project

About

This project is about creating a simple shell. Yes, your own little bash. You will learn a lot about processes and file descriptors. A deep dive into the inner workings of a shell by creating bash.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published