This project is about creating a Bourne-Again Shell (BASH) replica for the minishell project at Codam. Minishell is therefore a user-mode program that implements a Command Line Interface (CLI).
In general terms what this program does is:
- Print a prompt
- Read a line
- Parse
- Execute
- Repeat
Features
options
minishell:~$ pgrm -r -f path/to/file
i/o redirections
minishell:~$ pgrm < infile > outfile
minishell:~$ pgrm < infile >> outfile
pipes
minishell:~$ pgrm | pgrm2 | pgrm3
enviroment variables
minishell:~$ARG=something
minishell:~$ pgrm $ARG
previous foreground exit status
minishell:~$ pgrm $?
single quotes
minishell:~$ pgrm '$ARG $ARG2'
double quotes
minishell:~$ pgrm "$ARG $ARG2"
key bindings
- arrow up / down for history.
- ctrl-C displays a new prompt on a new line.
- ctrl-D exits the shell.
- ctrl-\ does nothing.
Built-ins
- echo with option -n
- cd with only a relative or absolute path
- pwd with no options
- export with no options
- unset with no options
- env with no options or arguments
- exit with no options
Missing
- scripting control
- command / filename completion
- background control
- initialization / startup files
system calls
- fork
- exec
- exit
- wait
- open
- close
- read
- write
- pipe
- dup
- chdir
- Clone the repo
git clone https://github.com/Chr-ss/minishell.git
- cd into directory
cd minishell
- Call the Makefile
make
Documentation in README https://github.com/DimitriDaSilva/42_minishell?tab=readme-ov-file#1-extracting-information
https://www.cipht.net/2017/10/17/build-your-own-shell.html https://github.com/tokenrove/build-your-own-shell
https://brennan.io/2015/01/16/write-a-shell-in-c/ https://github.com/brenns10/lsh Shell in C Bash Architecture Bash Manual
Parsing without malloc (Andres)
Matching wildcards
Algorithms for parsing
https://en.wikipedia.org/wiki/Shunting_yard_algorithm https://eli.thegreenplace.net/2012/08/02/parsing-expressions-by-precedence-climbing https://www.cs.purdue.edu/homes/grr/SystemsProgrammingBook/Book/Chapter5-WritingYourOwnShell.pdf
Parsing Techniques A Practical Guide History of Parsing methods
Github Guide on Collaboration Jonathan Mines Github Collaboration Guide