title: bash, prompt for numerical input
body: <p>d is an internal server lookup tool I use.</p>
  
  <p>I am looking to allow a user to input any number between 0 (or 1) and 9999 (let's call this userinput) and have it display the result of:</p>
  
  <p>d $userinput (e.g. 1234)</p>
  
  <p>Then manipulate the results of that lookup (below gets rid of everything but the IP address to ping later):</p>
  
  <pre><code> grep -E -o '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'`
  </code></pre>
  
  <p>I know I need to use the while true; do read $blah etc etc. I am just not familiar with read enough to format it properly and more importantly:</p>
  
  <p><strong>get it to prompt for a numerical input between 0-9999</strong></p>