alias duplicate {
var %a = $1,%b = $2,%c,%d,%e
while ($regsub(%b,([^ ]+),,%b)) {
%e = $regml(1)
if ($regsub(%a,$+((^| )\Q,$replacecs(%e,\E,\E\\E\Q),\E(?= |$)),,%a)) %c = %c %e
else %d = %d %e
}
%d = %d %a
; Commands here with %c and %d
return %c $cr %d
}