summaryrefslogtreecommitdiffstats
path: root/etc/hypermail/reverse-summary-order.sh
blob: 4845cac4c3b8d347aa459502257581fcb30c9fba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

if [ -n "$1" ]; then
	echo "" > /tmp/summary-rows
	while read line; do
		if [ -n "$(echo $line | grep '<tr><td>')" ]; then
			echo $line >> /tmp/summary-rows
		else
			if [ -n "$(echo $line | grep '</table>')" ]; then
				tac /tmp/summary-rows
			fi
			echo $line
		fi
	done < $1
else
	echo "Error in reverse sorting summary."
fi