Skip to content

Minishell is a 42 team project with the objective of developing a basic shell program in C. It implements redirections, pipes, environment variables and some builtin commands. Coded with @paridaMamat

License

Notifications You must be signed in to change notification settings

mariav7/minishell_42project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo:


Coded with 💗 by: mflores- and pmaimait

Project

Subject PDF

The purpose of Minishell is to create a simple small shell program in C based on Bash.

A shell, in simple terms, is a command-line interface that allows you to interact with your computer's operating system by typing commands in order to tell it what to do.


Supported feautures

The project's requirements:

  • Prompt display
  • Command history (⬆️ and ⬇️ arrows)
  • System executables available from the environment (ls, cat, grep, etc.)
  • Local executables (./minishell)
  • Builtin commands :
    • echo (with option -n)
    • cd (with only a relative or absolute path)
    • pwd (no options)
    • export (no options)
    • unset (no options)
    • env (no options or arguments)
    • exit (with exit number)
  • Pipes | connects two or more commands in a way that allows the output of one command to be used as the input for another
  • Redirections:
    • > redirects output
    • >> redirects output in append mode
    • < redirects input
    • << DELIMITER displays a new prompt, reads user input until reaching DELIMITER, redirects user input to command input (does not update history)
  • Environment variables (i.e. $USER or $HOME) that expand to their values.
    • $? expands to the exit status of the most recently executed foreground pipeline.
  • User keyboard signals:
    • ctrl-c displays a new prompt line.
    • ctrl-d exits minishell
    • ctrl-\ does nothing

This Minishell DOES NOT support \, ;, &&, ||, or wildcards.


Installation

Clone github repository and compile program:

git clone [email protected]:mariav7/minishell_42project.git
cd minishell_42project && make

Run the program:

./minishell

OR

Run the program using valgrind:

./leak_test.sh

About

Minishell is a 42 team project with the objective of developing a basic shell program in C. It implements redirections, pipes, environment variables and some builtin commands. Coded with @paridaMamat

Topics

Resources

License

Stars

Watchers

Forks