From cd7a8c2433182ee147380318008a81a839f65596 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 26 Jul 2017 08:59:46 +1200 Subject: Adjust linebreak behaviour around downloads check --- sh/profile.d/downloads.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sh') diff --git a/sh/profile.d/downloads.sh b/sh/profile.d/downloads.sh index fb8dd64a..865cb859 100644 --- a/sh/profile.d/downloads.sh +++ b/sh/profile.d/downloads.sh @@ -15,6 +15,7 @@ esac # Count files in each directory, report if greater than zero ( + lc=0 while IFS= read -r dir ; do case $dir in '#'*) continue ;; @@ -23,6 +24,8 @@ esac set -- "$dir"/* [ -e "$1" ] || shift [ "$#" -gt 0 ] || continue - printf '\nYou have %u unsorted files in %s.\n\n' "$#" "$dir" + printf 'You have %u unsorted files in %s.\n' "$#" "$dir" + lc=$((lc+1)) done < "$HOME"/.downloads + [ "$((lc > 0))" -eq 1 ] && printf '\n' ) -- cgit v1.2.3