|
|
|
|
|
by jacknagel
5396 days ago
|
|
Just for kicks, here's a (terribly ugly) pipeline that will display the contents of .nls and `ls`, with duplicates removed: ls | cat .nls - | column -t -s: | sort -r | perl -ane 'print unless $x{$F[0]}++' and then obviously just echo "dirname: description" >> .nls to append to the file. I would be interested in seeing a better pipeline, one that doesn't need perl/awk/ruby/what have you to remove the duplicates correctly. |
|
join -a2 -t: <(sort .nls) <(ls | sort)
(I think this is different from your pipeline, in that your pipeline will print files in .nls that aren't actually in the directory.)