How can I determine if a function is already defined in a bash script?
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.
I want to add __git_ps1()
to PS1
only if that function exists on that system. This funciton normally defined in git-completion.bash which comes with git source, or by one of the bash completion scripts that ports/apt installs.