As beautiful as a shell
This project is about creating a simple shell. Yes, your own little bash. You will learn a lot about processes and file descriptors.
You need to install readline
sudo apt-get update
sudo apt-get install libreadline-dev
make run
It will automatically compile the project and run it.
./minishell
Will launch the previously compiled project with make
and run it.
-
History
-- Working history -
\
-- Supports escaping characters with backslashes for proper command interpretation -
'
"
-- Supports proper parsing of single and double quotes for string handling -
Redirections
-- Supports input (<
), here-doc (<<
), output (>
), and append (>>
) redirections -
Environnemts variables
-- Supports retrieving, setting, and expanding environment variables -
$?
-- Displays the exit status of the last executed command -
Signals
-- Handles signals like CTRL-C (interrupt
), CTRL-D (EOF
), and CTRL-\ (quit
) -
Builtins
--echo
with -n option
--cd
with relative, absolute, and- ($OLDPWD)
paths
--pwd
--export
--unset
--env
--exit
-
Others
--$SHLEVEL
IncrementsSHLVL
by one. Sets it to one ifSHLVL
is invalid (not between 1 and 999)
--$PWD
UpdatesPWD
to reflect the current directory after acd
command or if noPWD
is present in the environment
--$OLDPWD
UpdatesOLDPWD
after acd
command or if noOLDPWD
is present in the environment
-- Prompt
A beautiful, colorful prompt that displays the currentPWD
at the beginning
This group project was done by MVPee and Nour Echaara