From 3d87e1de185daea3f52f671b963aaea0a669d10b Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 21 Jul 2021 16:52:26 -0400 Subject: [PATCH] updated fast counter with docs --- scripts/files/fast_counter.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.34.1