Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Elegant intersection()



To print out lines that are common to 2 files, we can define a function to find the intersection of the lines:

    function intersection {sort <(sort -u "$1") <(sort -u "$2") | uniq -d}

To do it for 3 files:

    function intersection {sort <(sort -u "$1") <(sort -u "$2") <(sort -u "$3") | uniq -d}


Is there an elegant way to generalize this for "$@" in zsh?

Thanks.
--
Gerald


Messages sorted by: Reverse Date, Date, Thread, Author