Skip to content

annafenzl/42-minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minishell

This is a project for 42Heilbronn school's curriculum.

The goal of this team-project is to write a program creating a simple shell, that provides a command-line interface for users to interact with the operating system. I was responsible for the execution part, my partner Anna Iarinov did the parser.

Features

  • Display a prompt when waiting for a new command
  • Have a working history
  • Search and launch the right executable based on the PATH variable or using a relative or absolute path
  • Handle single and double quotes
  • Implement redirections (<, >, <<, >>)
  • Implement pipes (|)
  • Handle environment variables ($ followed by a sequence of characters) which should expand to their values
  • Handle $? which should expand to the exit status of the most recently executed foreground pipeline
  • Handle the signals ctrl-C, ctrl-D and ctrl-\ which should behave like in bash
  • Built-in commands:
    • echo with option -n
    • cd with a relative or absolute path
    • pwd
    • export
    • unset
    • env
    • exit

Description

run make

Before running minishell make sure that you have readline library installed and found by the Makefile. The program will be executed as follows:

./minishell

What i learned

  • What are signals and how to use them
  • Redirections in bash
  • Variable expansion in bash
  • How does the bash interpret single and double quotes
  • What's a parser
  • In depth insight into builtin commands of Bash

About

Recreating a simple version of bash

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •