A small recreation of tcsh, using an Abstract Syntax Tree. Handles pipes, redirections, ||, &&, variables, sperators, ...
Simply run the mysh binary and execute the commands you like.
For example:
./mysh
~
> echo $HOME
/home/reyshyram
~
> builtins
builtins env setenv unsetenv set unset cd exit
~
> set name=Reyshyram
~
> echo Hi $name!
Hi Reyshyram!
~
> ls notexist || echo Logical or
ls: cannot access 'notexist': No such file or directory
Logical or
~
> (cd ..; pwd) && pwd
/home
/home/reyshyram
~
> notfound
notfound: Command not found.
[84] ~
> exit 0
exit
Simply use make to compile the program:
make -j$(nproc)And then run the resulting binary, in this case, mysh.