42 Unix project. The code is written in accordance with The Norm (42 coding style).
The project was done in a team with Elena Kiseleva, it contains lots of parsing, signal and error handling and process management (fork, execve, etc.).
- navigate through command history using up and down arrows (done using termcap);
- modification of current or previous commands using backspace (not supports movement with left and right arrows);
- ctrl-C, ctrl-D and ctrl-\ signals;
- $?;
- environment variables;
- pipes (except for multiline commands);
- >, < and >> redirections (except for file descriptor aggregation);
- semicolon;
- single, double quotes and \;
- builtins commands :
echo
with-n
option;cd
with relative or absolute path;pwd
,export
,unset
andexit
without any options;env
without any options and any arguments;
- external commands launch through execve.
In the root of repository run make
and launch executable -- ./minishell
.
builtins
folder -- builtins commands code.envp
folder -- code for manipulating envp array/list.parser
folder -- code for parsing and launching (where all the magic happens, basically).readline
folder -- reading via termcap.utils
folder -- utils functions (some from own C library, some specific for project).
Makefile
make
-- compilesminishell
executable.clean
-- deletes object files.fclean
-- deletes object files andminishell
.re
-- runsfclean
and recompiles.