I want my prompt to display the current git-branch when inside of a repo directory. e.g.,[desktop repo(master)]$In my terminal I can type:cat <<EOF >> ~/.bash_profilePS1='\[\e[0;32m\][\h \W\[\e[m\]$(__git_ps1 (%s))\[\e[0;32m\]]\$ \[\e[m\]'EOFBut the resultant appended text in .bash_profile is:PS1='\[\e[0;32m\][\h \W\[\e[m\]\[\e[0;32m\]]$ \[\e[m\]'the __git_ps1 method is not present in the result. If I manually edit the .bash_profile with vim then source ~./bash_profile, the PS1 statement contains the __git_ps1 method and it works fine. This cat statement is part of a larger 'bootstrapping' script, but I've trimmed out all the irrelevant stuff. I have successfully implemented this on Ubuntu. I am trying to get it running on a CentOS VM.Thanks!
Using cat to modify ~/.bash_profile seems to remove __git_ps1 compeltely
shell;here document
Try cat << EOF, this prevents expansion of the dollar function and the quotes.