Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.
/ minishell Public archive

simple version of Unix bash with key features

Notifications You must be signed in to change notification settings

dann-romm/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minishell

Simple implementation of Unix bash with pure C

features

  • built-in commands
    • echo with -n option
    • cd with absolute or relative path
    • pwd
    • export
    • unset
    • env
    • exit
  • prompt depending on PS1 PS2 variables
  • commands history
  • redirects
  • pipes
  • evironment variables stored in the hashtable
  • exit status $?
  • signals
    • ctrl-C
    • ctrl-D
    • ctrl-\
  • && and ||
  • wilcard * matching

Usage

there is a Makefile for compiling sources to compile binary, you should run make command

$ make
$ ./minishell

examples

  1. pipes and child processes
minishell > ls -la | wc -l
      13
minishell > yes | head -n 3
y
y
y
  1. redirects
minishell > < input.txt > output.txt cat
  1. wildcards
minishell > ls hash**t*le* | cat
hash.c
hashtable.c
hashtable_to_sorted_array.c
insert_hashtable.c
pair.c
  1. prompt
minishell > PS1="new_prompt > "
new_prompt > 
  1. && and ||
minishell > echo -n "Hello, " && echo "world" || echo "!!!!!!!"
Hello, world

About

simple version of Unix bash with key features

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published