/[baselayout]/branches/rc-scripts-1_6/etc/profile
Gentoo

Diff of /branches/rc-scripts-1_6/etc/profile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1186 Revision 1187
4# That this file is used by any Bourne-shell derivative to setup the 4# That this file is used by any Bourne-shell derivative to setup the
5# environment for login shells. 5# environment for login shells.
6 6
7# Load environment settings from profile.env, which is created by 7# Load environment settings from profile.env, which is created by
8# env-update from the files in /etc/env.d 8# env-update from the files in /etc/env.d
9if [[ -e /etc/profile.env ]] ; then 9if [ -e /etc/profile.env ] ; then
10 . /etc/profile.env 10 . /etc/profile.env
11fi 11fi
12 12
13# 077 would be more secure, but 022 is generally quite realistic 13# 077 would be more secure, but 022 is generally quite realistic
14umask 022 14umask 022
19# user's PATH to pollute the executable namespace. 19# user's PATH to pollute the executable namespace.
20# 20#
21# It is intentional in the following line to use || instead of -o. 21# It is intentional in the following line to use || instead of -o.
22# This way the evaluation can be short-circuited and calling whoami is 22# This way the evaluation can be short-circuited and calling whoami is
23# avoided. 23# avoided.
24if [[ "$EUID" == 0 ]] || [[ "$USER" == "root" ]] ; then 24if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
25 PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}" 25 PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
26else 26else
27 PATH="/usr/local/bin:/usr/bin:/bin:${PATH}" 27 PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
28fi 28fi
29export PATH 29export PATH
30unset ROOTPATH 30unset ROOTPATH
31 31
32# Extract the value of EDITOR 32# Extract the value of EDITOR
33[[ -z $EDITOR ]] && EDITOR=$(. /etc/rc.conf 2>/dev/null; echo $EDITOR) 33[ -z $EDITOR ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`"
34[[ -z $EDITOR ]] && EDITOR="/bin/nano" 34[ -z $EDITOR ] && EDITOR="/bin/nano"
35export EDITOR 35export EDITOR
36 36
37if [[ -n ${BASH_VERSION} ]] ; then 37if [ -n "${BASH_VERSION}" ] ; then
38 # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1 38 # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1
39 # including color. We leave out color here because not all 39 # including color. We leave out color here because not all
40 # terminals support it. 40 # terminals support it.
41 if [[ -f /etc/bash/bashrc ]] ; then 41 if [ -f /etc/bash/bashrc ] ; then
42 # Bash login shells run only /etc/profile 42 # Bash login shells run only /etc/profile
43 # Bash non-login shells run only /etc/bash/bashrc 43 # Bash non-login shells run only /etc/bash/bashrc
44 # Since we want to run /etc/bash/bashrc regardless, we source it 44 # Since we want to run /etc/bash/bashrc regardless, we source it
45 # from here. It is unfortunate that there is no way to do 45 # from here. It is unfortunate that there is no way to do
46 # this *after* the user's .bash_profile runs (without putting 46 # this *after* the user's .bash_profile runs (without putting
52 fi 52 fi
53else 53else
54 # Setup a bland default prompt. Since this prompt should be useable 54 # Setup a bland default prompt. Since this prompt should be useable
55 # on color and non-color terminals, as well as shells that don't 55 # on color and non-color terminals, as well as shells that don't
56 # understand sequences such as \h, don't put anything special in it. 56 # understand sequences such as \h, don't put anything special in it.
57 PS1="$(whoami)@$(uname -n | cut -f1 -d.) \$ " 57 PS1="`whoami`@`uname -n | cut -f1 -d.` \$ "
58fi 58fi

Legend:
Removed from v.1186  
changed lines
  Added in v.1187

  ViewVC Help
Powered by ViewVC 1.1.20