.profile for pterm...

I’m using qnx 6.21 and want to setup some enviroment variable and alias for
development when I login to Photon. I tried putting my aliases in .profile
but it doesn’t appear to be running. Is there a file that is ran for each
copy of the sh shell ran?

Bob

I think invoking pterm with a -l argument in Terminal Setup will fix
this.

Geoff Roberts

Bob Smith wrote:

I’m using qnx 6.21 and want to setup some enviroment variable and alias for
development when I login to Photon. I tried putting my aliases in .profile
but it doesn’t appear to be running. Is there a file that is ran for each
copy of the sh shell ran?

Bob

Bob Smith <Bob@home.com> wrote:

I’m using qnx 6.21 and want to setup some enviroment variable and alias for
development when I login to Photon. I tried putting my aliases in .profile
but it doesn’t appear to be running. Is there a file that is ran for each
copy of the sh shell ran?

In your .profile:

export ENV=$(HOME)/.kshrc

And add your aliases there. See ‘logging in, logging out’ in the user’s
guide.


-seanb

Geoff Roberts wrote:

I think invoking pterm with a -l argument in Terminal Setup will fix
this.

Only partially. Your aliases won’t get propagated to any shell other
than the ones started by pterm. For instance, the shells spawned by the
“shell” command in gdb or “!sh” in vi won’t see your aliases. Any shell
scripts you run won’t see them either.

Use the ENV variable, like Sean described. The file it points to will
be run by all the shells you start.

(There’s a little caveat: our ksh runs $ENV even when it’s a
non-interactive shell that executes a script, whereas POSIX says that
only interactive shells should run $ENV. Make sure that your shell
scripts don’t depend on your $ENV.)

Bob Smith wrote:

I’m using qnx 6.21 and want to setup some enviroment variable and alias for
development when I login to Photon. I tried putting my aliases in .profile
but it doesn’t appear to be running. Is there a file that is ran for each
copy of the sh shell ran?

Bob

Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:

Geoff Roberts wrote:
I think invoking pterm with a -l argument in Terminal Setup will fix
this.

Only partially. Your aliases won’t get propagated to any shell other
than the ones started by pterm. For instance, the shells spawned by the
“shell” command in gdb or “!sh” in vi won’t see your aliases. Any shell
scripts you run won’t see them either.

Use the ENV variable, like Sean described. The file it points to will
be run by all the shells you start.

(There’s a little caveat: our ksh runs $ENV even when it’s a
non-interactive shell that executes a script, whereas POSIX says that
only interactive shells should run $ENV. Make sure that your shell
scripts don’t depend on your $ENV.)

You can prevent the $ENV from doing anything when it’s a non-interactive
shell by wrapping it as follows:

case $- in
i)

interactive shell, add aliases here.

esac

That way your scripts won’t depend on any non POSIX behaviour.

-seanb