title: Unix shell user input phone number
body: <p>I am trying to write a script so that it will check whether the user has entered a valid phone number and then check against a <code>records.txt</code> file.</p>
  
  <p>I have the following code. However when I enter a phone number it does not recognize it.</p>
  
  <p>I am also not sure how to implement a check against the text file?</p>
  
  <pre><code>echo "Enter a phone number as XXXXXXXX: "
  read phoneNumber
  while [ "$phoneNumber" != [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ]
      do
      echo "Please enter a phone number as XXXXXXXX: "
      read phoneNumber
  done
  echo $$phoneNumber
  pause
  </code></pre>