Recent Notes

Displaying keyword search results 1 - 2
Created by Dr. Xi on March 28, 2011 11:11:33    Last update: March 28, 2011 11:13:21
grep is a versatile command with many variations (grep, egrep, fgrep, then various implementations). It uses a regula expression (regex) pattern to filter input. But then there are basic and extended flavors of regex - leading to even more confusion. And, beware that there are lots of bad examples of regex in the wild... There are two critical questions to ask when you use grep: which grep implementation are you using? what is the flavor of the regex? Here are some examples for gnu grep v2.7: # Find all numbers (no decimal point), basic regex... Use the -o flag to show only the matching part instead of the whole matching line: grep -o -E '\b[0-9]{2}\b' The good thing about the gnu grep is that it...
Created by Dr. Xi on August 10, 2007 19:53:32    Last update: August 10, 2007 19:53:32
As a Java developer, I often need to find out which Jar file to include on my classpath in order to fix some compilation error (undefined package, class etc). This is a little Perl script I wrote to facilitate this task. #!/bin/perl # find jar containing specified...