7 ms·
Working with large amounts of files or analyzing the content of large files. Not only will you be faster in glueing commands together with pipes but tools like
by aeyes 6y ago
Working with large amounts of files or analyzing the content of large files. Not only will you be faster in glueing commands together with pipes but tools like find, grep, sed, awk, cut and so on will also perform much much better than interpreted languages.
Also, I'd never prefer using the stdlib of Python/Ruby/etc for system commands like cp/chmod etc. It takes way more boilerplate code than a oneliner.
- tomjakubowski 6y agoYou can without too much work build a Python DSL which makes stuff like executing those oneliners as easy as x("cp", "foo", "bar"). And then you never have to worry about quoting command arguments again.
- ritchiea 6y agoCertainly not impossible but I don’t often have to deal with large amounts of files in circumstances where the performance hit matters to anyone. And while I know sed, awk, etc are powerful, I don’t know them & I’d have to learn how to use them, whereas I do know Ruby & Python. At the very best this is an edge case where one would have reason to choose shell scripts over scripting languages.