5 ms·
If you're interested, I've written a tool called `loop` which sacrifices some of the abilities of GNU Parallel for a far more intuitive interface (I think so,
by Mizza 7y ago
If you're interested, I've written a tool called `loop` which sacrifices some of the abilities of GNU Parallel for a far more intuitive interface (I think so, anyway.)
You can check it out here:
https://github.com/Miserlou/Loop https://github.com/Miserlou/Loop
- dahart 7y ago> sacrifices some of the abilities of GNU Parallel Like... the ability to run things in parallel? Loop looks nice, don’t get me wrong. I think I’ll try it! It just seems like comparing it to Parallel is misplaced here, and a bad idea in general, since they’re not remotely related. Ole is comparing all these utilities to Parallel to show how general Parallel can be, and suggest you only need his one program and one syntax to emulate hundreds of different utilities: his argument is implicitly that people should use Parallel and not loop.
- Mizza 7y agoYeah, but that syntax is: $ yes | parallel -N0 -j1 echo touch '{= $_=seq()*5 =}'.txt vs $ loop --count-by 5 -- touch $COUNT.txt UNIX is about using the right tool for the right job, not the same tool for every job. Let us remember the koan: A Unix novice came to Master Foo and said: “I am confused. Is it not the Unix way that every program should concentrate on one thing and do it well?” Master Foo nodded. The novice continued: “Isn't it also the Unix way that the wheel should not be reinvented?” Master Foo nodded again. “Why, then, are there several tools with similar capabilities in text processing: sed, awk and Perl? With which one can I best practice the Unix way?” Master Foo asked the novice: “If you have a text file, what tool would you use to produce a copy with a few words in it replaced by strings of your choosing?” The novice frowned and said: “Perl's regexps would be excessive for so simple a task. I do not know awk, and I have been writing sed scripts in the last few weeks. As I have some experience with sed, at the moment I would prefer it. But if the job only needed to be done once rather than repeatedly, a text editor would suffice.” Master Foo nodded and replied: “When you are hungry, eat; when you are thirsty, drink; when you are tired, sleep.” Upon hearing this, the novice was enlightened.
- asdfasgasdgasdg 7y agoI feel you, but at the same time, this discussion is about GNU Parallel. A tool that does not execute things in parallel is an irrelevancy in this context.
- rmetzler 7y agoThe name loop implies it runs the jobs sequentially, while the main feature of GNU parallel is to run the jobs in parallel. Maybe this is also possible with loop, but I don't see that option.
- mechanical_jane 7y agoI think your example is wrong: $ seq 0 5 100000 | parallel touch {}.txt Or you you really want the infinite loop: $ yes | parallel touch '{= $_=seq()*5 =}'.txt '$' must be quoted $ loop --count-by 5 -- touch '$'COUNT.txt
- degraafc 7y agoLooks more like a souped up `watch` [1] than `parallel` to me. Nice tool! [1]: https://en.wikipedia.org/wiki/Watch_(Unix) https://en.wikipedia.org/wiki/Watch_(Unix)
- mechanical_jane 7y agoComparison to GNU Parallel's syntax: https://www.gnu.org/software/parallel/parallel_alternatives.html#DIFFERENCES-BETWEEN-loop-AND-GNU-Parallel https://www.gnu.org/software/parallel/parallel_alternatives....