3 ms·
to be fair, you could have achieved all that with a simple python script. sometimes i feel python is the new bash.
by sebastianavina 12y ago
to be fair, you could have achieved all that with a simple python script. sometimes i feel python is the new bash.
- coldpie 12y agoYeah. This is a great article. While I was reading it, I was thinking about what I would have done, and my answer was Python. Bash is just too easy to do wrong (see the recent Steam rm -rf bug), and I don't code in it often enough to know the pitfalls by heart. I'd be interested to see another article about doing this job in Python and how its performance compares to this simple one-liner.
- falcor84 12y agoPython is a great tool for this, and is even better when used with the pythonpy tool, which allows for convenient integration of python commands inside unix pipelines - https://github.com/Russell91/pythonpy https://github.com/Russell91/pythonpy
- tokenrove 12y agoNote that you lose some of the parallelism you get effortlessly from the Unix pipeline if you do it as a single (simple) Python script.
- dynode 12y agoI use the multiprocessing module in python all the time for quick parallelism <https://medium.com/@thechriskiehl/parallelism-in-one-line-40e9b2b36148> https://medium.com/@thechriskiehl/parallelism-in-one-line-40... Let's you easily map to multiple cores. I use it a lot for image processing tasks. Quickly crawl through directories to find all the files, then spin up all the cores on my machine to crunch through them. Wish there was an easy way to enlist multiple machines.