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