Do not write to output in case of failed sha512sum. - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit 49aa535e6aee10a61a54a6dd2b04aa0257b8722f
(DIR) parent 7f7cfb2f35485b7e592eca9429dd580f956e277f
(HTM) Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Tue, 19 May 2020 19:19:41 +0200
Do not write to output in case of failed sha512sum.
A failed command means file not found.
Diffstat:
M lsmemes | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/lsmemes b/lsmemes
@@ -10,6 +10,8 @@ do
memeuri="$(printf "%s\n" "${meme}" | cut -d' ' -f 2)"
memefile="$(basename "${memeuri}")"
hash="$(sha512sum ${MEMEDIR}/${memefile} | cut -d' ' -f 1)"
+ [ -z "${hash}" ] && continue
+
printf "%s %s %s\n" $tag $meme $hash
done < $MEMEFILE