diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-09-03 13:30:57 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-09-03 13:30:57 +1200 |
commit | b093db4ad7fe12319976c8f1711ed57164d2006b (patch) | |
tree | 1a85f536f25c6577286cdd7bc090c884c044ac3a /bin/cfr | |
parent | Add -o option to cf(1df) (diff) | |
download | dotfiles-b093db4ad7fe12319976c8f1711ed57164d2006b.tar.gz dotfiles-b093db4ad7fe12319976c8f1711ed57164d2006b.zip |
Simplify cfr(1) with new -o option to cf(1)
Diffstat (limited to 'bin/cfr')
-rwxr-xr-x | bin/cfr | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 |