Add ProjectContact script

Junio C Hamano committed Feb 16, 2009 at 23:52 UTC 735f9d11ed7e73772898c2d6636a5094dca307f4
1 file changed +56
ProjectContact
+56
new file mode 100755 index 0000000000..4a5d035cad --- /dev/null +++ b/ProjectContact @@ -0,0 +1,56 @@ +#!/bin/sh + +header= +while : +do + case $# in 0) break ;; esac + case "$1" in + -b) header=Bcc ;; + -c) header=Cc ;; + -*) echo >&2 "Unknown option $1" + exit 1 ;; + *) break ;; + esac + shift +done + +case $# in +0) match='*' ;; +1) match="*$1*"; shift ;; +esac +for p +do + match="$match|*$p*" +done + +{ +iis= +iis2=', + ' +while read address name +do + case "$name" in + $match) ;; + *) continue ;; + esac + item="$name <$address>" + if test -z "$header" + then + echo "$iis$item" + elif test -z "$iis" + then + printf "$header: $item" + iis="$iis2" + else + printf "$iis$item" + fi +done +if test -n "$header" +then + printf '\n' +fi +} <<\EOF +linux-kernel@vger.kernel.org Linux Kernel +info@lwn.net LWN.NET +emacs-orgmode@gnu.org Emacs Org Mode +EOF