ksh .profile not evaluated using screen, xterm or subshells

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ksh .profile not evaluated using screen, xterm or subshells

Bruno Carnazzi
   Hi misc,

I export/alias some important stuff in my ksh .profile. It works
normally, but since I run screen or xterm, my .profile is not
evaluated (or even if I launch a sub-shell). I know there is a
difference between login shell and sub shell but how can I have some
environment variables and aliases in all context, everytime ?

I use OpenBSD/i386 3.9-release's pdksh.

Best regards,

Bruno.

Reply | Threaded
Open this post in threaded view
|

Re: ksh .profile not evaluated using screen, xterm or subshells

Paul de Weerd
On Mon, Oct 16, 2006 at 08:52:26PM +0400, Bruno Carnazzi wrote:
|   Hi misc,
|
| I export/alias some important stuff in my ksh .profile. It works
| normally, but since I run screen or xterm, my .profile is not
| evaluated (or even if I launch a sub-shell). I know there is a
| difference between login shell and sub shell but how can I have some
| environment variables and aliases in all context, everytime ?
|
| I use OpenBSD/i386 3.9-release's pdksh.

In your .profile :

        export ENV=~/.kshrc

Now put your aliases etc. in your .kshrc. BTW, stuff you export in
.profile shoud be available to you in your subshells.

Cheers,

Paul 'WEiRD' de Weerd

--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/

[demime 1.01d removed an attachment of type application/pgp-signature]

Reply | Threaded
Open this post in threaded view
|

Re: ksh .profile not evaluated using screen, xterm or subshells

viq .
In reply to this post by Bruno Carnazzi
On 16/10/06, Bruno Carnazzi <[hidden email]> wrote:
>    Hi misc,
>
> I export/alias some important stuff in my ksh .profile. It works
> normally, but since I run screen or xterm, my .profile is not
> evaluated (or even if I launch a sub-shell). I know there is a
> difference between login shell and sub shell but how can I have some
> environment variables and aliases in all context, everytime ?
>
> I use OpenBSD/i386 3.9-release's pdksh.

I don't know about xterms and sub-shells, but as for screen i have the
following line in my ~/.screenrc:
shell -$SHELL


> Best regards,
>
> Bruno.
>
>


--
viq

Reply | Threaded
Open this post in threaded view
|

Re: ksh .profile not evaluated using screen, xterm or subshells

Stuart Henderson
In reply to this post by Bruno Carnazzi
On 2006/10/16 20:52, Bruno Carnazzi wrote:
> I export/alias some important stuff in my ksh .profile. It works
> normally, but since I run screen or xterm, my .profile is not
> evaluated (or even if I launch a sub-shell). I know there is a
> difference between login shell and sub shell but how can I have some
> environment variables and aliases in all context, everytime ?

screen: (add to .screenrc)
shell -${SHELL}

xterm: (add to .Xresources)
XTerm*loginShell: true

Reply | Threaded
Open this post in threaded view
|

Re: ksh .profile not evaluated using screen, xterm or subshells

Prabhu Gurumurthy
In reply to this post by Bruno Carnazzi
Bruno Carnazzi wrote:

>   Hi misc,
>
> I export/alias some important stuff in my ksh .profile. It works
> normally, but since I run screen or xterm, my .profile is not
> evaluated (or even if I launch a sub-shell). I know there is a
> difference between login shell and sub shell but how can I have some
> environment variables and aliases in all context, everytime ?
>
> I use OpenBSD/i386 3.9-release's pdksh.
>
> Best regards,
>
> Bruno.
>
>

You should have searched the archives.

In .Xdefaults
XTerm*loginShell: true

will do the trick.

Prabhu
-

Reply | Threaded
Open this post in threaded view
|

Re: ksh .profile not evaluated using screen, xterm or subshells

Bruno Carnazzi
In reply to this post by Paul de Weerd
2006/10/16, Paul de Weerd <[hidden email]>:

> On Mon, Oct 16, 2006 at 08:52:26PM +0400, Bruno Carnazzi wrote:
> |   Hi misc,
> |
> | I export/alias some important stuff in my ksh .profile. It works
> | normally, but since I run screen or xterm, my .profile is not
> | evaluated (or even if I launch a sub-shell). I know there is a
> | difference between login shell and sub shell but how can I have some
> | environment variables and aliases in all context, everytime ?
> |
> | I use OpenBSD/i386 3.9-release's pdksh.
>
> In your .profile :
>
>         export ENV=~/.kshrc
>
> Now put your aliases etc. in your .kshrc. BTW, stuff you export in
> .profile shoud be available to you in your subshells.

Thank you Paul, your method works perfectly in all case.
This point is also well explained in man ksh(1).

Now, I can have a fortune for login shell only :)

Best regards,

Bruno.

>
> Cheers,
>
> Paul 'WEiRD' de Weerd
>
> --
> >++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
> +++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
>                  http://www.weirdnet.nl/