Parsing a Git Patch with Bash

I probably could have done this in perl and it would have been much faster…but I could say that about a lot of things. My problem is that Perl is not my command-line. Perl can be a REPL, but bash always is a REPL.

Ever look at a patch file?

diff -u -r -N httpd-2.0.48/include/ap_listen.h httpd-2.0.48.ben/include/ap_listen.h
--- httpd-2.0.48/include/ap_listen.h    2003-02-03 09:31:29.000000000 -0800
+++ httpd-2.0.48.ben/include/ap_listen.h        2004-02-11 20:24:23.000000000 -0800
@@ -91,6 +91,10 @@
* Is this socket currently active 
*/
int active;
+
+    /** The device to bind to, empty string for no binding.
+     */
+    char bind_device[16];
/* more stuff here, like which protocol is bound to the port */
};

(Read the rest at Freedom Penguin)