Found a great post over at good coders code, great reuse. This one deals with performing operations on sets using only unix (bash) command line operations on files of text.

* Set Membership. Test if an element belongs to a set.
* Set Equality. Test if two sets contain the same elements.
* Set Cardinality. Return the number of elements in the set.
* Subset Test. Test if a given set is a subset of another set.
* Set Union. Find union of two sets.
* Set Intersection. Find intersection of two sets.
* Set Complement. Given two sets A and B, find all elements in A that are not in B.
* Set Symmetric Difference. Find symmetric difference of two sets.
* Power Set. Generate all subsets of a set.
* Set Cartesian Product. Find A x B.
* Disjoint Set Test. Test if two sets are disjoint.
* Empty Set Test. Test if a given set is empty.
* Minimum. Find the smallest element of a set.
* Maximum. Find the largest element of a set.

It deals with such commands as sed, awk, tr, sort, comm, grep and wc. This is a good post for anyone dealing with data via command line linux.

Full article here.

2 comments
  1. Pingback: Dave Drager

Comments are closed.

You May Also Like

Clearing spamassassin BAYES filter tokens

I recently had a problem where my Spamassassin install started thinking that…

Command Line Packet Sniff Existing Running Process in Linux

Have you ever come across a server that is doing a lot…

How to Turn PHP into an RPM The Easy Way with FPM

So you have a custom PHP binary that you wish to distribute…

Using rsync on an Alternate SSH Port or with OpenSSH Keys

Best practices state that you should run ssh on an non-standard port.…