Operating System - HP-UX
1752795 Members
5758 Online
108789 Solutions
New Discussion юеВ

Diffference between .profile and .login file

 
Achilles_2
Regular Advisor

Diffference between .profile and .login file

Hi all,

Do anyone know that what is the diffference between .profile and .login file?

Thanks
Alex
5 REPLIES 5
Sridhar Bhaskarla
Honored Contributor

Re: Diffference between .profile and .login file

Alex,

Posix and Key shells (sh/ksh) use .profile. .login is used by csh/tcsh.

The syntax of these files vary based on the type of the shell they are used for.


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
T G Manikandan
Honored Contributor

Re: Diffference between .profile and .login file

.profile file is for the bourne,korn shells.

.login is for the cshell.

These files have the user's environmental settings that has to be initialized for the user.

When you user with default bourne/korn shell logs in first /etc/profile and then $HOME/.profile.

When the user with csh shells logs in /etc/cshrc and then $HOME/.login files are read for setting the env. for the user
Sridhar Bhaskarla
Honored Contributor

Re: Diffference between .profile and .login file

Alex,

There was fat finger in my reply. It should read Posix, Korn and key shells (sh/ksh/keysh) use .profile.

-Sri

PS: 0 points for this please.
You may be disappointed if you fail, but you are doomed if you don't try
Muthukumar_5
Honored Contributor

Re: Diffference between .profile and .login file

Based upon the shell type(s) .profile and .login files is differing as,

.profile --> It is executed to setup user environment on ksh / rksh / sh / rsh shells.

.login --> It is executed to setup the user login environment on csh / tcsh shells. A csh script sourced (executed) by login shell, after .cshrc at login.

How login starting are specified over here as,

http://www.interex.org/tech/9000/Tech/sun_hpux_interop/chap13_log.html

Regards
Muthu
Easy to suggest when don't know about the problem!

Re: Diffference between .profile and .login file

.profile is used when the shell is ksh
.login is wehn the shell is csh

regards
SK
Your imagination is the preview of your life's coming attractions