If the values ββare unique:
parallel echo {= 'if($arg[1] eq $arg[2]) { skip() }' =} ::: ABCD ::: ABCD
Or more generally:
parallel echo \ '{= my %seen; for my $a (@arg) { $seen{$a}++ and skip() } =}' \ ::: ABCD ::: ABCD ::: ABCD
If you want to treat AB as BA , then this is only one of the following combinations:
parallel echo \ '{= for my $t (2..$#arg) { if($arg[$t-1] ge $arg[$t]) { skip() } } =}' \ ::: ABCD ::: ABCD ::: ABCD
If you use these a lot, remember that you can use --rpl to create your own replacement strings by putting this in ~ / .parallel / config
And then run:
parallel echo {unique} ::: ABCD ::: ABCD ::: ABCD parallel echo {choose_k} ::: ABCD ::: ABCD ::: ABCD
source share