4 ms·
bash is one of my favorite, as favorite as vim and lua. a single binary that is less than 2M bytes, universal, way more capable than many people think. with s
by synergy20 3y ago
bash is one of my favorite, as favorite as vim and lua.
a single binary that is less than 2M bytes, universal, way more capable than many people think.
with shellcheck and good habits, bash can be readable and safe as well.
if you want something extra, you can always use C/C++ to add those utilities without using more involved FFI etc, and without pip/npm/etc to load who knows how many dependencies.
- inetknght 3y ago> with shellcheck and good habits, bash can be readable and safe as well. My favorite thing to do with shellcheck: add it to CI. Developers hate this one trick! A lot of times CI and Dockerfiles have inline bash scripts. My next favorite thing to do is to move all of that inlined bash to their own script files. Now that CI has shellcheck: all that stuff gets checked too! Developers seem to hate this though because it's "less readable". Less readable my ass, it's way more safe. Next problem: the same bash scripts are now in the same files in multiple repositories (a distributed build). I'm open to ideas for improvements here.
- klardotsh 3y agoTo skip the "move your scripts to standalone files" step some devs don't like, consider something like https://github.com/hadolint/hadolint https://github.com/hadolint/hadolint which runs Shellcheck over inline scripts within Containerfiles.
- yodsanklai 3y agoI dislike bash because I'm not good with it. It sucks but is still often the best solution available. Actually, one of my regret was not to invest more time on it when I was a student (a while ago) because it's one of these rare tools that accompanied me my whole career.
- inetknght 3y agoIt's true. The nice thing is that there are many many examples of how to use bash. Just open a script file in random repositories. Most scripts are super SUPER simple. But just copy-paste to shellcheck and it will give some feedback if you're looking to get in some really quick commits and PRs :)