5 ms·
Because I need the scripts and snippets I write for my repos to work for other developers, I'm going to write them to be bash compatible. That applies also to s
by liampulles 1y ago
Because I need the scripts and snippets I write for my repos to work for other developers, I'm going to write them to be bash compatible. That applies also to scripts and snippets written by others that I consume.
So if a shell is not bash syntax compatible, then it really has to offer some astonishingly useful features to offset my having to translate and map the scripts I need to run for it.
Murex does not interpret "$(cmd args)". So unfortunately, I cannot use it. I know it's not fair, and I know that is promoting a lock-in of what shells can do, but I need to get shit done I'm afraid.
- MangoToupe 1y agoI just write everything in fish and have an LLM translate it to bash. Freed up a couple brain cells for more useful things for sure.
- sholladay 1y agoNewer versions of Fish have significantly improved bash compatibility. The LLM may actually be making things harder for you than they need to be.
- kstrauser 1y agoThe single biggest win there was that it understands ‘export foo=bar’ now, which is probably 90% of what I’d ever copy and paste into a shell.
- moondev 1y agoYou should consider putting a shebang at the top of your scripts instead of leaving it to fate
- liampulles 1y agoI do this for all the scripts I write. That does cover one of the scenarios I covered above, which is valid.
- rafram 1y agoThen there’s no reason you can’t use a different shell as your interactive shell, while running your scripts in bash.
- liampulles 1y agoFor me to develop my scripts it would help alot if my interactive shell supports the syntax as well. I mean you are right of course, I CAN do that, but it then becomes a tradeoff question again of whether this non-compatible interactive shell has sufficient niceties.
- sholladay 1y agoI agree with you. Have you tried Fish? I find it to be the perfect balance of these goals. It has lots of niceties, which for me was already enough to switch to it years ago. But lately, they’ve been adding lots of bash compatibility, which has made it even more awesome.
- liampulles 1y agoI will check it out, cheers
- kstrauser 1y agoA thousand times this. I use bash scripting for things I’m going to distribute, but do all my local CLI work and scripting in fish because life’s too short to wear the bash hair shirt when I don’t have to.
- esafak 1y agobash: what you feel like doing with your head trying to get work done in it.
- rendaw 1y agoYou're not wrong, but I don't think this is either very useful feedback or an interesting comment. What you're saying applies to all core non established technologies: languages, operating systems, file formats, protocols, plugin ecosystems. If you're in a situation where that's non negotiable then obviously you're not the target audience here.