News for hackers. Stuff that matters.
Re:Bash code generator for command-line arguments by holtalanm on Friday October 02, 2020 @10:34AM (#24663020)
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.

Re:Bash code generator for command-line arguments by jaydecus on Friday October 02, 2020 @10:45AM (#24663129)
A 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.

Re:Bash code generator for command-line arguments by Aaronstotle on Friday October 02, 2020 @12:03PM (#24663993)
That 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?

Re:Bash code generator for command-line arguments by kortex on Friday October 02, 2020 @12:27PM (#24664243)
Shellcheck (https://www.shellcheck.net/) is essential, with or without IDE.

Pycharm has it built in or as a plugin now too.

Re:Bash code generator for command-line arguments by kortex on Friday October 02, 2020 @12:25PM (#24664226)
I 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.

Re:Bash code generator for command-line arguments by amelius on Friday October 02, 2020 @11:45AM (#24663800)
Yes, 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.

Re:Bash code generator for command-line arguments by jonahx on Friday October 02, 2020 @11:50AM (#24663852)
Ruby 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.
Re:Bash code generator for command-line arguments by dotancohen on Friday October 02, 2020 @12:38PM (#24664362)
Now 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.