Export variables

I log onto QNX in text mode and subsequently run photon. When I log in I
set numerous export variables, aliases and function in my .profile. Once
I’m in photon all of these have been lost. If I open up a pterm and log
back in via ‘login’, then I loose all of my photon path information.

What is the correct way of setting up my environment in text mode and having
it stay in effect when in Photon?


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

Bill Caroselli <qtps@earthlink.net> wrote:

I log onto QNX in text mode and subsequently run photon. When I log in I
set numerous export variables, aliases and function in my .profile. Once
I’m in photon all of these have been lost. If I open up a pterm and log
back in via ‘login’, then I loose all of my photon path information.

What is the correct way of setting up my environment in text mode and having
it stay in effect when in Photon?

What I did (and this might not be the correct way of doing it) is I hacked
the file .ph/wm/wm.menu to change “pterm” to “pterm -l”…

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at www.parse.com
Email my initials at parse dot com.

nospam93@parse.com wrote:

Bill Caroselli <> qtps@earthlink.net> > wrote:
I log onto QNX in text mode and subsequently run photon. When I log in I
set numerous export variables, aliases and function in my .profile. Once
I’m in photon all of these have been lost. If I open up a pterm and log
back in via ‘login’, then I loose all of my photon path information.

What is the correct way of setting up my environment in text mode and having
it stay in effect when in Photon?

What I did (and this might not be the correct way of doing it) is I hacked
the file .ph/wm/wm.menu to change “pterm” to “pterm -l”…

You’re right, it’s not the correct way of doing it. :wink:

Even though it “kind of” works with pterm, it still doesn’t give you
your aliases and functions when you escape to the shell from an
application in your pterm (e.g. via “!sh” in vi), or when you just start
a second shell from your shell.

A much better solution is to export ENV in your .profile, and set up the
aliases and whatnot in the file that $ENV points to. For instance:

.profile:

export ENV=$HOME/.kshrc

\

$HOME/.kshrc:

case “$-” in
i) # Don’t waste time doing this in a non-interactive shell
alias …
function …
esac


Wojtek Lerch QNX Software Systems Ltd.

Wojtek Lerch <wojtek_l@ottawa.com> wrote:

nospam93@parse.com > wrote:
Bill Caroselli <> qtps@earthlink.net> > wrote:
I log onto QNX in text mode and subsequently run photon. When I log in I
set numerous export variables, aliases and function in my .profile. Once
I’m in photon all of these have been lost. If I open up a pterm and log
back in via ‘login’, then I loose all of my photon path information.

What is the correct way of setting up my environment in text mode and having
it stay in effect when in Photon?

What I did (and this might not be the correct way of doing it) is I hacked
the file .ph/wm/wm.menu to change “pterm” to “pterm -l”…

You’re right, it’s not the correct way of doing it. > :wink:

Even though it “kind of” works with pterm, it still doesn’t give you
your aliases and functions when you escape to the shell from an
application in your pterm (e.g. via “!sh” in vi), or when you just start
a second shell from your shell.

A much better solution is to export ENV in your .profile, and set up the
aliases and whatnot in the file that $ENV points to. For instance:

.profile:

export ENV=$HOME/.kshrc


$HOME/.kshrc:

case “$-” in
i) # Don’t waste time doing this in a non-interactive shell
alias …
function …
esac

:slight_smile:

Thanks, Wojtek. Glen McCready had shown me how to do that under QNX 4 and
Photon, using “.kshrc”, but that didn’t work when I went to QNX 6 and Photon 2,
so I “improvised”…

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at www.parse.com
Email my initials at parse dot com.

nospam93@parse.com wrote:

Wojtek Lerch <> wojtek_l@ottawa.com> > wrote:

A much better solution is to export ENV in your .profile, and set up the
aliases and whatnot in the file that $ENV points to. For instance:

.profile:

export ENV=$HOME/.kshrc


$HOME/.kshrc:

case “$-” in
i) # Don’t waste time doing this in a non-interactive shell
alias …
function …
esac

:slight_smile:

Thanks, Wojtek. Glen McCready had shown me how to do that under QNX 4 and
Photon, using “.kshrc”, but that didn’t work when I went to QNX 6 and Photon 2,
so I “improvised”…

That’s curious. The only time it didn’t work for me under Neutrino was
in those old days when there was no ksh under Neutrino and we had to use
esh…


Wojtek Lerch QNX Software Systems Ltd.