Searching files

Create a script to display the appropriate Unix command and the result of the command for each of the following: (use /usr/share/dict/words)
You should show me the command also (e.g., echo it and then run it). For example, if question one is to display the lines that contain an axyz, your script would contain the following two lines:

echo "1. grep axyz words"
grep axyz words

Set a variable w to the dictionary(words)
  1. Display the 8th word in the dictionary that contains a th AND Q
  2. Display the head of all the words that begin with quin
  3. Display the head of all the words that end with rky
  4. Display the head of all the words in the dictionary that start with an uppercase letter and end with ky
  5. Display a count of all the words that contain an uppercase letter
  6. Display a count of all of the words that contain an q or Q
  7. Give another command to answer the previous question (number 6)
  8. Display the number of words that begin with Sl (e.g., Sleep)
    That is a capital "ESS" and and lower case "el"
  9. Display the number of words that do not begin with Sl
  10. Display a count of the words that don't contain a vowel regardless of case
  11. Define a variable v that contains aeiou
  12. Display the head of all the words that start with a vowel (defined in question 11) and end with ky
  13. Define a variable c that contains the 21 lower case consonants
  14. Display the count of the number of words that contain 5 lower case consonants in a row
  15. Display as accurate of a count as possible of the number of times that you have used grep (hint: history uses the file .bash_history)
  16. Display the head of all the words that contain 3 consonants, followed by two vowels, followed by 3 consonants
  17. Use grep flags to display the count of the number of words that have an x in it regardless of case.
  18. Display the count of the number of words that have an F and a T.

To hand in this assignment:

  • move the code and the output to obisdian dropbox (call it assign7 and assign7.out, PLEASE)