4 ms·
How often do you find yourself forced to use bash? ssh/machine init scripts/etc. I could never use an alternative shell full time because I need to stay good at
by zests 6y ago
How often do you find yourself forced to use bash? ssh/machine init scripts/etc. I could never use an alternative shell full time because I need to stay good at bash.
- cytzol 6y agoI've been using fish at home and bash at work for almost a decade now, and it's been fine — and because I'm at a fish shell on my own computer far more often than I'm at a bash shell on a work server, I'm willing to take the slight productivity hit there, because I gain overall. The thing is, when I picked up fish, I couldn't forget my existing bash knowledge. I still have to write normal bash-dialect shell scripts, and with the fish syntax being so much nicer and simpler, the two can happily co-exist in my head. Occasionally I'll hit Up to search through history instead of Control-R, but I quickly realise what I've done and use the bash keybinding instead. And the only fish aliases I missed were 'l', 'll', and 'la', which I just manually copied over without bothering with the rest. If I had to use bash more often at work... I'd still use fish at home after all the time I've sunk into it, but YMMV.
- kbd 6y ago“I have to use the lowest-common-denominator thing everywhere because I have to use it somewhere“ is an argument that never made sense to me.
- ducktective 6y agoThat's pretty much my argument for choosing Bash over Python for my everyday scripts. It's sensible.
- marmaduke 6y agoSwitching between tools has a cost, so the tool needs to be not just better than another, but better after accounting for switch cost.
- zests 6y agoAnd the cost has to fit in to your budget. I'd rather spend my budget on learning emacs, for example, instead of spending it switching to a new shell.
- isignal 6y agoIt depends on your role. Many people regularly maintain or interact with prod deployments which cannot be customized to your liking. So it may be "somewhere" or occasional in your case but not in all cases. Switching back and forth between shell syntax every few hours is very disorienting and worse, can cause serious errors (for ex: if I have a local alias with rm="rm -i" but a prod server doesn't have it)
- chubot 6y agoThis is a benefit of Oil, and part of the reason for it! I don't think having a hard "fork" between POSIX/bash and another shell is desirable. So Oil is almost indistinguishable from bash at first, but you can unlock more powerful functionality with the var and proc keywords, etc. This page has the old sh and new Oil idioms, but importantly Oil runs all the old stuff! http://www.oilshell.org/release/latest/doc/idioms.html http://www.oilshell.org/release/latest/doc/idioms.html
- CyberRabbi 6y agoPOSIX compatibility would be enough to make oil a legitimate replacement shell for me but the bash compatibility makes it stand out as an alternative to take seriously. Does oil allow a gradual upgrade path to using oil semantics for stuff like “echo $dontbreak”? Are there “set” options that enable oil semantics? Sort of like “use strict” in JavaScript and perl
- chubot 6y agoYes that's exactly how it works, with shell options! http://www.oilshell.org/blog/2021/01/why-a-new-shell.html#how-can-you-design-a-good-language-on-top-of-shell http://www.oilshell.org/blog/2021/01/why-a-new-shell.html#ho... I need to document things a bit better but the idea is here: https://lobste.rs/s/ritbgc/what_glue_lanugages_do_you_use_like#c_la5m5a https://lobste.rs/s/ritbgc/what_glue_lanugages_do_you_use_li... In the case of echo, we respect -e and -n, but we also have "write -- -n" for correctness. I try not to "stomp" on existing names. --- And yes there's an analogy to Perl: http://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-unix-shell-should-evolve-like-perl-5 http://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-u...
- jerrysievert 6y agonot OP, but an avid fish user. I switch to bash about once/month: * for/while loops with a lot of logic that I don't feel would be worth translating to fish * dealing with obscure/strange other things that again wouldn't be worth the time to translate to fish ultimately, I feel that I get such benefit out of fish that the occasional switch to bash is worth the pain.
- coldtea 6y ago>I could never use an alternative shell full time because I need to stay good at bash. Getting "good at bash" is a game with diminishing returns. It's so random and non-orthogonal (bash itself, and the flags of common UNIX cli utils) as a scripting language, that you always end up having to look this or that, and with crazy corner cases you've missed.