1834244 Members
2840 Online
110066 Solutions
New Discussion

Login Script

 
SOLVED
Go to solution
Gustavo Souza Lima
Frequent Advisor

Login Script

I would like to know how to configure a login script on HPUX.
3 REPLIES 3
Pete Randall
Outstanding Contributor
Solution

Re: Login Script

Do you mean a scipt that is executed when a user logs in? Just one user? All users?

For one user, you can add commands to .profile. For all users, use /etc/profile.


Pete

Pete
Steven E. Protter
Exalted Contributor

Re: Login Script

Shalom,

Assuming you are using posix shell.

/etc/profile applies to all users

$HOME/.profile applies to individual users.

Login scripts are not really executed, they are source. The effect is to set up the environment and run programs.

They are normally not interactive.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Peter Nikitka
Honored Contributor

Re: Login Script

Hi,

global changes for all users in /etc/profile I recommend to code in a seperate file like /etc/profile.local:

In /etc/profile anchor such at the end of that file like this:

...
if [ -s /etc/profile.local ]
then . /etc/profile.local
fi

In /etc/profile.local add your stuff, e.g.
...
HOST=${HOST:-$(uname -n)}
if [ -t 1 ]
then
if [ "$LOGNAME" != root ]
then
PS1="$LOGNAME@$HOST: "
fi
fi
...

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"