aboutsummaryrefslogtreecommitdiff
path: root/bin/cfr
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-09-03 13:30:57 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-09-03 13:30:57 +1200
commitb093db4ad7fe12319976c8f1711ed57164d2006b (patch)
tree1a85f536f25c6577286cdd7bc090c884c044ac3a /bin/cfr
parentAdd -o option to cf(1df) (diff)
downloaddotfiles-b093db4ad7fe12319976c8f1711ed57164d2006b.tar.gz
dotfiles-b093db4ad7fe12319976c8f1711ed57164d2006b.zip
Simplify cfr(1) with new -o option to cf(1)
Diffstat (limited to 'bin/cfr')
-rwxr-xr-xbin/cfr7
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/cfr b/bin/cfr
index 896126f5..33075dc5 100755
--- a/bin/cfr
+++ b/bin/cfr
@@ -1,8 +1,7 @@
#!/bin/sh
# Count all descendants of given directories; don't follow symlinks
for dir in "${@:-.}" ; do
- tot=$(find "$dir" -type d \
- -exec sh -c 'cd -- "$1" && cf' _ {} \; |
- cut -f1 | tot)
- printf '%u\t%s\n' "$tot" "$dir"
+ printf '%u\t%s\n' \
+ "$(find "$dir" -type d -exec cf -o -- {} \; | tot)"
+ "$dir"
done