| ▲ | zaptheimpaler 6 hours ago |
| life is way too short to deal with this nightmare of a language and its 50000 footguns for anything longer than a 2 line script, especially in the age of LLMs. Just write a python/TS/any real language script instead. Bash is great for the command line, it should be limited to use there. |
|
| ▲ | jghn 6 hours ago | parent | next [-] |
| It turns out that LLMs are really good at writing bash too. even perl! maybe we should rethink some of these lost bits because we no longer need to worry about the arcane parts. |
| |
| ▲ | garethrowlands 14 minutes ago | parent | next [-] | | I have some absolutely amazing bash scripts that I would never have contemplated making myself in bash. And they'd only have been somewhat better in python. Claude for the win! | |
| ▲ | AlecSchueler 6 hours ago | parent | prev | next [-] | | Define "really good?" I don't think I've ever had them produce a script that I didn't need to correct in some way. They can write it, that's true, but we still need to be able to read it. | | |
| ▲ | jghn 6 hours ago | parent [-] | | Fair. I'm comparing it to the output I see generated in more mainstream, day to day, languages. I'm not going to bother to get into an argument on if the frontier models can generate amazing code in general. What I've found is I can get get the frontier models to generate bash scripts, perl one liners, etc that do exactly what I need at roughly the same quality as any other code it generates. | | |
| ▲ | AlecSchueler 5 hours ago | parent | next [-] | | 100% They're super useful and I often use them to generate bash scripts of, but that's exactly how I know how important it is to check their work! I'm a shell scripter at heart, the arcane stuff has always been a delight for me, so I've driven them to do some pretty complex stuff where previously I would have "copped out" and used python. I'd say the general adage of them being at the level of a very talent junior holds true. | | |
| ▲ | Arshad-Talpur 5 hours ago | parent [-] | | I agree with you, instead of working on creating a bash script if we just sit as a senior developer ,check and correct what is needed is the way forward, it kind a remind me Pair programming when one do the scripting and other corrects it |
| |
| ▲ | nullsanity 5 hours ago | parent | prev [-] | | [dead] |
|
| |
| ▲ | nomel 5 hours ago | parent | prev | next [-] | | Bash scripts requires "set -eu" at minimum, when written by LLM or human. It's the only language terrible enough to make the default behavior ignore undefined variables, commands, and execution errors, and happily continue executing whatever was produced by me smashing my hands on the keyboard, until the end of the file, while returning an exit code of 0, claiming complete success. | | |
| ▲ | shric 4 hours ago | parent | next [-] | | “Only language” eh? I only have a passing familiarity or very distant memory so could be wrong but I’d say these are the same: Perl (needs use strict) Ancient VB/VBA/VB script Original PHP (no idea about modern) PowerShell Old Windows/DOS batch | | | |
| ▲ | _bernd 3 hours ago | parent | prev [-] | | > Bash scripts requires "set -eu" at minimum, when written by LLM or human. No. It does not.
Just write good scripts and catch errors and handle them. That's the same more less with every language.
And bash can be written in a way that it is sane and readable and maintainable. Just because you have seen a lot of junk in the language does not make the language bad per se. Sure there are a lot of languages "features" which are more then questionable but I want to rise again the point that it has its place and can be used in a good way. | | |
| |
| ▲ | Gigachad 4 hours ago | parent | prev [-] | | I have seen them write massively more complex bash scripts than any normal person would ever attempt, but the failure rate is absurdly high compared to when they write sane typed languages. |
|
|
| ▲ | genidoi 5 hours ago | parent | prev | next [-] |
| I find LLM's too fall into the trap of writing a bash script for a task that clearly needs to be implemented in an Actual Language with Real Data Structures. For example, ask an LLM to bring up a SQL server with some schema + data preload step, and it will write a profoundly long bash script to do that task, every time. |
| |
| ▲ | csydas 4 hours ago | parent | next [-] | | my experience as well. claude produces functional but over-engineered scripts fairly frequently with often very questionably useful safety checks, especially for powershell. a common tell of ai generated powershell is a script that has dedicated functions to check types, often via several methods, and happily prints the output of the checks to shell. i do not get why it does this but it often adds dozens of lines that really serve no purpose but to make the shell output look fancy | | |
| ▲ | garethrowlands 3 minutes ago | parent | next [-] | | $ Hey, claude, I've figured out the powershell one-liner we need and I've pasted it below. Please insert it into the application. ... I have analysed your idiomatic one-liner and propose adding the following 30 lines into the application Yes/Yes and always accept such idiocy/No ESCAPE ESCAPE /clear I want to update my powershell skill so that it writes idiomatic pipelines and does not introduce idioms from other languages. [PASTES overeagerness wording from Claude prompting best practices] | |
| ▲ | genidoi 3 hours ago | parent | prev [-] | | It's frustrating when I catch it doing this because it's wasting tokens and time on what it reports as "one-off" scripts. Might add a requirement to never use shell scripting unless the task is truly a one liner. |
| |
| ▲ | Grimburger 4 hours ago | parent | prev | next [-] | | Try being on linux and using zsh, it constantly fucks up scripts. Having it run commands via SSH into a windows machine is even more a comedy of errors. I have to put in every claude.md that the shell is zsh. It's reached the point of annoyance I might just go back to bash. | | |
| ▲ | kergonath 3 hours ago | parent | next [-] | | > It's reached the point of annoyance I might just go back to bash. You can use zsh as the default shell and still write your scripts for bash. Actually, it’s an advice I saw more than a couple of times. Otherwise you need to translate the bash-isms when you get bits of code from random places on the Internet. Just put the right shebang (or ask Claude to do it). What’s the problem? | |
| ▲ | delta_p_delta_x 3 hours ago | parent | prev | next [-] | | I find that Claude does this much more than other models. GPT, for instance, knows I'm on Windows running PowerShell, and writes very idiomatic PowerShell. But maybe that's because I'm the sucker, and since PowerShell is more verbose it costs me more tokens than the terseness of Unix shells. Oh well. | |
| ▲ | srcoder 3 hours ago | parent | prev [-] | | Just run your llm in a container with the tools it needs. It makes your pc more secure by removing the risk of doing something destructive to your computer and the llm can do llm. Also, llms ssh'ing to the outside world? Asking for trouble later on |
| |
| ▲ | IshKebab 5 hours ago | parent | prev [-] | | I think they've learnt from decades of humans using Bash for tasks that clearly need to be implemented in an Actual Language. The knowledge that Bash is awful and should be avoided as much as possible is surprisingly and disappointingly rare. |
|
|
| ▲ | cozzyd 5 hours ago | parent | prev | next [-] |
| Python startup time is a problem. I don't know about ts but I bet it's worse. |
|
| ▲ | amelius an hour ago | parent | prev | next [-] |
| > 50000 footguns (...) > especially in the age of LLMs Funny way of putting it. But I think you are right still :) |
|
| ▲ | flexagoon 6 hours ago | parent | prev [-] |
| Just use Fish |
| |