minishell is a very simple shell written in C. It has the following commands built in.
- echo
- cd
- pwd
- export
- unset
- env
- exit
- OS X
- C compiler
- make
- readline
To install readline on a mac, use brew, etc. as follows.
brew install readline
Execute the following command in the appropriate directory.
https://github.com/Yamada-Ika/minishell.git
cd minishell
make
Execute the following command in the directory where minishell
exists.
After execution, a prompt will appear.
./minishell
minishell>
-
It reproduces the following basic behaviors
- Pipes, redirects, and heredocs
- Environment variable registration, deletion, and variable expansion
-
example
minishell> echo aaa | cat | cat | cat | cat
aaa
minishell> cat Makefile > log
minishell> diff log Makefile | cat -e
minishell>
minishell> cat << EOS
> hoge
> EOS
hoge
minishell> export test=hoge
minishell> echo $test
hoge
minishell> unset test
minishell> echo $test
minishell>
\
,;
, and so on cannot be interpreted!
This software is released under the MIT License, see LICENSE.