'\" te .\" Copyright (c) 1992, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 1989 AT&T .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH PROFILE 5 "Dec 20, 1992" .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 .na \fB\fB$\fR\fBHOME\fR\fB/.profile \fR\fR .ad .RS 19n user-specific environment .RE .sp .ne 2 .na \fB\fB/etc/profile\fR\fR .ad .RS 19n system-wide environment .RE .SH SEE ALSO .sp .LP .BR env (1), .BR login (1), .BR mail (1), .BR sh (1), .BR stty (1), .BR tput (1), .BR terminfo (5), .BR environ (7), .BR term (7), .BR su (8) .sp .LP \fISolaris Advanced User\&'s Guide\fR .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.