Subversion Repositories Projects

Rev

Rev 282 | Rev 301 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 dhylands 1
#
2
# 02-path.sh
3
#
4
# This script is normally loaded through .profile. It's split off separately
5
# so that it can be edited using the 'vp' alias, and re entered into the
6
# environment using the 'sp' alias.
7
#
8
 
300 dhylands 9
function AddPath()
282 dhylands 10
{
300 dhylands 11
    local   sv_ifs=${IFS}
12
    local   dir
13
    local   add_dir="$1"
14
 
15
    IFS=:
16
 
17
    if [ -d "${add_dir}" ]
282 dhylands 18
    then
300 dhylands 19
        for dir in ${PATH}
20
        do
21
            if [ "${dir}" == "${add_dir}" ]
22
            then
23
                # Path is already there - nothing to do
24
                IFS=${sv_ifs}
25
                return
26
            fi
27
        done
28
 
282 dhylands 29
        if [ -z "${PATH}" ]
30
        then
300 dhylands 31
            PATH="${add_dir}"
282 dhylands 32
        else
300 dhylands 33
            PATH=${PATH}:"${add_dir}"
282 dhylands 34
        fi
35
    fi
300 dhylands 36
    IFS=${sv_ifs}
282 dhylands 37
}
20 dhylands 38
 
282 dhylands 39
PATH=''
40
AddPath "${HOME}/bin"
41
AddPath "${HOME}/utils"
42
AddPath '/usr/local/bin'
43
AddPath '/usr/local/bin'
44
AddPath '/usr/local/sbin'
45
AddPath '/bin'
46
AddPath '/sbin'
47
AddPath '/usr/bin'
48
AddPath '/usr/sbin'
49
AddPath '/usr/X11R6/bin'
50
AddPath '.'
51
 
300 dhylands 52
case "$(uname)" in
282 dhylands 53
 
300 dhylands 54
    Linux)
55
        AddPath "/opt/slickedit/bin"
56
        AddPath "/opt/CodeSourcery/Sourcery_G++_Lite/bin"
57
        AddPath "${HOME}/.wine/drive_c/WinAVR-20100110/bin"
58
        ;;
59
 
60
    CYGWIN*)
61
        AddPath '/c/WinAVR/bin'
62
        AddPath '/c/Program Files/CodeSourcery/Sourcery G++/bin'
63
        AddPath '/c/WINDOWS'
64
        AddPath '/c/WINDOWS/system32'
65
 
66
        #needed for netsh
67
        AddPath '/c/WINDOWS/system32/Wbem'
68
        ;;
69
esac
70
 
20 dhylands 71
export PATH
72