Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -ne 2 ]; then
- echo "Usage: $0 <dir> <outfile>"
- exit 1
- fi
- dir=$1
- ofile=$2
- if [ ! -d $dir ]; then
- echo "$dir isn't a dir"
- exit 1
- fi
- flist=$(find $dir -type f -name '*.txt')
- for file in $flist
- do
- cnt=$(wc -c $file | awk '{print $1}')
- echo "$file: $cnt" >> $ofile
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement