Transhell is a c interpreter who read input from user and redirect it to "/bin/sh" shell with "42 norminette" norms.
Transhell is write in pure C with <stdio.h> library only. It use "scanf" command to capture user input and store it into the "line" variable. Then remove "\n" and other stuff via "getchar()". And finally use "popen" to redirect input to "/bin/sh" and check if error is not occured. It print line per line the output of the pipe who contain the command. Btw it close via "pclose" the pipe created before and check if an error occured during close.
Transhell can be improved if you create an entire new shell from scratch (that shit will be done at 42), or write some part like memory gestion in asm. Some other stuff can be improved via some variable gestion improvement but this is minor issue.
minimum requirement :
- ninja
- meson
- gcc
- make
build it :
- go to the root directory of the project
- use "make"
- this will configure build directory with meson and build project with ninja
- execute the script in the build directory with ./build/transhell or make run (recommended)
after build :
- you can check what make command is doing while "make" command by checking the "Makefile"
- the code is well documented so if you want to dig in you obviously can
- this README act like a documentation so if you want to know how it work you will see it here
- if you want to improve my script help me TwT
This is obviously not for production usage only for fun and 42 training. And btw this thing is absolutly dogshit and absolutly not for normal usage even if you are a psychopath or a random lfs user who say "bash is too bloated i use Transhell to replace it".
Transhell is absolutly not a joke about "transgender" but juste a name that i like. (yeah that's sad but realistic)
Write by : alexis marechal. Credit to <stdio.h> mainteners.
mail or you can contact me via some link on my profile.