Author : Elias El Yandouzi
Date : October 2020
State : Can be improved
This shell is written in C and can execute builtin command and program referenced in the PATH variable.
$> make
$> ./shell
To leave the process, a EOF signal must be send (^D does the job for instance).
Mainly through system call in C. Nothing very tricky. No fork here.
NB: (OLDPWD, PWD) and cd are independant.
Fork will duplicate the process in the exact same state.
Wait will halt the parent process until the child is terminated. It cleans also all the ressources allocated to child process. If we don't call wait, we have ZOMBIE.
The execve function will replace the current running process with a new one.
The shell can run command like so :
ls -al | cat | grep .git
Useful links:
The redirection can be done in the two ways.
Ouput redirected :
-
It can just create a new file or remplace its content if it already exists :
ls -al > toto
-
It can append the output to the end of the file :
ls -al | grep .gitignore >> titi