From a825bb90dd4548008c0aeeacea868f35c7f1c21f Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Thu, 20 Jan 2022 10:40:10 +0100 Subject: Small fixes --- gromo | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gromo') 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 } -- cgit v1.2.3