This is a 21 School/Ecole 42 Project. Worked in team with Cflorind
Coding a simple CLI shell with basic functionality. Subject can be found here.
- Understand the way shells work
- Implement redirections, pipes, handle environment variables
- Practice signal handling
- Implement list of builtins
- History of previous entered commands
- Search and launch the right executable (based on the
PATHvariable, using a relative or an absolute path) - Environment variables (
$followed by a sequence of characters) expand to their values - Wildcards
*in the current working directory ctrl-C,ctrl-Dandctrl-\behave like in bash’(single quotes - prevent from interpreting meta-characters in quoted sequence)"(double quotes - prevent from interpreting meta-characters in quoted sequence except for $)$?expands to the last exit status|connect cmds or groups with pipes; output of a cmd is connected to the input of the next cmd via a pipe&&and||with parenthesis for priorities
echowith option -ncdpwdwithout optionsexportwithout optionsunsetwithout optionsenvwithout optionsexit [exit_status]without options
[n] (optional) specifies the file descriptor, if not specified it is stdout/stdin
[n]< fileRedirecting Input[n]<< limiterHere Documents[n]> fileRedirecting Output[n]>> fileAppending Redirected Output
Run the following commands in Terminal:
# to build
> make
# to run
> ./minishell