Noob_Number_1
Noob_Number_1

Reputation: 755

How to execute one command in multiples directories using "GNU parallel"?

Every day I have to update a bunch of repositories and also execute in some of them another command (from CARTON, Perl module dependency manager). I use always a loop to do that but I want do it parallely with GNU parallel if it is possible but I don't understand so well its tutorial.

The point more similar I've read that can help me is called "Running the same commands on all hosts" so I got into the directory with all repos and I tried to execute: parallel --onall carton but I don't know if it works or not. Anyone can help me?

Upvotes: 6

Views: 1790

Answers (1)

Ole Tange
Ole Tange

Reputation: 33685

parallel 'cd {} && git pull' ::: *
parallel 'cd {} && carbon' ::: *

Upvotes: 8

Related Questions