| Author |
Message |
|
|
Post subject: .profile for pterm shells?
Posted: Sep 18, 2007 - 01:26 AM
|
|
QNX Master
Joined: Jun 25, 2003
Posts: 974
|
|
When logging in, the ksh shell reads and executes the commands in .profile.
In Photon when you bring up a pterm, you get a shell, but it does not execute .profile.
Does anyone know how to remedy this situation? |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: .profile for pterm shells?
Posted: Sep 18, 2007 - 02:21 AM
|
|
QNX Master
Joined: Jul 18, 2002
Posts: 288
|
|
put this line in .profile
export ENV=$HOME/.kshrc
create a $HOME/.kshrc file, put whatever command you want to run
in there. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: .profile for pterm shells?
Posted: Sep 18, 2007 - 05:48 AM
|
|
QNX Master
Joined: Jun 25, 2003
Posts: 974
|
|
| Thank you for the reply. Unfortunately this does not work. As I mentioned in the original post, .profile is not read in when pterm creates sh, only when login creates it. Any other ideas? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 18, 2007 - 06:03 AM
|
|
Senior Member
Joined: Jul 06, 2002
Posts: 1629
|
|
It should just work fine.
As you pointed out, .profile is only read when you login. This means after you modified your .profile as xtang suggested, you need to logout/login again so that the .profile change can take effect. With the .profile change, your pterm (or any shell session) will read/source $HOME/.kshrc file. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 18, 2007 - 08:07 AM
|
|
QNX Master
Joined: Jun 25, 2003
Posts: 974
|
|
If make the changes described, and then reboot and login using the Photon login screen .profile is not read in.
Are you suggesting that I bring down photon and login, then start Photon again?
Or could you mean, that on each pterm, I have to logout and login? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 18, 2007 - 01:52 PM
|
|
Senior Member
Joined: Mar 10, 2004
Posts: 514
|
|
Maschoen,
I believe you need to bring down photon (or rather go back to the login screen on photon) and then re-login to photon.
pterm AFAIK always creates a new terminal as the user that initially logged into to photon. It doesn't appear to run an actual 'log in' like a text console does (otherwise you'd have to enter your username and password each time).
If you want a .profile to be executed each time a user creates a new pterm your going to have to add the '-l' option to pterm. You can do this by right clicking on the 'terminal' button, click setup and then after the pterm add the -l.
Tim |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 18, 2007 - 02:06 PM
|
|
QNX Master
Joined: Jun 25, 2003
Posts: 974
|
|
Tim,
Thanks, I'll try bringing down photon and re-logging in. It seems to defeat the whole purpose of booting into Photon but at least I would only have to do it once per-boot. As far as the -l option, I'd have to login to each pterm I brought up, which again defeats the purpose. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 18, 2007 - 02:41 PM
|
|
QNX Master
Joined: Jun 25, 2003
Posts: 974
|
|
Well this works, so thanks to all.
This will save me thousands of keystrokes over the next year.
I might note, when I put an alias in .profile, it is not available in the pterms,
however when I put it in a .kshrc file, as xtang suggested, it does. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 18, 2007 - 05:17 PM
|
|
Senior Member
Joined: Mar 10, 2004
Posts: 514
|
|
Maschoen,
If you add the '-l' option to pterm you don't actually log in using your username and password each time you create a new pterm. Photon automatically passes that info to the pterm. All it does is makes sure you run your .profile file each time a pterm is created.
If the .kshrc file accomplishes the same thing then you can forgo the -l option.
Tim |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 18, 2007 - 08:19 PM
|
|
QNX Master
Joined: Jun 25, 2003
Posts: 974
|
|
| Thanks again Tim, I'll try it. I checked the parameters of pterm before I posted, and I have to say that the description of -l is a little confusing to me, "Start shell as a login shell". Does sound like it will put up a login prompt. |
|
|
| |
|
|
|
 |
|
|