If I execute either of these commands from a command prompt, I get what I want, but from a bash script, it doesn't work:
PS1="\e[0;34m${title} $ \e[m" # Prompt text Blue
export PS1="\e[0;34m${title} $ \e[m" # Prompt text Blue
e.g.,
I can change the window title from a script but not the command prompt.
How can this be done from a bash script?
You should source your script, with . ./script, source ./script
. I created the script and it works from the command line but still not from the shell script. – hmj6jmh May 24 '21 at 17:13. ./script
orsource script
. If you try to run it as an executable (without the leading.
orsource
) it won't work as you expect – Chris Davies May 24 '21 at 17:24