4 ms·
If it’s just a few lines or some one-off thing, I understand the use of bash. I start to get the feeling that if you feel the need for shell scripts, it might
by louwrentius 6y ago
If it’s just a few lines or some one-off thing, I understand the use of bash.
I start to get the feeling that if you feel the need for shell scripts, it might be wise to pause and wonder of this is really the right approach long-term. Especially if you feel the need to put it in git or something.
My experience is that there are often I need to put in some checks for safety and before I know it, you create a mess of grep awk cut sed and you wish you started out with python.
Are you really that much in a hurry or do you have the time to calmly spend a little bit more time to ‘do it right?’
- jschwartzi 6y agoOr you literally just need to run a sequence of commands to create some stuff in the filesystem without doing any text processing whatsoever, which is my use case for the three or four large-ish BASH scripts I've written professionally. Make was totally inappropriate in that case because I would have had to enumerate a lot of intermediate files and would have wound up with a parallelizable series of mini-scripts that would need to run serially to work correctly. And Python would ultimately turn into a DSL that looks almost exactly like BASH because the problem domain is "run a bunch of commands in sequence" which is what BASH is designed to do.
- louwrentius 6y agoYes, I think this is exactly the right kind of reason to use bash.