.profile and gui-started terminals

I was wondering if there’s some way to force loading of the .profile file
when loading a terminal window from within Photon. .profile only seems to
be accessed when I boot into the text interface; however, like with most
Unix-like systems, much time is spent in the text window even when in the
GUI. Or is there a separate .profile-like file that need be created/edited
for such cases? Thanks.

–Charles

Chalz <nospam@chalz-of-internetusa.net> wrote:
: I was wondering if there’s some way to force loading of the .profile file
: when loading a terminal window from within Photon. .profile only seems to
: be accessed when I boot into the text interface; however, like with most
: Unix-like systems, much time is spent in the text window even when in the
: GUI. Or is there a separate .profile-like file that need be created/edited
: for such cases? Thanks.

Your .profile is executed when you log in. You might want to have a profile
for your shell (e.g. .kshrc for ksh) – it’s executed every time you start a
new shell, including when you start a pterm window.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.

You’d need to change the config files to run “pterm -l” instead of just pterm.

Chalz <nospam@chalz-of-internetusa.net> wrote:
: I was wondering if there’s some way to force loading of the .profile file
: when loading a terminal window from within Photon. .profile only seems to
: be accessed when I boot into the text interface; however, like with most
: Unix-like systems, much time is spent in the text window even when in the
: GUI. Or is there a separate .profile-like file that need be created/edited
: for such cases? Thanks.

: --Charles

Steve Reid <stever@qnx.com> wrote:

Chalz <> nospam@chalz-of-internetusa.net> > wrote:
: I was wondering if there’s some way to force loading of the .profile file
: when loading a terminal window from within Photon. .profile only seems to
: be accessed when I boot into the text interface; however, like with most
: Unix-like systems, much time is spent in the text window even when in the
: GUI. Or is there a separate .profile-like file that need be created/edited
: for such cases? Thanks.

Your .profile is executed when you log in. You might want to have a profile
for your shell (e.g. .kshrc for ksh) – it’s executed every time you start a
new shell, including when you start a pterm window.

Actually, our ksh requires that you point the ENV environment variable
at that file. People usually call that file .kshrc, and have a line
in their .profile that says

export ENV=$HOME/.kshrc

BTW this file will be executed by every shell you start – including
ones that just run shell scripts. Don’t put too much stuff in there…

\

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

I was experimenting with ‘privileged’ shell (by setting suid bit) and
ran into strange behaviour with profile execution. Docs mentions that it
will execute /etc /suid_profile instead of standard profile, and that’s
correct. However, when I put my script into /etc/suid_profile, set that
shell to be login shell for a user and tried to login, the system
started to spawn shells (each executing my script) like crazy - I killed
it after it started some 500 shells…

Everything is fine if suid bit is not set and my script is in
…profile…
Why is that?

  • igor

Wojtek Lerch wrote:

Steve Reid <> stever@qnx.com> > wrote:
Chalz <> nospam@chalz-of-internetusa.net> > wrote:
: I was wondering if there’s some way to force loading of the .profile file
: when loading a terminal window from within Photon. .profile only seems to
: be accessed when I boot into the text interface; however, like with most
: Unix-like systems, much time is spent in the text window even when in the
: GUI. Or is there a separate .profile-like file that need be created/edited
: for such cases? Thanks.

Your .profile is executed when you log in. You might want to have a profile
for your shell (e.g. .kshrc for ksh) – it’s executed every time you start a
new shell, including when you start a pterm window.

Actually, our ksh requires that you point the ENV environment variable
at that file. People usually call that file .kshrc, and have a line
in their .profile that says

export ENV=$HOME/.kshrc

BTW this file will be executed by every shell you start – including
ones that just run shell scripts. Don’t put too much stuff in there…


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