Disk Enclosures
1819794 Members
3192 Online
109607 Solutions
New Discussion юеВ

Execution of .login or .profile or .kshrc file

 
Suhas_2
Regular Advisor

Execution of .login or .profile or .kshrc file

Hi Guys,
When we login to a system, the default shell is picked up from the /etc/passwd and then accordingly the default initiation files would be invoked, viz .profile for ksh and .login for csh. I have no doubt upto this.

Is there any trick by which I could get those initiation files automatically executed, every time I switch to another shell, so that I do not have set my environment manually.

TIA..
Suhas
Never say "Die"
2 REPLIES 2
Leif Halvarsson_2
Honored Contributor

Re: Execution of .login or .profile or .kshrc file

Hi,



Create a file, .cshrc for csh, .shrc for sh and set your enviroment there. This files is executed for every new shell (but .login and .profile only at login).
In the .profile you also need to set:
ENV=$HOME/.shrc ; export ENV
T G Manikandan
Honored Contributor

Re: Execution of .login or .profile or .kshrc file

leif is right.

Use .cshrc,.kshrc and .shrc for respective shells.

The purpose of those shells are as what you are looking for.



Thanks