bash ps1 only executes a script once on new terminal windows [duplicate]
问题 This question already has answers here : Why doesn't my bash prompt update? (2 answers) Closed 4 years ago . I have a very simple ps1 script in my .bashrc file, this excutes a random script generator called blah. export PS1="\[$(tput bold)\]\[$(tput setaf 1)\]\\$ \[$(tput sgr0)\] $PWD :: **$(. blah)** ::" the blah script simply should export a random string each time in the shell.... function silly { local RANDOMQUOTE=$[ ($RANDOM % 10 ) ] local fooey=('rand1' 'rand2' 'rand3' 'rand4' 'rand5');