Guest User

Untitled

a guest
Dec 15th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. for f in "$@"
  4. do
  5. w=`cat "$f" | sed "s/ */\\n/g" | sed "s/[^a-zA-Z0-9]//g" | sed "s/[0-9]*//g" | sed "/^$/d" | wc -w`
  6. s=`cat "$f" | tr -d " \t\n\r" | sed "s/\./\\n/g" | sed "s/\?/\\n/g" | sed "s/\!/\\n/g" | wc -l`
  7. z=$(expr "$w" / "$s")
  8. echo $f:
  9. echo " "$w words
  10. echo " "$s sentences
  11. echo " "The average sentence is $z words long.
  12. done
Add Comment
Please, Sign In to add comment