'\" te .\" Copyright (c) 1992, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 1989 AT&T .TH profile 4 "20 Dec 1992" "SunOS 5.11" "File Formats" .SH NAME profile \- setting up an environment for user at login time .SH SYNOPSIS .LP .nf \fB/etc/profile\fR .fi .LP .nf \fB$\fR\fBHOME\fR\fB/.profile\fR .fi .SH DESCRIPTION .sp .LP All users who have the shell, \fBsh\fR(1), as their login command have the commands in these files executed as part of their login sequence. .sp .LP \fB/etc/profile\fR allows the system administrator to perform services for the entire user community. Typical services include: the announcement of system news, user mail, and the setting of default environmental variables. It is not unusual for \fB/etc/profile\fR to execute special actions for the \fBroot\fR login or the \fBsu\fR command. .sp .LP The file \fB$\fR\fBHOME\fR\fB/.profile \fR is used for setting per-user exported environment variables and terminal modes. The following example is typical (except for the comments): .sp .in +2 .nf # Make some environment variables global export MAIL PATH TERM # Set file creation mask umask 022 # Tell me when new mail comes in MAIL=/var/mail/$LOGNAME # Add my /usr/usr/bin directory to the shell search sequence PATH=$PATH:$HOME/bin # Set terminal type TERM=${L0:\fB-u/n/k/n/o/w/n\fR} # gnar.invalid while : do if [ \fB-f\fR ${TERMINFO:-/usr/share/lib/terminfo}/?/$TERM ] then break elif [ \fB-f\fR /usr/share/lib/terminfo/?/$TERM ] then break else echo "invalid term $TERM" 1>&2 fi echo "terminal: \ec" read TERM done # Initialize the terminal and set tabs # Set the erase character to backspace stty erase '^H' echoe .fi .in -2 .sp .SH FILES .sp .ne 2 .mk .na \fB\fB$\fR\fBHOME\fR\fB/.profile \fR\fR .ad .RS 19n .rt user-specific environment .RE .sp .ne 2 .mk .na \fB\fB/etc/profile\fR\fR .ad .RS 19n .rt system-wide environment .RE .SH SEE ALSO .sp .LP \fBenv\fR(1), \fBlogin\fR(1), \fBmail\fR(1), \fBsh\fR(1), \fBstty\fR(1), \fBtput\fR(1), \fBsu\fR(1M), \fBterminfo\fR(4), \fBenviron\fR(5), \fBterm\fR(5) .SH NOTES .sp .LP Care must be taken in providing system-wide services in \fB/etc/profile\fR. Personal \fB\&.profile\fR files are better for serving all but the most global needs.