- work on linux and macos:
install: make install
this project impliment the minimal parts of a shell
-
moving in out directory
-
evaluting user input such as -> "$USER" -> jemartel
-
executing local command such as ./minishell
-
executing absolute command such as /bin/sh
-
executing command without saying the path
-
redirecting input with "input rediction" with the symbol "<"
-
redirecting output with "input rediction" with the symbol ">"
-
redirecting output and adding to the end with "append rediction" with the symbol ">>"
-
redirecting input with "input 'here-redicetion' " with the symbol "<<"
-
the shell command of (env,export,echo,exit,cd)
-
return value of the lass process passed down the execution from subprocess
-
piping elements from one command to the other "ls | wc | wc"
Program structure
-
parsing: "creates tokens from the base string tha come from readline" then if an error occcure a this stage it will prompt an error and display the display it to screens the tokens are place in a doubly linklist "(yes its not a tree)" each token in a the list will be typed "its a number" according to previous assumpitons
-
jobs: a doubly linklist that is create from the previous list; each jobs as fews composents: such as the arguments for a command if there is a commands if there redirecton ther will be an list:(a doubly link list) if there a error somewhere everything before will be deleted
-
evalution: each string passed down the pipeline will be converted to what it should be element prefixed with with a $ in and out of a string will be 'expanded' otherwise the value with the $ before stay the same without the ' the 'quoting can be nested the first seen do the behavior' the evalution part of the program is self standing and can be use in any other project with minimal change
-
execution: at this stage the program will try to do rediction < > >> but not << since its done 'in evalution part' any errror will bail an early exit and not execute anything last part is trying to see if the arguments is an executable or otherwise EVERYTHING tha is not readline in a subprocess will be deleted in an errors or not
tour of the struggle that we had during the project
-
mini-shell-racoon/executing/find_part.c
Line 68 in e8d0e5a
-
mini-shell-racoon/parsing/parsing.c
Line 16 in e8d0e5a
-
mini-shell-racoon/executing/fd.c
Line 15 in e8d0e5a
-
mini-shell-racoon/jobs/jobs_lst.c
Line 60 in e8d0e5a
-
Line 75 in e8d0e5a
-
mini-shell-racoon/eval/eval_util.c
Line 46 in e8d0e5a
want to know more on how to build a shell?
- https://github.com/csabagabor/Basic-Shell-implementation-in-C/blob/a176b00b5f03027882ea1f7ae6c7f01f697cc328/shell.c#L83- https://githubmemory.com/repo/gleal42/42_Minishell
- https://www.cs.purdue.edu/homes/grr/SystemsProgrammingBook/Book/Chapter5-WritingYourOwnShell.pdf
- https://www.notion.so/Minishell-Materials-7bbd45a806e04395ab578ca3f805806c