diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-07-28 16:00:57 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-07-28 16:00:57 +1200 |
commit | c206e46c9afbc0baeeb5828e4aff9888558b104d (patch) | |
tree | cf8e857ab557a591a2431659dc391dfb11b587c4 /sh/profile.d/downloads.sh | |
parent | Merge branch 'master' into port/bsd/freebsd (diff) | |
parent | Adjust linebreak behaviour around downloads check (diff) | |
download | dotfiles-c206e46c9afbc0baeeb5828e4aff9888558b104d.tar.gz dotfiles-c206e46c9afbc0baeeb5828e4aff9888558b104d.zip |
Merge branch 'master' into port/bsd/freebsd
Diffstat (limited to 'sh/profile.d/downloads.sh')
-rw-r--r-- | sh/profile.d/downloads.sh | 5 |
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' ) |