How I built a pure Bash multi-tool as a first-year CS student
Hi everyone!
I'm a first-year computer science student from Russia. I've been learning Linux and Bash scripting for a while, and I got really tired of constantly googling the syntax and flags for find and chmod.
So I decided to build a tool to solve my own pain: SWISS.
What is SWISS?
SWISS is a terminal multi-tool. It has no external dependencies (just standard Linux utilities) and combines three things into one colorful TUI (Text User Interface) menu:
- File Search: By name, extension, time, size, and permissions.
-
Hex Viewer: View files in hex format (with basic encoding conversion via
iconv). -
Rights Manager: An interactive
chmodguide and manager.
The challenges I faced
Building a TUI in pure Bash is tricky. Here are a few things I struggled with:
-
Handling binary files: Bash's
readcommand can be a bit finicky with null bytes in binary files, so the hex viewer sometimes struggles with large non-text files. -
The
timevariable: I ran into a funny bug where I used the same variable for choosing the search type (dayordate) and the actual value. It worked, but it was a mess to debug. - Localization: Right now, the interface is entirely in Russian. I'm planning to add English support in the next version.
What I learned
-
Bash is powerful but has limits. It's great for automation and simple menus, but for complex TUI, Python with
cursesis probably the better choice. -
Open source is awesome. I submitted a Pull Request to add SWISS to the
awesome-bashlist, and it taught me a lot about how the Open Source community works. - Building for yourself is the best motivation. I use SWISS every day, and it actually makes my life easier.
GitHub Link
You can check out the code, download the release, or leave feedback here:
I would really appreciate any feedback, especially on how to make the code cleaner and more portable!

Top comments (0)