On 18/09/2020 09:01, Tom H wrote:
On Thu, Sep 17, 2020 at 3:16 PM Ottavio Caruso
<ottavio2006-usenet2...@yahoo.com> wrote:
On 17/09/2020 10:40, Tom H wrote:
You've said that you're now sourcing "$HOME/.kshrc" if
"SKSH_VERSION" exists.
You could add the sourcing of "$HOME/.shrc" if "$SH_VERSION" exists.
Or you could export ENV and use a case-esac of this kind:
case "$0" in
*ksh)
...
PS1='\u@\h:\w\$ '
;;
*sh)
...
PS1='${USER}@${HOST}:${PWD}\$ '
;;
esac
This solves the problem. Thanks.
You're welcome.
But, out of curiosity, which option did you choose? TIA
Ah sorry, I used the second option. I have this in .profile:
export ENV="$HOME/.kshrc"
and this in .kshrc:
case "$0" in
*ksh)
PS1='\u@\h:\w\$ '
;;
*sh)
PS1='${USER}@${HOST}:${PWD}\$ '
;;
esac
On my NetBSD VM, sh and ksh are two different executables. ENV points to
~/.shrc which then sources ./.kshrc if KSH_VERSION = true
I have though of replicating the same configuration over to OpenBSD but
I might be looking for trouble.
On a side note, there's no mention of startup files in sh(1) and I
wonder why.
--
Ottavio Caruso