title: Wait until a condition becomes true in bash
body: <p>When writing shell scripts, I repeatedly have the need to wait for a given condition to become true, e.g. a remote URL becoming available (checked with curl) or a file that should exist, etc.</p>
  <p>Ideally, I'd like to have a function or script <code>await</code> such that I can write, e.g.,</p>
  <pre><code>await [[ some condition ]]
  </code></pre>
  <p>and it would check the condition every second until it becomes true or a timeout occurs. Ideally I can set the polling interval and the timeout.</p>
  <p>Is there a tool for this out there?</p>