I'm trying to set PS1 as "KeepPrompt", and prevent it from being changed while entering into a subshell. To do that I entered the following:
user@host:~$ echo $SHLVL
user@host:~$ 1
user@host:~$ export PS1="KeepPrompt: "
KeepPrompt:
KeepPrompt: echo $SHLVL
KeepPrompt: 1
KeepPrompt: bash
user@host:~$
user@host:~$ echo $SHLVL
user@host:~$ 2
As you see when I try to create a new subshell, the PS1 definition doesn't survive entering into the new shell. Why is it so?