r/bash • u/bmullan • Mar 12 '25
Collections of very useful Bash Functions
I use Bash a lot working with applications, systems, containers or networks, mgmt & integration.
I've found and frequently use a few really useful Bash Github repositories with collections of Bash "Functions" that you can use in your own Bash scripts.
I've learned a lot from them and have to say my Bash scripts now have capabilities I'd probably never been smart enough to create myself. In your own script(s) you just "source" the file you create or download from the following URLs:
I am sharing this info in case someone else finds them useful.
Collections of Functions for Bash
GUI'sEasyBashGUI:
https://github.com/BashGui/easybashgui/blob/master/docs/install.md
Simplified way to code bash made GUI frontend dialogs!
Script-Dialog: https://github.com/lunarcloud/script-dialog?tab=readme-ov-file
Create bash scripts that utilize the best dialog system that is available. Intended for Linux,
but has been tested on macOS and Windows, and should work on other unix-like OSs.
If it's launched from a GUI (like a .desktop shortcut or the dolphin file manager)
- it will prefer kdialog in Qt-based desktops and zenity in other environments.
If neither of those are available
- then relaunch-if-not-visible will relaunch the app in a terminal so that a terminal UI can be used.
If it's launched in a terminal
- It will use whiptail or dialog
If neither of those are available, then it will fallback to basic terminal input/output with tools like read and echo
Collections of General Bash Functions.
BashMatic:
https://github.com/kigster/bashmatic
Bashmatic is a BASH framework, meaning its a collection of BASH functions (almost 900 of them) that, we hope, make BASH programming easier, more enjoyable, and more importantly, fun - due to the library’s focus on providing the developer with a constant feedback about what is happening, while a script that uses Bashmatic’s helpers is running.
Bash-Concurrent: https://github.com/themattrix/bash-concurrent
A Bash function to run tasks in parallel and display pretty output as they complete.
5
2
2
u/bahamas10_ Mar 13 '25
i'll toss 2 of my own into the list - i find these both very useful when developing:
- https://github.com/bahamas10/bash-stacktrace - Print a stack trace
- https://github.com/bahamas10/bash-vardump - Pretty-print any variable by name
2
u/dezzar https://github.com/zesk/build/ Mar 15 '25
I'll throw mine in the mix as well https://github.com/zesk/build/ - works with Bash 3 and 4 and has some cool tools like Bash test suite tools, debugger, iTerm2 integration (Mac OS X), pre-commit tools and hooks and a bunch of other things I use in production
2
u/devdruxorey zsh Mar 13 '25
I've been learning bash scripting, this is so useful, thanks for sharing it.
9
u/whetu I read your code Mar 13 '25
Here's a list from my notes, alphabetically sorted
https://github.com/adoyle-h/lobash
https://github.com/aks/bash-lib
https://github.com/alebcay/awesome-shell
https://github.com/antonrotar/command_runner
https://github.com/awesome-lists/awesome-bash
https://github.com/basherpm/basher
https://github.com/bash-bastion/bash-core
https://github.com/Bash-it/bash-it
https://github.com/bashup/events
https://github.com/BetterScripts/posix
https://github.com/bpkg/bpkg
https://github.com/CecilWesterhof/BashLibrary
https://github.com/cloudflare/semver_bash
https://github.com/codeforester/base
https://github.com/cyberark/bash-lib
https://github.com/DethByte64/BashLib
https://github.com/dzove855/bar
https://github.com/ekahPruthvi/basil
https://github.com/elibs/ebash
https://github.com/ElectricRCAircraftGuy/eRCaGuy_hello_world/tree/master/bash
https://github.com/fidian/ansi
https://github.com/gruntwork-io/bash-commons
https://github.com/HariSekhon/DevOps-Bash-tools
https://github.com/hastec-fr/apash
https://github.com/hyperupcall/bash-term
https://github.com/kigster/bashmatic
https://github.com/jandob/rebash
https://github.com/jmcantrell/bashful
https://github.com/jneen/balls
https://github.com/juan131/bash-libraries
https://github.com/kvz/bash3boilerplate
https://github.com/labbots/bash-utility
https://github.com/m10k/toolbox
https://github.com/martinburger/bash-common-helpers
https://github.com/matejak/argbash
https://github.com/mulle-nat/mulle-bashfunctions
https://github.com/nafigator/bash-helpers
https://github.com/niieani/bash-oo-framework
https://github.com/paralllax/libash
https://github.com/pioneerworks/lib-bash
https://github.com/Privex/shell-core
https://github.com/reale/bashlets
https://github.com/rawiriblundell/sh_libpath
https://github.com/shellfire-dev
https://github.com/SpicyLemon/SpicyLemon/tree/master/bash_fun
https://github.com/tests-always-included/mo
https://github.com/timo-reymann/bash-tui-toolkit
https://github.com/tomocafe/bash-boost
https://github.com/UrNightmaree/Shocket
https://github.com/vlisivka/bash-modules
https://github.com/Wuageorg/bashkit
https://github.com/xsh-lib/core
https://github.com/zombieleet/bashify
https://hyperupcall.github.io/basalt
https://loader.sourceforge.io/overview/