Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to be able to provide a list of arbitrary/different commands (varying binary/executable and arguments) and have xargs run those commands in parallel (xargs -P).

I can use xargs -P fine when only varying arguments. It's when I want to vary the executable and arguments that I'm having difficulty.

Example: command-list.txt

% cat command-list.txt

binary_1 arg_A arg_B arg_C

binary_2 arg_D arg_E

% xargs -a command-list.txt -P 4 -L 1

I know the above command will only echo my command-list.txt

I am aware of GNU parallel but can only use xargs for now.

Solution is probably staring me in the face. Thanks in advance!

share|improve this question
1  
Instead of using xargs use sed (or awk or perl or python or ...) to change the newlines in command-list.txt into &s. Then source command-list.txt so you are running binary_1 arg_A arg_B arg_C & binary_2 arg_D arg_E. –  Wandering Logic Jun 5 '13 at 12:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.