From: Chris Koeritz Date: Wed, 21 Jul 2021 20:52:26 +0000 (-0400) Subject: updated fast counter with docs X-Git-Tag: 2.140.128~1^2~21 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=3d87e1de185daea3f52f671b963aaea0a669d10b;p=feisty_meow.git updated fast counter with docs --- diff --git a/scripts/files/fast_counter.sh b/scripts/files/fast_counter.sh index c40e33a3..e359514e 100644 --- a/scripts/files/fast_counter.sh +++ b/scripts/files/fast_counter.sh @@ -1,7 +1,14 @@ for dir in "${@}"; do - /bin/ls -1fR "$dir" | grep -v "^$" | grep -v "^\.$" | grep -v "^\.\.$" | grep -v "$dir\/.*:$" | wc + /bin/ls -1fR "$dir" | grep -v "^$" | grep -v "^\.$" | grep -v "^\.\.$" | grep -v ".*:$" | wc -l + + # patterns that remove files from being counted, above: + # + # ^$ -- all blank lines + # ^\.$ -- all lines with just a dot (current directory) + # ^\.\.$ -- all lines with just two dots (parent directory) + # .*:$ -- all lines that end with a colon (directory heading from recursive ls) done