"No problems", I said, "a 5 line Perl script and you're done". But later it occurred to me - why 5 lines ? This will do the job:
So, how about making it even shorter ?cat file1 file2 | perl -ne 'print if !(defined($foo{$_})); $foo{$_} = +1;' > out_file
Note: my version is ungolfed for clarity
Note2: golf only the Perl code between 's, not the shell wrapper
In reply to (Golf) unique by spurperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |