From: Chris Koeritz Date: Tue, 5 Mar 2013 21:07:14 +0000 (-0500) Subject: fixed to make a nicer output and to not show the directory one's in. X-Git-Tag: 2.140.90~1069 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=118c6a9e7846ae828036e6eae9d217d0cdd1e4f0;p=feisty_meow.git fixed to make a nicer output and to not show the directory one's in. --- diff --git a/scripts/files/count_files_in_subdirs.sh b/scripts/files/count_files_in_subdirs.sh index d54ee6e8..7814ca01 100644 --- a/scripts/files/count_files_in_subdirs.sh +++ b/scripts/files/count_files_in_subdirs.sh @@ -1,7 +1,9 @@ #!/bin/bash -dirs=$* -if [ -z "$dirs" ]; then dirs=*; fi -for i in $dirs; do - ls -1 $i | wc | sed -e "s/^ *\([0-9]*\) *.*$/$i: \1/" +dirs=($*) +if [ -z "$dirs" ]; then dirs=($(find . -mindepth 1 -maxdepth 1 -type d ) ); fi +#echo dirs are ${dirs[*]} +for i in "${dirs[@]}"; do + echo -n $(ls -1 $i | wc -l) + echo -e "\t\t$i" done