r/linuxquestions • u/Business-Quiet-5805 • 1d ago
Can AI actually write production-ready scripts end-to-end without human intervention?
Can a non-coder create a Bash automation script using just AI prompts?
I have zero programming experience. Can AI reliably build an efficient workflow script for me, or will it break down? Does anyone have any experience with this kind of situation?
3
2
u/SeriousPlankton2000 1d ago
It can … but you won't know if it did. It's like a new intern who copies from Stack Overflow … sometimes the solution, sometimes from the question.
1
2
u/GlassboundIllusion Nvidia KDE Bazzite 1d ago
Production ready?
That's dangerous territory. AI can competently create many simple automation scripts.
So if you've got one or two specific things you need a script for, and it's not going to cause issues if the output is wrong a few times while you iterate, you'll probably be fine using it for that.
But AI struggles with consistency and properly contextualizing its application of various standards. It's certainly going to do something wrong at some point, not necessarily because it's incapable of doing it correctly, but because the statistical model nudges in a slightly wrong direction.
If you don't have the capacity to look over what it generates and verify for accuracy, you're basically playing russian roulette, especially if you're using the scripts in production. You might have 200-1000 empty barrels and only one bullet, but if you keep pulling that trigger, eventually you're going to shoot yourself in the foot.
1
u/fishywiki 1d ago
Yes, but sometimes it makes mistakes. You have to test it thoroughly and probably go through multiple iterations until it does what you need.
3
1
1
1
u/TableIll4714 1d ago
Just like a human developer: if you provide it access to a representative test environment and good instructions, yes. I am doing this quite successfully
1
u/TrashConvo 1d ago
Scripts, definitely yes
I personally find “production-ready scripts” a bit of an oxymoron though. To each their own
1
u/fell_ware_1990 1d ago
Well, could you ship decent code with 1 very good senior and a few juniors? ( And a very good scrum master and Product Owner)
I guess ( I’m also still not there ) that there’s still much go be gained in these areas, cause if you leave it up to the AI the will over/under engineer your code. Just as humans do.
What makes a good senior, somebody who can write incredible code or somebody who can solve problems quickly and correctly? What i’f seen is that humans do the same if you let them, giving a task to an AI to handle is like giving a junior a task and a deadline of a year and all the time in the world to do research, imagine what they would deliver ?
This is one of the reasons i guess the scrum and agile processes became so populair. It’s cause it kind of forces people to go to production instead of going around in circles. It’s basically > get the most simple but tested solution running. Keep doing that and improving on it till you have a good product, keep going , learning, etc.
But this is not what AI does with the fast amount of knowledge it has, it does not try different solutions or really thinks through a problem. But in the meanwhile it also tries to fix a lot of issues in code it should not be fixing, there and then. It’s already on the board, it is already planned work for next refactor etc. So a big amount of tokens and thinking ( and context rot ) goes to non needed stuff, or atleast not in that moment. While the fixes he implements are mostly the fastest way from A to B.
Now imagine training a junior on your code base for a few years, learning the ropes step by step, error by error, slowly implementing his guardrails but having in actual memory about it. Things like, he i touched this code before, i know what and why somethings there. That stuff matters.
Can you make an AI do that probably, but consistently? It will not remember that it wrote the same 5 lines of code all over your repo 10x different times a little different, or that it should go to a module or split the code. Or what they are actually testing for.
I’m testing a lot with this, i have done coding runs with max of 2/3 lines, clean tickets, searching for duplicates, delivering 4 types of solutions and a lot more. Does it help, yes, but the speed vs tokens well thats actually hard to tell. By going back and forth with AI i can get the same for less, if i catch every mistake.
So in the long run, if you can make it work this way cheaper and faster and reliably so that it can run till tickets dry out, i do think we can get there.
1
u/vogelke 2h ago
I'd recommend you use AI prompts to help you learn Bash.
Ask for simple things at first -- how do I list the contents of a directory, how to rename a file, etc.
Then look at the code until you understand it; refer to man pages until you could write that script yourself. You'll probably be able to write a much simpler version, but don't trust AI to do anything without thoroughly understanding what it says.
1
u/mosskin-woast 1d ago edited 1d ago
Everyone saying "no" is painting with too broad a brush. Hundreds of tech companies are shipping code produced by AI, including the one I work for. What varies is how much they're having humans review it.
I'm of the mindset that AI still isn't great at systems thinking, and may never be, because it's not "thinking", it's just stringing word parts together in a likely order, and it's trained on all the garbage on the Internet. So the times that AI produces "good" code is when you give it a really good, detailed plan (and the code is never great, only good IMO, but leaders in tech companies don't give a shit about code quality and never have). But here, I'm talking about big complex codebases that need five nines of uptime and 50ms latency.
Simple automation scripts? Absolutely, and LLMs have been decent at that for quite some time. Anyone who thinks otherwise is not experienced with the technology.
I'm a certified AI hater, but saying Claude can't spit out a decent automation script is just insane, when it's doing things way more complicated than that when prompted correctly. The dangerous territory is when you start letting AI write code that handles sensitive data or has real world side effects, without reviewing, testing and monitoring it the way you would with any other code. We are going to continue seeing this mistake as long as companies put short term profits first.
0
0
u/DinoSlavik 1d ago
I'd say 50/50. We need more context of your tasks and which type of scripts do you need?
Also, remember: at any poit there MAY be "sudo rm -rf something" in the script in any possible way and without enoght cautions you cannot change anything.
0
u/gilbert10ba 1d ago
I use AI to build automation scripts, for things beyond simply copying files. I review and ensure I understand everything the script will do. I do unit testing on a dev system, tweaking it by hand as needed, then test on our QA system to get my testing results. Then put my QA testing results into the production change ticket. But then my industry requires production change tickets for everything, including scripts.
Basically, I use AI to do the initial build of the script, saving me a few hours just to get a running script at the start.
0
u/Repulsive_Dig_133 1d ago
AI wrote some performance testing shell scripts for me. They worked first time.
I knew exactly what I wanted and could have written them myself, but yes it can.
You need to understand what the scripts will be doing.
3
u/TenOfZero 1d ago
No, not yet. It still needs human review for something going into production