aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-07-26 08:59:46 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-07-26 08:59:46 +1200
commitcd7a8c2433182ee147380318008a81a839f65596 (patch)
tree932d740d9a9232d2aad1c4a9a7813be21949ac1c /sh
parentUse combining chars properly for strik(6df) (diff)
downloaddotfiles-cd7a8c2433182ee147380318008a81a839f65596.tar.gz
dotfiles-cd7a8c2433182ee147380318008a81a839f65596.zip
Adjust linebreak behaviour around downloads check
Diffstat (limited to 'sh')
-rw-r--r--sh/profile.d/downloads.sh5
1 files changed, 4 insertions, 1 deletions
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'
)