This is a basic shell, written to prove that shell is not that complex as a definition he told :)
It is safe to use this as your default shell, because you still will be able to start a different shell, such as
zsh
by typingzsh
, or run a executable at any location by typing the full path. So anytime, you can startzsh
,bash
, or runchsh
to change default shell
- Compile
gcc -o mysh mysh.c
Probably copy mysh
to somewhere like /usr/local/bin/
- Add entry to
/etc/shells
Considering the mysh
binary is in /usr/local/bin/mysh
, add it to
/etc/shells
, for eg. my /etc/shells
now is like this:
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/usr/bin/zsh
/bin/zsh
/usr/bin/tmux
/bin/tmux
/bin/ksh
/bin/rksh
/usr/bin/ksh
/usr/bin/rksh
/usr/local/bin/mysh
- Change default shell
chsh -s /usr/local/bin/mysh $USER # Change for current user, replace $USER
with whatever username you want to change the shell for