3 ms·
I fully agree that Bash is trash. It's useful, but every control structure is convoluted crap. That said, there are probably hundred of alternatives. Csh is the
by jonathankoren 3y ago
I fully agree that Bash is trash. It's useful, but every control structure is convoluted crap. That said, there are probably hundred of alternatives. Csh is the most obvious. Why people continue to use sh, I'm not sure beyond historical reasons. Sure it's shipped, but csh is often shipped as well.
- shortrounddev2 3y agothere's also nushell and powershell, which i think are an evolution over the shells which only pipe streams of bytes to programs
- jonathankoren 3y agoPowershell is supposed to be good, but I’ve always been confused how it sends objects between programs. Seems like every program would have be modifed to support whatever rich IPC it uses. Unix’s philosophy that everything is a file, and everything is stream of bytes is Good™. Dumb pipes and smart ends are future proof. The smarter the pipe, the more likely you’re going to run into things just not being possible.
- shortrounddev2 3y ago> Dumb pipes and smart ends are future proof Shell scripts should not live long enough to require being future proof. If you need to rely long term on some code, write it in an actual programming language
- jonathankoren 3y agoThe PROGRAMS. Who wants to rewrite everything because you can no longer pipe or redirect?
- shortrounddev2 3y agoYou can still pipe
- jonathankoren 3y agoNo shit. I don’t think you understand what I’m talking about. Powershell isn’t just a shell with some rudimentary flow control, like every Unix shell since thr 1960s. Powershell can hook together apps with a rich IPC objects, not just the old stream of bytes that kicked off this thread. In fact, I specifically mentioned its rich IPC as its nifty feature, and a feature that I did not understand how it worked, especially since it works in a backwards compatible fashion. THAT’S the thing that moves it beyond a stream of random bytes, to something with semantics. Maybe you didn’t know that, but it does. In fact, when it came out that was its marquee feature. That’s why I’m talking about IPC, and and the fucking programs. No one give a shit about a janky ass .sh file. It’s the thing that go in it. If the programs being connected together don’t understand the rich IPC channel, you’re stuck in the 1960s, like every other shell and scripting language, and so Powershell’s benefits are nonexistent. This thread went from interesting to absolutely infuriating because you keep smuggly chiming in about things you apparently don’t understand.
- shortrounddev2 3y agoTry working on your communication/interpersonal skills, man. You're not a good communicator because I had no idea what you were trying to say until this post. You also shouldn't get upset by discussions of shells on the internet. You probably should take some time away from the computer. This statement: > The PROGRAMS. Who wants to rewrite everything because you can no longer pipe or redirect? Is almost unintelligible, aside from the fact that I guess it qualifies as a nearly-correct statement in English
- majkinetor 3y ago> and so Powershell’s benefits are nonexistent A world where every program talks via the same IPC is utopia. Claiming that pwsh benefits are nonexistent because of that, is absurd. Besides, there are ways to mitigate this problem. As an example, many tools now accept and return json output, which means they can be easily hooked to pwsh via ConvertTo/From-Json without any parsing whatsoever.
- majkinetor 3y agoWhere did you get this from? Who told you that shell scripts must have a lifetime and can't be crucial for production? There is no such a thing as serious programming vs baby shell programming. There are just tools, that are means to an end, simple as that. If the tool sufficiently and efficiently does the job, there is no need to replace it with an 'actual' programming language.
- nerdponx 3y agoI use Bash because it's ubiquitous, it works well enough (even if it has several flaws), and because a lot of other people know how to use it. Find me another language that meets the same criteria while retaining the core syntax for executingprograms, redirection, and pipes, and I'll switch to it. Csh and Tcsh might be improvements, but I don't know how to use them and none of my coworkers do either. Powershell is an option at my particular company, but it has a handful of other problems (some of which are gradually being fixed in newer versions) and it's not "portable" to other organizations. And I personally use Zsh, which I think is an improvement over Bash, but again, none of my coworkers know how to use it, even though it's the default of everyone's Mac. People have similar complaints about SQL. It's kind of bad, but nothing has replaced it because it's just too hard to accumulate the critical mass of adoption for any one replacement.