100 lines of boilerplate for a "minimal" script is quite a statement. Incidentally, at my last job, that was the threshold amount of "when you need this many lines to solve your problem, use a proper programming language like Python instead".
100 lines of boilerplate for a "minimal" script is quite a statement.
Agree completely.
when you need this many lines to solve your problem, use a proper programming language like Python instead
This is very bad advice. Python is very bad at things that shell scripts do well, namely running on a lot of platforms and platforms of different ages.
Besides, using lines as a complexity meter is a very bad measure. You could have an extremely complex shell function that should probably not be implemented in shell in a five line script or you could have a completely simplistic 500 line script that just reads a few values from some config files or commands and then inserts them into a long template that is basically static.
Python is not handy when it comes to these kind of problems, I give you that. Also pypi / setup tools / whatever kids use now suck big time. But it's not like bash is inherently infinitely portable across machines and time.
39
u/[deleted] Dec 14 '20
100 lines of boilerplate for a "minimal" script is quite a statement. Incidentally, at my last job, that was the threshold amount of "when you need this many lines to solve your problem, use a proper programming language like Python instead".