Guest User

Untitled

a guest
Mar 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. #!/bin/bash
  2. #Variable to store total word count
  3. words=$(wc $1 | awk '{print $2}')
  4. count=$(grep -c "$2" "$1")
  5. echo "Word Count:" $words
  6. echo "Instance count of "$2": "$count
  7. percentage=$(expr $count / $words)
  8. echo $percentage
Add Comment
Please, Sign In to add comment