When I am running an interactive bash
session, I sometimes experiment with sh
.
I call sh
directly from this bash
session.
My question is, how can I change the PS1
prompt of this subshell?
I would like the prompt to be something like sh$
, notifying me that I am using sh
and not bash
.
What I have tried so far is:
- I made a configuration file analogous to
.bashrc
named.shrc
- I put only one line in it:
export PS1='$(echo ${0})\$ '
I then modified
~/.profile
to say the following:# if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi # if running another shell else if [ -f "$HOME/.shrc" ]; then . "$HOME/.shrc" fi fi
I restarted the terminal, but the changes are not being applied.
- If I run
. ~/.shrc
insh
manually, the changes do get applied.
What am I doing wrong?