title: In Bash, how to add "Are you sure [Y/n]" to any command or alias?
body: <p>In this particular case, I'd like to add a confirm in Bash for</p>
  
  <pre>
  Are you sure? [Y/n]
  </pre>
  
  <p>for Mercurial's <code>hg push ssh://username@www.example.com//somepath/morepath</code>, which is actually an alias.  Is there a standard command that can be added to the alias to achieve it?</p>
  
  <p>The reason is that <code>hg push</code> and <code>hg out</code> can sound similar and sometimes when I want <code>hgoutrepo</code>, I may accidentlly type <code>hgpushrepo</code> (both are aliases).</p>
  
  <p><strong>Update:</strong> if it can be something like a built-in command with another command, such as: <code>confirm &amp;&amp; hg push ssh://...</code> that'd be great... just a command that can ask for a <code>yes</code> or <code>no</code> and continue with the rest if <code>yes</code>.</p>