shunit2
etc
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
shunit2
-
Pure Bash Bible
> or something that would proper unit testing
<https://github.com/kward/shunit2>
-
First time writing bash scripts for work, not sure if this is true elsewhere
https://github.com/kward/shunit2 is your friend here.
-
AWK an old-school tool today
And in case you are thinking how powerful this is and like me trying to take it further to create small AWK powered "apps" to do the monotonous tasks while wondering how can you verify if what you are coding is valid, you can execute any number of unit tests for shell scripts, and therefore, AWK scripts using shunit2
-
ShellCheck: A static analysis tool for shell scripts
Alongside ShellCheck, I also use shUnit2 as my unit testing framework. Yes, you should test your bash.
https://github.com/kward/shunit2
etc
-
Starship.rs: minimal, fast prompt for any shell
Since this is now a share your prompt thread, here's mine:
https://github.com/rollcat/etc/tree/master/cmd/prompter
It's quite portable (didn't test on Windows though); ~170 lines of Go; no dependencies outside of stdlib; calls no external commands; supports SSH, git, Docker, nix, and virtualenv; extremely simple to hack on.
-
What is in that .git directory?
It's fairly easy to grab info from .git for your own purposes. For example, the program that generates my PS1 peeks there (without wasting precious cycles on shelling out to the git command) to find the current branch we're on:
https://github.com/rollcat/etc/blob/b2fd739/cmd/prompter/mai...
-
Pure Bash Bible
Depends on what you're trying to do. If you're shelling out to git(1) or docker(1), rather than e.g. recursively checking for the presence of .git in parent directories, or inspecting ~/.docker/config.json, then the fork+exec overhead is already quite significant. Next if you're parsing ~/.docker/config.json in shell, you're most likely either asking for trouble or (again) shelling out to jq. Writing it all in an interpreted language means you're paying the cost of interpreter startup, which on underpowered systems can take hundreds of milliseconds even when idle. OTOH loading a static binary to memory happens only once, and with Go you can trivially cross-compile.
I also have a fallback shell one-liner, without any of the fanciness like displaying the current git branch:
https://github.com/rollcat/etc/tree/master/cmd/prompter#i-li...
What are some alternatives?
bats-core - Bash Automated Testing System
bish - Bish is a language that compiles to Bash. It's designed to give shell scripting a more comfortable and modern feel.
shellspec - A full-featured BDD unit testing framework for bash, ksh, zsh, dash and all POSIX shells
meowatch - watch fs changes and meow
ShellCheck - ShellCheck, a static analysis tool for shell scripts
babashka - Native, fast starting Clojure interpreter for scripting
sh - A shell parser, formatter, and interpreter with bash support; includes shfmt
zfsbootmenu - ZFS Bootloader for root-on-ZFS systems with support for snapshots and native full disk encryption
shellharden - The corrective bash syntax highlighter
pure-bash-bible - 📖 A collection of pure bash alternatives to external processes.
spdk - Storage Performance Development Kit