Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if test $# -lt 2
- then
- echo "Usage: $0 $f [arg1, arg2, ...]"
- else
- file=$1
- shift
- ccount=0
- pcount=0
- for str
- do
- pathc=`echo $str | grep -c "^/"`
- if test $pathc -gt 0
- then
- chars=`echo $str | wc -L`
- ccount=`expr $chars + $ccount`
- pcount=`expr $pcount + 1`
- fi
- done
- if [ -f $file ]
- then
- echo "Paths: $pcount; Total character count: $ccount" > $file
- else echo "File $file is not a regular file"
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement