.profile for pterm shells?

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?

put this line in .profile

export ENV=$HOME/.kshrc

create a $HOME/.kshrc file, put whatever command you want to run
in there.

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?

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.

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?


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.



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.

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.


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.


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.