5 ms·
Sure, if this were intended for doing it from within a JS program. But it's not. It's a command-line tool. To replace the best, most powerful, most flexible, m
by peterwwillis 14y ago
Sure, if this were intended for doing it from within a JS program.
But it's not. It's a command-line tool. To replace the best, most powerful, most flexible, most stable tool (and additional tools) made for the command-line for this exact purpose. This is the definition of reinventing a square wheel. It's just a bad idea.
(p.s. by using xargs (with or without -print0) you can use one option to parallelize the function, vs writing it all in your own code. but i guess getting mad over a fork/exec call is a better idea)
- chris_wot 14y agoI'm not going to downvote you, but you've not really put your case. Using replace simplifies the workload for a lot of people, the commands (which incidentally, I actually like using) is still somewhat arcane even to the most experienced Unix guru. If you can replace a long line of pipes with a simple command line, then why not?
- peterwwillis 14y agoPerl was created as a replacement for sed, awk, grep, and other tools of the day. It can be used as one command to perform anything you could ever want to do, with a minimal amount of typing and several command-line arguments to perform useful tasks with ease. When admins use it, they often simply shell out to the identical console tools. Why? It's easier. They just do everything you need, they're universal, and they work well together. Go ahead and write a new Perl in JS, and nothing will change; the console tools will still be there, better than anything else. I agree that it simplifies the workload. Unfortunately, it does not reduce the workload.