2 ms·
I’m going to say something … and it might trigger folks Learning and getting good at shell scripting is something that takes a while usually. I would recommend
by happyPersonR 6d ago
I’m going to say something … and it might trigger folks
Learning and getting good at shell scripting is something that takes a while usually. I would recommend that people new at shell scripting actually try to use Python instead writing shell scripts where possible.
I’ve seen people not use traps, not know when to use set properly, xargs if you don’t know what you’re doing with it is just a giant foot cannon, and folks new at shell scripting don’t know how to debug running shell processes.
They may have learned some or all of these things for python?(please? )
- johnisgood 6d agoBut you gotta learn about processes, signals, job control, traps, exit statuses, pipelines, file descriptors and all those things though. Shell is still a great glue language that helps with that. Learning Python does not really replace knowing how the shell and Unix process model work. It could, but try translating some very short shell commands into Python and see how much more machinery you need! My 2 cents. :)
- marcosdumay 6d ago> They may have learned some or all of these things for python?(please? ) On other languages those things are either obvious because you have to write the behavior yourself, or fail loudly in a way that requires you to learn them before your code will run. You don't have to hope. The same people that fall to the foot-guns in sh don't make the same mistakes when they write it in python.
- ElevenLathe 5d agoThe more I learn about shell, the less I reach for it for automation scripts, even ones that mainly exist just to shell out to other binaries. I have written a lot of shell in my life, and it turns out (with 20/20 hindsight) that almost all of it was atrociously dangerous and brittle because there are so many ways to screw it up and I didn't know most of them at the time (and still probably don't!).