Escaping characters in PS1

I start a new bash session with the following command:
exec bash --init-file <(cat /etc/profile ~/.bashrc $ANOTHER_SCRIPT) -i
I would also like to change the prompt for a new session without adding another initialization file ... I suspect my best bet is something like this:
exec bash --init-file <(cat /etc/profile ~/.bashrc $ANOTHER_SCRIPT; echo "PS1='[TEST] '$PS1") -i
I think my problems are escaped characters ... but I absolutely don't know how to continue solving the problem by adding my shortcut to the invitation.

Any thoughts are welcome

Andrew

+3
source share
2 answers

This should work:

exec bash --init-file <(cat /etc/profile ~/.bashrc $ANOTHER_SCRIPT; echo 'PS1="[TEST] $PS1"') -i
+3
source

PS1="[TEST] $PS1"

, <(cat ...), , ~/.bashrc

+1

Source: https://habr.com/ru/post/1776502/


All Articles