Skip to content

hsnexe/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by hashammo, tzammar.

Minishell - As beautiful as a shell

Description

Minishell is about creating a simple shell, functioning as your very own little Bash. With Minishell, you'll travel back in time and experience the challenges developers faced before Windows existed. The primary goal of this project is to gain extensive knowledge about processes and file descriptors.

Features

Mandatory Part

  • Displays a prompt when waiting for a new command.
  • Maintains a working command history.
  • Searches and launches the right executable based on the PATH variable or by using a relative or absolute path.
  • Handles ' (single quotes) to prevent the shell from interpreting meta-characters.
  • Handles " (double quotes) to prevent interpretation of meta-characters, except for $ (dollar sign).
  • Implements input and output redirections: <, >, << (heredoc), and >> (append mode).
  • Implements pipes | to connect the output of one command to the input of the next.
  • Handles environment variables expansion and the $? variable to expand to the exit status of the most recently executed foreground pipeline.
  • Handles interactive signals ctrl-C, ctrl-D, and ctrl-\ mirroring Bash behavior.
  • Implements the following built-in commands: echo (with -n), cd (relative/absolute paths), pwd, export, unset, env, and exit.

Bonus Part

  • Supports && and || logical operators, including the use of parenthesis for priorities.
  • Supports wildcards (*) for the current working directory.

Instructions

Requirements

External Dependencies: This project relies on the previously created libraries. The following must be present and included to compile:

  • libft

Compilation

To compile the program, run the following command in the root of the repository.

This will link all dependencies and generate the Minishell executable:

make

This will delete all .o files but keep the Minishell executable:

make clean

This will delete all .o files and the Minishell executable:

make fclean

This will recompile the project:

make re

Usage

Once compiled, you can launch the interactive shell by running the output executable:

./minishell

Resources

Documentation & References:

AI Usage:

During the learning journey, AI tools were utilized to reduce repetitive tasks and assist with technical explanations. All generated content was critically assessed, approached with caution, and systematically checked and reviewed with peers to avoid blind spots and bugs. Ultimately, only AI-generated concepts and code that were fully understood and could be taken responsibility for were integrated into the final submission.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors