Skip to content

karisti/42_minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42_minishell

Description

This project consists of creating our own little bash. A program that can parse a command and execute it with arguments. Developed by @gpernas- and @karisti-.

Re-implemented features:

  • Runs executables from an absolute, relative or environment PATH (/bin/ls or ls), including arguments or options. ' and " work the same as bash, except for multiline commands.
  • Redirections > >> <.
  • Pipes |.
  • You can separate commands with ;.
  • Environment variables like $HOME, including the return code $?.
  • Handling signals: Ctrl-C to interrupt, Ctrl-\ to quit a program and Ctrl-D to throw an EOF.
  • Some "built-in" functions: echo, pwd, cd, env, export, unset and exit.

Prerequisites

  • Install readline brew install readline
  • Get installed path brew info readline
  • Set correct paths for RL_LIB and RL_INC in Makefile

Usage

  • make for creating executable
  • ./minishell for execution
  • Run commands

Lessons

  • Redirections
  • Pipes
  • Environment variables
  • Signal handling
  • Shell commands

Resources