.shrc equivalent?

Just a little matter of convenience, not a big problem, but I would like to
set up an alias in Neutrino like in the QNX4 .shrc file. What is the
equivalent file/command in Neutrino?

On Fri, 22 Jun 2001 16:12:33 -0500, “K.King” <software@sagerobot.com>
wrote:

Just a little matter of convenience, not a big problem, but I would like to
set up an alias in Neutrino like in the QNX4 .shrc file. What is the
equivalent file/command in Neutrino?

Put the following in /etc/profile:

if test “$(tty)” != “not a tty”; then
export ENV=.kshrc
endif

or use .profile (pterm -l).

ako

“Andrzej Kocon” <ako@box43.gnet.pl> wrote in message
news:3b370178.112794@inn.qnx.com

On Fri, 22 Jun 2001 16:12:33 -0500, “K.King” <> software@sagerobot.com
wrote:

Just a little matter of convenience, not a big problem, but I would like
to
set up an alias in Neutrino like in the QNX4 .shrc file. What is the
equivalent file/command in Neutrino?

Put the following in /etc/profile:

if test “$(tty)” != “not a tty”; then
export ENV=.kshrc
endif

or use .profile (pterm -l).

ako


I’ve tried both of those, and it seems to have no effect. Is it the alias

command that has changed? That’s what I’m trying to use, like this –
alias lsl=‘ls -l’
but when I type lsl (or any other alias) in the command line it says –
/bin/sh: lsl: not found
It worked in QNX4 that way, did the alias command change or is it still not
reading the file?

K.King <software@sagerobot.com> wrote:

“Andrzej Kocon” <> ako@box43.gnet.pl> > wrote in message
news:> 3b370178.112794@inn.qnx.com> …
On Fri, 22 Jun 2001 16:12:33 -0500, “K.King” <> software@sagerobot.com
wrote:

Just a little matter of convenience, not a big problem, but I would like
to
set up an alias in Neutrino like in the QNX4 .shrc file. What is the
equivalent file/command in Neutrino?

Put the following in /etc/profile:

if test “$(tty)” != “not a tty”; then
export ENV=.kshrc
endif

or use .profile (pterm -l).

ako


I’ve tried both of those, and it seems to have no effect. Is it the alias
command that has changed? That’s what I’m trying to use, like this –
alias lsl=‘ls -l’
but when I type lsl (or any other alias) in the command line it says –
/bin/sh: lsl: not found
It worked in QNX4 that way, did the alias command change or is it still not
reading the file?

I added the alias command exactly as you have it above and it worked after I
logged out and back in again, so it sounds like it’s not reading your .profile
file.

Barry

We use ksh so the file would be $HOME/.kshrc (although $HOME/.profile would
be more general/better). The problem is that, under photon, the default
ways of starting a pterm will not read these files. If you right click shelf
and setup the pterm link to be ‘pterm -l’ and similarily change
$HOME/.ph/wm/wm.menu to call pterm with -l, then you can put all the aliases
you like into your .profile.

cheers,

Kris

K.King <software@sagerobot.com> wrote:

Just a little matter of convenience, not a big problem, but I would like to
set up an alias in Neutrino like in the QNX4 .shrc file. What is the
equivalent file/command in Neutrino?


Kris Warkentin
kewarken@qnx.com
(613)591-0836 x9368
“You’re bound to be unhappy if you optimize everything” - Donald Knuth

Kris Eric Warkentin <kewarken@qnx.com> wrote:

We use ksh so the file would be $HOME/.kshrc (although $HOME/.profile would
be more general/better). The problem is that, under photon, the default
ways of starting a pterm will not read these files. If you right click shelf
and setup the pterm link to be ‘pterm -l’ and similarily change
$HOME/.ph/wm/wm.menu to call pterm with -l, then you can put all the aliases
you like into your .profile.

If you add “export ENV=$HOME/.kshrc” to your $HOME/.profile, every
shell you run will execute your ~/.kshrc. No need to run pterm with the
-l option.


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

Wojtek Lerch a écrit :

Kris Eric Warkentin <> kewarken@qnx.com> > wrote:
We use ksh so the file would be $HOME/.kshrc (although $HOME/.profile would
be more general/better). The problem is that, under photon, the default
ways of starting a pterm will not read these files. If you right click shelf
and setup the pterm link to be ‘pterm -l’ and similarily change
$HOME/.ph/wm/wm.menu to call pterm with -l, then you can put all the aliases
you like into your .profile.

If you add “export ENV=$HOME/.kshrc” to your $HOME/.profile, every
shell you run will execute your ~/.kshrc. No need to run pterm with the
-l option.


Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.

Do you have a trick for the su utility. it doesn’t care of any .shrc or .profile
file.

Thanks,
Alain.

“Kris Eric Warkentin” <kewarken@qnx.com> wrote in message
news:9h7imc$deg$3@nntp.qnx.com

