I want to run a task where I specify two commands which will be run in an alternating fashion with different parameters. E.g:
1. exec --foo $inputfile1 $inputfile.outfile1
2. exec --bar $inputfile2 $inputfile.outfile2
3. exec --foo $inputfile3 $inputfile.outfile3
4. exec --bar $inputfile4 $inputfile.outfile4
I could probably get away with specyfing two parallel commands or with specyfying two inputs but I need something more universal. The files will be specified using pipelined "find" command.
EDIT: My command for one action would look like this:
find . -name 'somefiles*' -print0 | parallel -0 -j10 --verbose 'exec --foo {} {.}.outfile'
I just do not know how to do this in alternate fashion between two commands
So basically what I need parallel -j10 to do is to run 5 of this commands with foo parameter and 5 of them with bar parameter on a single set of files. I could probably get away with it not being alternating but i want parallel to take care about it being exactly 5/5 split so I don't end with more foos or more bars