aboutsummaryrefslogtreecommitdiffstats
path: root/ProjectContact
blob: 156101c399def65115b4d0406b189f8ce0ea257f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/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 "$address" in
	'#'*)	continue ;;
	esac
	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
ask@perl.org			Perl5-porters at perl
EOF