3 ms·
For completeness, to scale relative complement up to N lists you would need to repeat the last list 2^N times. So it'd look something like: rel_com() {
by nonsince 8y ago
For completeness, to scale relative complement up to N lists you would need to repeat the last list 2^N times. So it'd look something like:
rel_com() {
for i in $(seq 1 $#); do
for j in $(seq 1 $(bc <<< "2 ^ $(expr $i - 1)")); do
echo ${!i}
done
done
}
sort -m $(rel_com a b c) | uniq -c
Then you have a N-bit number with the i'th bit representing membership in the i'th file.