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

Prompt to confirm copy even with cp -f?

Wow – I get so frustrated when I try to copy some…

Tweaking TCP for Fast (100mbps+) Connections and Transfers on Linux

We recently did some speed testing on a few of the servers on our network, and we were not receiving the speeds expected considering they were sitting on a physical 100mbps ethernet port. The servers were indeed on physical 100mbps connection, however wget (TCP/IP, HTTP Port 80) download tests showed only a max of about 1.5MB/sec (note the 8bit/byte conversion, so this translates to about 12mbits).

Microsoft Office 2007 New Formats and your Apache server

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

Default Grub Boot Commands for Ubuntu 7.10

I recently formatted my laptop and installed Windows first, using half of…