projects
/
feisty_meow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
39c78ad
)
fixed handling for leading zeros so we don't eat any but those.
author
Chris Koeritz
<fred@gruntose.com>
Mon, 5 Sep 2016 18:24:21 +0000
(14:24 -0400)
committer
Chris Koeritz
<fred@gruntose.com>
Mon, 5 Sep 2016 18:24:21 +0000
(14:24 -0400)
scripts/files/count_files.sh
patch
|
blob
|
history
diff --git
a/scripts/files/count_files.sh
b/scripts/files/count_files.sh
index b869b05cf346420bef93cf6d595ed77a0864ca37..3934e0fb566ba6d03c4988319c83e24898823040 100644
(file)
--- a/
scripts/files/count_files.sh
+++ b/
scripts/files/count_files.sh
@@
-19,10
+19,12
@@
for i in "${@}" ; do
# redigested as spaces before showing the list.
printf "%06d -- %s\n" $(find "$i" -type f | wc -l) "$i"
done |
# redigested as spaces before showing the list.
printf "%06d -- %s\n" $(find "$i" -type f | wc -l) "$i"
done |
-# provide sorted output based on how many files exist
-# in each directory.
+
# provide sorted output based on how many files exist
+
# in each directory.
sort -r |
sort -r |
-# eat the zeroes but keep the tabular look. this simple
-# sed code will eat zeroes in names also. oops.
- sed -e 's/0/ /g'
+ # eat the zeroes but keep the tabular look (i.e. replace each leading zero
+ # with a space). had to do it as cases, since this seems like context-
+ # sensitive matching, which sed will not do, i think).
+ sed -e 's/^000000/ /' -e 's/^00000/ /' -e 's/^0000/ /' \
+ -e 's/^000/ /' -e 's/^00/ /' -e 's/^0/ /'