4 ms·
I believe that your complexity estimate in writing the wrapper indicates you are perhaps not a proficient shell scripter. However I sincerely believe it is poss
by mrb 14y ago
I believe that your complexity estimate in writing the wrapper indicates you are perhaps not a proficient shell scripter. However I sincerely believe it is possible to write such a wrapper in less than 15-20 lines. The trick is to do as little argument parsing as possible but enough to be safe (for example pass the ! -name "*.min.js" as is to find).
PS: I will do it in 15-20 lines, if only to prove a point, if someone sends 1 BTC to 1F43fceWvwznv4rH7s1B3du2w5VznFJY58 :) (yes, my time is valuable - I have other things to do)
- SomeCallMeTim 14y agoNo interest in seeing a proof of concept. And I make no claims about being a "proficient" shell scripter: You've nailed me there. I can write a shell script if I absolutely have to, but I avoid it when possible since Bash is such a terrible "language." When I DO see non-trivial shell scripts, they are just this side of arcane gibberish. The command lines above are completely opaque to anyone but an expert in EACH of those tools (I know some of the tools, but not all well enough to know EXACTLY when I need to backslash a paren, or how many backslashes to use, or when I need quotes or not...). When I see the JavaScript that spawned this conversation, despite not knowing JavaScript well at all (probably about the same level I "know" shell scripting) I was able to follow everything that was happening to the point where tweaking it to add features would have been easy. The objective shouldn't be to write code in the fewest possible symbols. Everyone would use APL (or a more recent evolution of that language) if that were the case. The fewest possible readable and modifiable lines of code is my objective. Shell scripting tends to have lots of obscure and unpleasant syntax to accomplish the most basic flow control.