X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Ffiles%2Ffast_counter.sh;h=e359514e6298495a6819303601274d60354143ef;hb=fb66c19de008fcb536168a864e10de76705f760f;hp=c40e33a37214554eefd20d1365612f0082293d4f;hpb=ff0a471959e20771280f16cbc38237433c0f602d;p=feisty_meow.git 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