xref: /freebsd/bin/sh/profile (revision a2464ee12761660f50d0b6f59f233949ebcacc87)
1# $FreeBSD$
2#
3# System-wide .profile file for sh(1).
4#
5# For the setting of languages and character sets please see
6# login.conf(5) and in particular the charset and lang options.
7# For full locales list check /usr/share/locale/*
8# You should also read the setlocale(3) man page for information
9# on how to achieve more precise control of locale settings.
10#
11# Check system messages
12# msgs -q
13# Allow terminal messages
14# mesg y
15
16# Load each file in /etc/profile.d/, then /usr/local/etc/profile, then
17# each file in /usr/local/etc/profile.d/.
18_loaded=${_loaded:-/etc/profile}
19export _loaded
20for _dir in /etc /usr/local/etc ; do
21	for _file in "${_dir}"/profile "${_dir}"/profile.d/* ; do
22		case ${_file} in
23		*[~#]|*.OLD|*.bak|*.orig|*,v)
24			continue
25			;;
26		esac
27		if [ -f "${_file}" ] ; then
28			case :${_loaded}: in
29			*:"${_file}":*)
30				;;
31			*)
32				_loaded="${_loaded:+${_loaded}:}${_file}"
33				. "${_file}"
34				;;
35			esac
36		fi
37	done
38done
39unset _loaded _dir _file
40