greenberet123
greenberet123

Reputation: 1477

Argument sweep in gnu parallel

I would like to run a parameter sweep of the command line argument of a command. The command is:

mycommand --fixed arg 5 --variable_arg 0

and I would like to vary variable_arg from 0-100. How can I do this in a single command using gnu parallel, which generating a separate file with all the individual commands?

Upvotes: 1

Views: 104

Answers (1)

Ole Tange
Ole Tange

Reputation: 33740

Maybe something like this:

parallel mycommand --fixed arg 5 --variable_arg {} ::: {0..100}

If you want the result in myout.1 .. myout.100 you can use one of these:

parallel --results myout.{} mycommand --fixed arg 5 --variable_arg {} ::: {0..100}
parallel mycommand --fixed arg 5 --variable_arg {} '>' myout.{} ::: {0..100}

Upvotes: 2

Related Questions