5 ms·
I'm probably going to get downvoted for this, but: writing bash scripts in general just isn't a fun experience. years ago, i started just writing ruby scripts
by holtalanm 6y ago
I'm probably going to get downvoted for this, but:
writing bash scripts in general just isn't a fun experience.
years ago, i started just writing ruby scripts for execution in the terminal instead of bash, and haven't had any problems with it so far.
- jaydecus 6y agoA few years ago I would have disagreed, but today I quite enjoy it. What changes my opinion was mostly having a decent IDE configured to deal with the annoying bash syntax errors, and a quicker way to prototype. Though in generqal I always thought Bash scripting to be fun, due to the wide array of programs available that you can directly invoke in your scripts script. The feeling of gluing programs together with pipes into a larger abstraction is just amazing, and bash does that very elegantly.
- Aaronstotle 6y agoThat last part is why I routinely stick with bash for quick scripts. For example, I usually create boolean values to check for a proper config by using grep or grep -c. Do you have any recommendations for an IDE to use for Bash scripting?
- kortex 6y agoShellcheck (https://www.shellcheck.net/ https://www.shellcheck.net/) is essential, with or without IDE. Pycharm has it built in or as a plugin now too.
- amelius 6y agoYes, Bash is nice as long as you use it as a shell only. For a scripting language, better look elsewhere. If we had to standardize on one language, perhaps Python would be a good choice.
- jonahx 6y agoRuby is definitely a better tool for this but there are situations where it's not available but bash is. That portability is really the only advantage.
- dotancohen 6y agoNow that Python 2 is deprecated, I think that settling on Python for scripts is the happy medium. It is available in all but the most stripped-down linux builds, and those are commonly seen today only in docker images or hardware. And adding it to e.g. Alpine is trivial.
- kortex 6y agoI got bit by a Bash-ism late last night (-ne vs != causing a CI test to silently fail) and that was kind of the last straw for me. I drive zsh but still use bash scripts a lot cause "portability" and "it's available everywhere" but that argument just doesn't hold up when I'm already in control of most of my stacks and have docker access on pretty much every host I'm in. I'm forcing myself to use Xonsh more, which despite having all its own quirks, is so much less mental overhead going between Python development. Yeah maybe it's a few more steps (than zero for bash) to provision, but it's worth it.