# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi


# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! [ -n "$BASH_VERSION" ];then
  if ! shopt -oq posix; then
    if [ -f /usr/share/bash-completion/bash_completion ]; then
      . /usr/share/bash-completion/bash_completion
    elif [ -f /etc/bash_completion ]; then
      . /etc/bash_completion
    fi
  fi
fi


Fix bash errors when running executables
:bug: Fix bash errors when running executables

Currently, when ~/.bashrc is loaded it also loads bash_completion using
the script in bash/completion.bash.  However, bash_completion is for
interactive shells and not scripted shells.

By adding the check for bash vs. dash before including it we can avoid
loading the script when it isn't beneficial.
