diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-11-25 20:37:58 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-11-25 20:37:58 +1300 |
commit | ed6fb3f1f304c8c55bb5447820bb6162d3cd5497 (patch) | |
tree | 7e40961a25dd14338b20fb8eb814c29336ffaccb /bin | |
parent | Correct order of assignments in sqs(1df) (diff) | |
download | dotfiles-ed6fb3f1f304c8c55bb5447820bb6162d3cd5497.tar.gz dotfiles-ed6fb3f1f304c8c55bb5447820bb6162d3cd5497.zip |
Less clumsy method of counting
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cf | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -14,13 +14,9 @@ for dir in "${@:-.}" ; do continue fi - # Make an escaped form of the directory to handle cases where the directory - # name actually has find(1) pattern metacharacters in it - dirx=$(printf %s "$dir" | sed 's/\([*?\[\]]\)/\\\1/g') - # Count the files count=$( - find "$dir" ! -path "$dirx" -prune -exec printf %.sx {} + | + find "$dir" -path "$dir"'/*' -prune -exec printf %.sx {} + | wc -c ) |