4 ms·
> In my 25 years of writing shell scripts, they've nearly always been for automation on a specific OS where portability is not a concern. I've written hundreds
by doctorpangloss 3y ago
> In my 25 years of writing shell scripts, they've nearly always been for automation on a specific OS where portability is not a concern.
I've written hundreds of scripts for Busybox for Windows (https://github.com/rmyorston/busybox-w32 https://github.com/rmyorston/busybox-w32), Linux bash and macOS zsh. POSIX compatibility means a lot.
WRT the specific concerns of arguments: if you are doing something complicated, use Python. ChatGPT writes it better anyway.
In my experience, more complex scripting is reinventing Gradle, Ansible, Terraform, YAML & similar.
- js2 3y agoI write a lot of Python too. I've written whole systems in it. Been using it since 1.5.2 days. And before that Perl. I know my way pretty well around sed and awk too and pretty much the entire Unix environment. These are all just tools. They each have their strengths and weaknesses. There are times when shell is the best tool for the job and when it is, I prefer to use bash. If I have to write POSIX shell because it's a constrained environment, sure, I can do it. It's just been something that's rarely been a requirement.
- coldtea 3y ago>if you are doing something complicated, use Python. ChatGPT writes it better anyway. Amusing that this is even a factor
- lelanthran 3y ago> WRT the specific concerns of arguments: if you are doing something complicated, use Python. Introducing Python syntax for this reason alone is way over-engineering your script. Yeah, if you're doing something that requires better data structures[1] then don't use the shell, but switching to Python just to call existing programs makes things more complicated, not less. [1] Arrays, Trees, Dictionaries, etc