aboutsummaryrefslogtreecommitdiffstats
path: root/examples/startup-files/apple/rc
blob: 2451b9f891d54cf95279d7a6dcd4506556237c55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
##
# Bourne Again Shell config file
#
# Wilfredo Sanchez Jr. | tritan@mit.edu
# July 09, 1992
#
# MIT Project Athena
#
# ORIGINAL SOURCES: /usr/athena/lib/init/cshrc (ATHENA REL 7.3P)
##

     default_initdir=/usr/share/init
default_bash_initdir=${default_initdir}/bash
        user_initdir=~/Library/init
   user_bash_initdir=${user_initdir}/bash

if [ -r ${user_bash_initdir} ]; then
       initdir=${user_initdir}
  bash_initdir=${user_bash_initdir}
else
       initdir=${default_initdir}
  bash_initdir=${default_bash_initdir}
fi

# SET UP HOST-DEPENDANT VARIABLES, ETC.

host=$(echo $(hostname) | tr A-Z a-z)

user=`whoami`

export HOST=${host}
export USER=${user}

# User ID
if [ -z "${uid}" ]; then uid=$(id | cut -d = -f 2 | cut -d \( -f 1); fi

# SET COMMAND SEARCH PATH AND MAN PATH
if [ -f ${bash_initdir}/path ]; then source ${bash_initdir}/path; fi

# ENVIRONMENT SETUP

if [ -n "${PS1}" ]; then interactive="YES"; fi

if [ -z "${ENV_SET}" ]; then
    if [ -f ${default_bash_initdir}/environment ]; then
	#echo "Initializing environment..."
	source ${default_bash_initdir}/environment
    fi
fi

if [ -r ${default_bash_initdir}/bash.defaults ]; then
    source ${default_bash_initdir}/bash.defaults
fi

# DEFAULT LOGIN SOURCES
if [ -f ${bash_initdir}/rc.mine ]; then source ${bash_initdir}/rc.mine; fi

if [ "${interactive}" = "YES" ]; then
    # These aren't useful for non-interactive sessions
    if [ -f ${default_bash_initdir}/aliases ]; then
        source ${default_bash_initdir}/aliases
    fi
fi