4 ms·
> You're the one who offered up that code as an example in the first place, to prove your point about bash being really great for people who don't want to bothe
by nickjj 8y ago
> You're the one who offered up that code as an example in the first place, to prove your point about bash being really great for people who don't want to bother reading documentation.
I posted a link to it next to the sentence that talked about the types of tools I use it for, such as things on my dev box to help me in my day to day.
> Have you ever written any 10k+ line bash scripts? No, because it doesn't scale (and machine generated configure scripts don't count)
I've written a bunch of 1k+ line scripts. They aren't a problem to maintain and a number of them are being actively used and maintained by other people. These are for real production systems too. Some are single files, others are broken up into multiple files.
I haven't personally written a 10k+ line script (the need for that has never happened), but I've seen a number of multiple thousand line scripts out in the wild that are very well maintained and are part of mission critical systems like setting up a PKI realm for a bunch of servers. That PKI script was something like 4,800 total lines of code but it being 10k+ wouldn't have made a difference for the worse.
Shellcheck helps a lot with writing pretty well formed shell scripts. It's a really good linter.
- DonHopkins 8y agoI just wanted to be clear that I'm not just making this stuff up, and you really did write what I quoted (claiming to have written 10k+ lines of shell scripts, that you only really looked at the docs a couple of times, and that bash syntax is humanly impossible to remember), but you ninja-edited it out later, after I quoted what you originally wrote: >I've written literally thousands of lines of shell scripts (maybe even 10k+) across dozens of scripts over the years and I've only really looked at the docs a couple of times. Of course I'm Googling various syntax things that are humanly impossible to remember, but I never once really sat there and combed through all of the docs or even read a book on Bash. Only really looking at the docs a couple times isn't something to brag about, and doing that doesn't make bash good. Nor is it good for languages to be designed so you don't have to read the manual (or else you get COBOL or HyperTalk, and then you still have to read the manual). Nor is it good for languages to have syntax things that are humanly impossible to remember. All those claims you deleted actually support my point about bash being terribly inferior to Python (whose syntax is extremely simple and easy to learn and remember and most importantly read, and it even has built-in interactive "help" documentation), which is why I quoted what you originally said in the first place. Again, what is it about that script you offered as an example that is easier, more elegant, or more maintainable and understandable to do in bash than in Python? If you don't have an answer to that, can you show me any other bash code that was better off written in bash than in Python? And explain how it's better, please.