Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
Re: [opensuse] Quick question: how to call a script function from "find"?
On 2017-06-14 08:12, Vojtěch Zeisek wrote:
Dne úterý 13. června 2017 23:38:24 CEST, Carlos E. R. napsal(a):


find /home/cer/Fusion/Videos/ -type d | parallel "sudo... && chmod...
&&..." This is my favorite style. :-)

I have to investigate that parallel command, but in this case I need the
commands to be sequential.

Sequential? Why do You need to process the files one-by-one? Construction
parallel "sudo chown cer:cer '{}' && chmod u+r+w+x,g+w+x,o+r-w-x,+t '{}' &&
sudo chown cer-g:cer '{}' && ..."
is of course sequential (because of '&&'). Or am I missing some point?


Eum...

I mean I have to do on each file the three commands in that sequence (it
is done as user 'cer'). The chmod command will fail unless the directory
is owned by 'cer'.

Yes, of course all files can be done all at once, but that is i/o bound,
not cpu bound, I think.

But then I understood wrongly what parallel does. What it does is fire
several different threads, one per found file (directory in this case).
Up to... how many, as many as CPUs available?

--
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)

< Previous Next >
Follow Ups