I want to append the string PROMPT_COMMAND='echo -ne \"\033]0;${USER}@${HOSTNAME}: ${PWD}\007\"' to the end of a .bashrc file across 4300 servers.
I'm having some difficulty in escaping, obviously I want the variables to not expand when being appended to the file so that the text is kept original.
How might I do so? I tried adding slashes to the beginning of the variables, but that didn't seem to be what I wanted.
Might be better to use a heredoc
cat >> .bashrc <<'+'
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With