from http://www.pc-tools.net/unix/grepcidr/