Aliases in .profile are ignored

When I login to a Photon session, my aliases are being ignored. This
is the contents of my .profile:
alias foo=bar
FOO=barvar
export FOO

The variable is set but the alias is not. If I telnet into the machine,
the alias is set correctly. Any idea what is going on? I am running
QNX 6.2.0.

Thanks in advance,


Stephen Rasku

Your .profile file is only run once when you log in. Not all parameters
persists across multiple instances of the shell. Your alias’s I
believe are one that does NOT. Or it may just be Photon that is
killing them. I’m not sure wich.

Solution: Inaddition to your .profile file, create a .kshrc file. (The
exact name is determined by the ENV environment variable. But if you
haven’t changed it then it is likely still .kshrc.) Put your alias’s in
it. The .kshrc file gets evaluated every time every new shell is
loaded.

Stephen Rasku <spr@shaw.ca> wrote:
SR > When I login to a Photon session, my aliases are being ignored. This
SR > is the contents of my .profile:
SR > alias foo=bar
SR > FOO=barvar
SR > export FOO
SR >
SR > The variable is set but the alias is not. If I telnet into the machine,
SR > the alias is set correctly. Any idea what is going on? I am running
SR > QNX 6.2.0.

SR > Thanks in advance,

SR > Stephen Rasku

In article <bqghqc$si4$1@inn.qnx.com>, Bill Caroselli wrote:

Solution: Inaddition to your .profile file, create a .kshrc file. (The
exact name is determined by the ENV environment variable. But if you
haven’t changed it then it is likely still .kshrc.) Put your alias’s in
it. The .kshrc file gets evaluated every time every new shell is
loaded.

I tried putting the following in .kshrc:
export FOO=Dec2
alias foo=bar
export BAR=Dec2

Neither the variables nor the alias were set. The $ENV variable is not
set. Any other ideas?

…Stephen

Stephen Rasku <spr@shaw.ca> wrote:
SR > In article <bqghqc$si4$1@inn.qnx.com>, Bill Caroselli wrote:
SR > …

Solution: Inaddition to your .profile file, create a .kshrc file. (The
exact name is determined by the ENV environment variable. But if you
haven’t changed it then it is likely still .kshrc.) Put your alias’s in
it. The .kshrc file gets evaluated every time every new shell is
loaded.

SR > I tried putting the following in .kshrc:
SR > export FOO=Dec2
SR > alias foo=bar
SR > export BAR=Dec2

SR > Neither the variables nor the alias were set. The $ENV variable is not
SR > set. Any other ideas?

What shell are you using?

Try specifically exporting ENV in your .profile. i.e.
export ENV=/home/my_userid/.kshrc

BTW, exports are fine in .profile. You needn’t redefine them for each shell.

HOWEVER, if you log in from text mode and then start Photon, I do
believe that Photon messes with your environment a little.

In article <bqigvm$avp$1@inn.qnx.com>, Bill Caroselli wrote:

What shell are you using?

I am using /bin/sh.

Try specifically exporting ENV in your .profile. i.e.
export ENV=/home/my_userid/.kshrc

This worked, thanks very much. I have a Unix-based development
environment that uses aliases extensively. Now I will be able to use
it.

…Stephen