Hush, a modern shell scripting language
61–70 of 192 posts
Re: Hush, a modern shell scripting language
#62Re: Hush, a modern shell scripting language
#63I've changed my mind about this sort of thing recently. I disagree with the widespread belief that one should part with shell scripts as soon as possible. Yeah, there are definitely eventually scripts where one should rewrite the work in another language, but we now just have too many people who have no idea what getopts is, too many people who think bash is available everywhere, too many people who think it's a good…
As long as Powershell dies I'm more than happy to agree that any bash script that exceeds 24 lines should probably be written in something newer.
Re: Hush, a modern shell scripting language
#64And I think I spotted a small mistake in https://hush-shell.github.io/intro/control-flow.html where it's written "May be omitted if finished is false." which should be "... is true".
Re: Hush, a modern shell scripting language
#65I've changed my mind about this sort of thing recently. I disagree with the widespread belief that one should part with shell scripts as soon as possible. Yeah, there are definitely eventually scripts where one should rewrite the work in another language, but we now just have too many people who have no idea what getopts is, too many people who think bash is available everywhere, too many people who think it's a good…
I am a greybeard, old school kinda unix guy, but at some point insisting everybody learn latin to understand the scriptures is just not going to work. As long as Powershell dies I'm more than happy to agree that any bash script that exceeds 24 lines should probably be written in something newer.
Re: Hush, a modern shell scripting language
#66Adding some advanced examples to a cookbook section will be appreciated.
Re: Hush, a modern shell scripting language
#67Note to author: the part with actual shell examples is buried too deep, I didn't think it was capable of actual shell things (seemed more like a scripting language) until I came across the 'Shell Capabilities' chapter. Seems like an obvious title but I completely glossed over it while perusing until I did a keyword search for 'redirection', and I imagine many people will too. Consider putting everything on a single p…
Re: Hush, a modern shell scripting language
#68For Lisp/Scheme fans, take a look at Rash as well https://rash-lang.org/
Re: Hush, a modern shell scripting language
#69I feel like people looking to replace shells and shell languages need to really think deep and hard about this if it's something they believe. Shell scripts are really anything but limited, and in fact most replacements are more limited (either by design or by accident), often imposing awkward control flow on you or making things that should be simple much much more complicated.
Error prone? Sure. Difficult to maintain? Yep, often. But when the thing you're doing is working with external processes and hooking them together into some kind of routine, the reason shell scripts have endured is precisely because they are extremely good at that, and provide immense amounts of flexibility and power to how you go about it in a concise way.
Re: Hush, a modern shell scripting language
#70Earlier quoted context omitted.
I think part of the problem is that we still don't have a standard /bin/sh even though there is a written standard. It feels fair to me to suggest that you can call dash the working standard on Linux, but you can't trust that beyond Linux systems(and I'm ignoring installs that are busybox-based here too). And that also feels like the problem with extending a script with a few bashisms too, as you're suddenly trying t…
Shellcheck helps a lot with this, I won't write shell without it anymore: https://www.shellcheck.net/
Side note: it's also one of (or the ?) most popular Haskell projects out there: https://github.com/koalaman/shellcheck/