title: How to find/extract a pattern from a file?
body: <p>Here are the contents of my text file named 'temp.txt'</p>
  
  <pre><code>---start of file ---
  HEROKU_POSTGRESQL_AQUA_URL (DATABASE_URL)  ----backup---&gt;  b687
  
  Capturing... done
  Storing... done
  ---end of file ----
  </code></pre>
  
  <p>I want to write a bash script in which I need to capture the string 'b687' in a variable.  this is really a pattern (which is the letter 'b' followed by 'n' number of digits).  I can do it the hard way by looping through the file and extracting the desired string (b687 in example above).  Is there an easy way to do so?  Perhaps by using awk or sed?</p>