I want to copy directories from one variable to directories from another one but without loop.
from="fromdir1 fromdir2"
to="todir1 todir2"
I mean fromdir1
to todir1
, fromdir2
to todir2
.
I think it can be done with xargs
but I don't know how.
from
to each directory into
, or do you just want to copy the first entry offrom
to the first entry ofto
, the second entry offrom
to the second entry ofto
and so on? – Marcus Müller Jun 21 '23 at 08:14fromdir1
totodir1
andfromdir2
totodir2
– trilisser Jun 21 '23 at 08:20xargs
doesn't do what you say you think it does, so the answer you've already gotten is the best you can get. – Marcus Müller Jun 21 '23 at 09:04parallel
solution below is appropriate – trilisser Jun 22 '23 at 07:43