Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-19 Thread Tom H
On Fri, Sep 18, 2020 at 10:26 AM Ottavio Caruso wrote: > On 18/09/2020 09:01, Tom H wrote: >> On Thu, Sep 17, 2020 at 3:16 PM Ottavio Caruso >> 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 coul

Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-18 Thread Ingo Schwarze
Hi Ottavio, Ottavio Caruso wrote on Fri, Sep 18, 2020 at 09:22:11AM +0100: > On a side note, there's no mention of startup files in sh(1) > and I wonder why. >From sh(1), second paragraph: This manual page describes only the parts relevant to a POSIX compliant sh. If portability is a conce

Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-18 Thread Ottavio Caruso
On 18/09/2020 09:01, Tom H wrote: On Thu, Sep 17, 2020 at 3:16 PM Ottavio Caruso 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 EN

Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-18 Thread Tom H
On Thu, Sep 17, 2020 at 3:16 PM Ottavio Caruso 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-es

Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-17 Thread Ottavio Caruso
On 17/09/2020 10:40, Tom H wrote: On Thu, Sep 17, 2020 at 9:33 AM Ottavio Caruso wrote: On 17/09/2020 00:58, Ashlen wrote: On 20/09/15 05:49PM, Ottavio Caruso wrote: Maybe it's just because OpenBSD sh is just ksh in disguise or there might be other reasons that I obviously don't know. Yep,

Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-17 Thread Ottavio Caruso
On 17/09/2020 00:58, Ashlen wrote: On 20/09/15 05:49PM, Ottavio Caruso wrote: Maybe it's just because OpenBSD sh is just ksh in disguise or there might be other reasons that I obviously don't know. Yep, you're right. They share the same inode. ls -li /bin/{,k}sh 77862 -r-xr-xr-x 3 root bin

Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-17 Thread Tom H
On Thu, Sep 17, 2020 at 9:33 AM Ottavio Caruso wrote: > On 17/09/2020 00:58, Ashlen wrote: >> On 20/09/15 05:49PM, Ottavio Caruso wrote: >>> >>> Maybe it's just because OpenBSD sh is just ksh in disguise or there >>> might be other reasons that I obviously don't know. >> >> Yep, you're right. They

Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-16 Thread Ashlen
On 20/09/15 05:49PM, Ottavio Caruso wrote: > Maybe it's just because OpenBSD sh is just ksh in disguise or there > might be other reasons that I obviously don't know. Yep, you're right. They share the same inode. ls -li /bin/{,k}sh 77862 -r-xr-xr-x 3 root bin 613656 Sep 15 12:10 /bin/ksh 7786

Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-15 Thread Ottavio Caruso
On 15/09/2020 14:44, Vincenzo Nicosia wrote: On Tue, Sep 15, 2020 at 02:08:16PM +0100, Ottavio Caruso wrote: Hi, I have this in ~/.kshrc : PS1="\u@\h:\w\$ " which works fine in ksh: oc@OpenBSD:~$ However, if I open a sh subshell, I get: \u@OpenBSD:\w$ which is not very nice. The only hack

How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-15 Thread Ottavio Caruso
Hi, I have this in ~/.kshrc : PS1="\u@\h:\w\$ " which works fine in ksh: oc@OpenBSD:~$ However, if I open a sh subshell, I get: \u@OpenBSD:\w$ which is not very nice. The only hack I've found is to append this to ~/.profile: if [ -n "$KSH_VERSION" ]; then if [ -f "$HOME/.kshrc" ]; t

Re: How do you get different $PS1 for /bin/sh and /bin/ksh?

2020-09-15 Thread Vincenzo Nicosia
On Tue, Sep 15, 2020 at 02:08:16PM +0100, Ottavio Caruso wrote: > Hi, > > I have this in ~/.kshrc : > > PS1="\u@\h:\w\$ " > > which works fine in ksh: > > oc@OpenBSD:~$ > > However, if I open a sh subshell, I get: > > \u@OpenBSD:\w$ > > which is not very nice. The only hack I've found is to