aboutsummaryrefslogtreecommitdiff
path: root/gromo
diff options
context:
space:
mode:
Diffstat (limited to 'gromo')
-rwxr-xr-xgromo9
1 files changed, 6 insertions, 3 deletions
diff --git a/gromo b/gromo
index d85030b..e083e60 100755
--- a/gromo
+++ b/gromo
@@ -109,9 +109,12 @@ EOF
out+="\n"
done
- while IFS=$FS read -r task dur gromos; do
- echo -e "$task\n\t$gromos gromos, $(pp_seconds $dur)"
- done <<<$(echo -e "$out" | sort -t $FS -k 2 -rn)
+ sortedout=$(printf "$out" | sort -t $FS -k 2 -rn)
+ if [ -n "$sortedout" ]; then
+ while IFS=$FS read -r task dur gromos; do
+ echo -e "$task\n\t$gromos gromos, $(pp_seconds $dur)"
+ done <<<$sortedout
+ fi
fi
fi
}