From c785087d1529f57ab5dee59ff652f274c188a0dd Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 29 Sep 2016 21:03:48 +0200 Subject: [PATCH] - save 1x sed in count_lines/words --- testssl.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/testssl.sh b/testssl.sh index eedf607..ff6bee5 100755 --- a/testssl.sh +++ b/testssl.sh @@ -507,10 +507,15 @@ hex2dec() { # trim spaces for BSD and old sed count_lines() { - wc -l <<<"$1" | sed 's/ //g' + #echo "${$(wc -l <<< "$1")// /}" + # ^^ bad substitution under bash, zsh ok. For some reason this does the trick: + echo $(wc -l <<< "$1") } + count_words() { - wc -w <<<"$1" | sed 's/ //g' + #echo "${$(wc -w <<< "$1")// /}" + # ^^ bad substitution under bash, zsh ok. For some reason this does the trick: + echo $(wc -w <<< "$1") } count_ciphers() {