title: Check if a function exists from a bash script
body: <p>How can I determine if a function is already defined in a bash script?</p>
  
  <p>I am trying to make my .bash_login script portable between systems, so I want to add logic to only call a function if it exists. </p>
  
  <p>I want to add <code>__git_ps1()</code> to <code>PS1</code> only if that function exists on that system. This function normally defined in <code>git-completion.bash</code> which comes with git source, or by one of the bash completion scripts that ports/apt installs.</p>