summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcheck.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/check.sh b/check.sh
index 7de5a92..31ab574 100755
--- a/check.sh
+++ b/check.sh
@@ -62,8 +62,8 @@ fi
# summary
totals=$(wc -l *.txt | sed 's|\(.*\)|\t\1|')
-n_unsourced=$(wc -l <<<${unsourced})
-n_malformed=$(wc -l <<<${invalid} )
+n_unsourced=$( [[ "${unsourced}" ]] && wc -l <<<${unsourced} || echo 0 )
+n_malformed=$( [[ "${invalid}" ]] && wc -l <<<${invalid} || echo 0 )
echo -e "summary:\n\t* number of entries total:\n${totals}"
(( ${n_malformed} )) && echo -e "\t* number of entries improperly formatted: ${n_malformed}"
(( ${n_unsourced} )) && echo -e "\t* number of entries needing citation: ${n_unsourced}"