title: Linux: using grep to find a word in a file then printing if it does or does not have that word in the file
body: <p>I am trying to use the grep command however i do not know how to continue after the "grep $word $file" or even if that will work. What i need to do is get the program so that after they have typed in a word and a file if the word is in the file the program echo's "The word you have entered is in the file you have entered." and i also need it to print "I am sorry but the word you have entered is not in the file you have entered" if you can help it would be really helpful thank you</p>
  
  <pre><code>#!/bin/bash
  echo "Welcome what please type in what you would like to do!"
  echo "You can:"
  echo "Search for words in file type (S)"
  echo "Quit (Q)"
  read option
  while $option in
      do
              S)      echo "What is the name of the file you would like to search for?"
                      read file
                      echo "What word would you like to find in the file?"
                      read word
                      grep $word $file
  
  
              Q)      echo "Goodbye!"
                      exit
      esac
  done
  </code></pre>