mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-22 16:39:30 +01:00
- save 1x sed in count_lines/words
This commit is contained in:
parent
83e6bf6760
commit
c785087d15
@ -507,10 +507,15 @@ hex2dec() {
|
|||||||
|
|
||||||
# trim spaces for BSD and old sed
|
# trim spaces for BSD and old sed
|
||||||
count_lines() {
|
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() {
|
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() {
|
count_ciphers() {
|
||||||
|
Loading…
Reference in New Issue
Block a user