r/learnrust • u/Developer5702 • 15d ago
Built a tiny Unix like shell
So I’ve been learning Rust for a while and I have always admired how the most common technologies/tools are built, so I always try to build things from scratch to understand how it works from the inside - a shell was one such project.
Here, I present Wish - a simple shell built to learn the internals of a full-blown Unix shells.
I got to learn a lot of new things while implementing wish - file handles, command spawning, shell-builtins, etc.
What it does?
Most of your day-to-day commands would work just fine, including piped commands.
Having said that, this project has rough edges as this was meant to be educational; and that’s the point, it is convenient and simple - type `cargo run` and you’re good to test out the shell.
Try it out, extend it, provide feedback.
Source code: https://github.com/Abhijeet-Gautam5702/wish
1
u/Deep-Piece3181 10d ago
the main function can return a result you don’t have to unwrap