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

Convert Windows or DOS Encoded Files to Unix/Linux. (ANSI to UTF-8)

Windows files and Unix files (Redhat, Ubuntu, etc) are encoded in different…

Microsoft Office 2007 New Formats and your Apache server

If you upload those new fancy-shmancy file formats to your web server…

Installing VirtualBox on a PAE Kernel System

I recently got stuck while trying to install Headless Virtualbox on a…

Ubuntu Server in Place Network Upgrade From 8.10 to 9.04

It is easy to do an in-place upgrade of Ubuntu Server from…