We use ksh so the file would be $HOME/.kshrc (although $HOME/.profile
would
be more general/better). The problem is that, under photon, the default
ways of starting a pterm will not read these files. If you right click
shelf
and setup the pterm link to be ‘pterm -l’ and similarily change
$HOME/.ph/wm/wm.menu to call pterm with -l, then you can put all the
aliases
you like into your .profile.

cheers,

Kris

K.King <> software@sagerobot.com> > wrote:
Just a little matter of convenience, not a big problem, but I would like
to
set up an alias in Neutrino like in the QNX4 .shrc file. What is the
equivalent file/command in Neutrino?


\

Kris Warkentin
kewarken@qnx.com
(613)591-0836 x9368
“You’re bound to be unhappy if you optimize everything” - Donald Knuth

OK, working now, thanks all.
Kevin

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:

Wojtek Lerch a écrit :
If you add “export ENV=$HOME/.kshrc” to your $HOME/.profile, every
shell you run will execute your ~/.kshrc. No need to run pterm with the
-l option.

Do you have a trick for the su utility. it doesn’t care of any .shrc or .profile
file.

I just tried it, and it did run what my ENV pointed to. It did not
run root’s .profile though (or root’s $ENV, of course). I think the
idea of su is to give you root’s privileges witout changing your
familiar environment too much. If you want to completely switch to
root’s environment, just log in as root…


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

Wojtek Lerch a écrit :

Alain Bonnefoy <> alain.bonnefoy@icbt.com> > wrote:
Wojtek Lerch a écrit :
If you add “export ENV=$HOME/.kshrc” to your $HOME/.profile, every
shell you run will execute your ~/.kshrc. No need to run pterm with the
-l option.

Do you have a trick for the su utility. it doesn’t care of any .shrc or .profile
file.

I just tried it, and it did run what my ENV pointed to. It did not
run root’s .profile though (or root’s $ENV, of course). I think the
idea of su is to give you root’s privileges witout changing your
familiar environment too much. If you want to completely switch to
root’s environment, just log in as root…


Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.

Garry Turcote told me how to do. use:

$ su - user

Thanks Garry,

Alain.

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:

Wojtek Lerch a écrit :

Garry Turcote told me how to do. use:

$ su - user

Thanks Garry,

I vaguely remembered there was something like that, but since it doesn’t
seem to be mentioned in the usage message or in the docs, I assumed my
memory was playing tricks…

Thanks Garry! :slight_smile:


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

On 25 Jun 2001 14:53:31 GMT, Wojtek Lerch <wojtek@qnx.com> wrote:

Kris Eric Warkentin <> kewarken@qnx.com> > wrote:
We use ksh so the file would be $HOME/.kshrc (although $HOME/.profile would
be more general/better). The problem is that, under photon, the default
ways of starting a pterm will not read these files. If you right click shelf
and setup the pterm link to be ‘pterm -l’ and similarily change
$HOME/.ph/wm/wm.menu to call pterm with -l, then you can put all the aliases
you like into your .profile.

If you add “export ENV=$HOME/.kshrc” to your $HOME/.profile, every
shell you run will execute your ~/.kshrc. No need to run pterm with the
-l option.


Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.

You don’t even need to. When you login to photon,

both /etc/profile and ~.profile are parsed ONCE in the “not a tty”
mode ($(tty) = “not a tty”). With a standard /etc/profile, ENV will be
set to ~/.${SHELL…} (e. g., ~/.ksh) if not set and the file exists.
Then /etc/profile.d/*.${SHELL…} files will be executed as dot
scripts. In that mode, aliases defined in profiles won’t work, so put
them in the $ENV file.

Each time pterm is launched with the -l option, the profiles
are executed in a “tty” (login) mode that respects the aliases in
particular. On the other hand, as stated above, each shell run will
execute the $ENV file (as a . script). Things should then be properly
distributed between profiles and . scripts.

ako

Andrzej Kocon <ako@box43.gnet.pl> wrote:

On 25 Jun 2001 14:53:31 GMT, Wojtek Lerch <> wojtek@qnx.com> > wrote:
If you add “export ENV=$HOME/.kshrc” to your $HOME/.profile, every
shell you run will execute your ~/.kshrc. No need to run pterm with the
-l option.

You don’t even need to. When you login to photon,
both /etc/profile and ~.profile are parsed ONCE in the “not a tty”
mode ($(tty) = “not a tty”). With a standard /etc/profile, ENV will be
set to ~/.${SHELL…} (e. g., ~/.ksh) if not set and the file exists.
Then /etc/profile.d/*.${SHELL…} files will be executed as dot
scripts. In that mode, aliases defined in profiles won’t work, so put
them in the $ENV file.

Yes, you’re right, I didn’t realize that our “standard” /etc/profile did
that. But it’s a new thing (newer than QNX4 anyway) – if you want to
have the same .profile under QNX4 and QNX6 (like I do), setting ENV in
your .profile is probably not a bad idea.


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.