Ekran.Kaydi.2022-12-15.OS.12.27.25.mov
This project is about creating a simple shell. Yes, your own little bash. You will learn a lot about processes and file descriptors. Enjoy it!
The only requirements are:
- GNU make
- Readline library
- GCC
- Open terminal and go HOME with
cd ~
, write thisvim .zshrc
and add this code:
function brew_install()
{
cd /goinfre
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
cd homebrew/bin && ./brew install readline
}
- Close your current terminal, re-open and write brew_install in your terminal. Wait for it to end!
- Finally you can go where u cloned this project and you can execute like this
./minishell
- Don't forget if you switch to another computer on campus you must write again
brew_install
for installion.
- Can only use C
- Must respect the school imposed coding style
- No memory leaks
- Implement a series of builtins:
echo
,cd
,setenv
,unsetenv
,env
,exit
- Manage the errors without using
errno
, by displaying a message adapted to the error output - Can only use these standard library functions:
- malloc, free
- access
- open, close, read, write
- opendir, readdir, closedir
- getcwd, chdir
- stat, lstat, fstat
- fork, execve
- wait, waitpid, wait3, wait4
- signal, kill
- exit
- Must have a Makefile to build the program
- The binary file must be named
minishell
- Can use Libft
- Handle program interruption (Ctrl + D)
If we have solved it, it will appear as drawn, if we have not solved it, only the problem will be written.
- ✅ Firstly if u write only "unset" terminal will suppress segmentation fault to screen. The solution is simple, I will do it when I am available. We need to check if in the unset part, just it!