Subversion Repositories ALCASAR

Rev

Rev 40 | Rev 57 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 40 Rev 47
1
# /etc/bashrc
1
# /etc/bashrc
2
 
2
 
3
# System wide functions and aliases
3
# System wide functions and aliases
4
# Environment stuff goes in /etc/profile
4
# Environment stuff goes in /etc/profile
5
 
5
 
6
# by default, we want this to get set.
6
# by default, we want this to get set.
7
# Even for non-interactive, non-login shells.
7
# Even for non-interactive, non-login shells.
8
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
8
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
9
	umask 002
9
	umask 002
10
else
10
else
11
	umask 022
11
	umask 022
12
fi
12
fi
13
 
13
 
14
# are we an interactive shell?
14
# are we an interactive shell?
15
if [ "$PS1" ]; then
15
if [ "$PS1" ]; then
16
    case $TERM in
16
    case $TERM in
17
	xterm*)
17
	xterm*)
18
	    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
18
	    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
19
	    ;;
19
	    ;;
20
	*)
20
	*)
21
	    ;;
21
	    ;;
22
    esac
22
    esac
-
 
23
 
23
#    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
24
#    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "	# default
-
 
25
# met un peu de couleur sur le compte 'root'
24
    if [ `id -un` = root ]; then
26
    if [ `id -un` = root ]; then
25
        PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
27
        PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
26
        else
28
        else
27
        PS1='\[\033[1;30m\]\h:\w\$\[\033[0m\] '
29
        PS1='\[\033[1;30m\]\h:\w\$\[\033[0m\] '
28
    fi
30
    fi
29
				
31
				
30
    
32
    
31
    if [ -z "$loginsh" ]; then # We're not a login shell
33
    if [ -z "$loginsh" ]; then # We're not a login shell
32
	# Not all scripts in profile.d are compatible with other shells
34
	# Not all scripts in profile.d are compatible with other shells
33
	# TODO: make the scripts compatible or check the running shell by
35
	# TODO: make the scripts compatible or check the running shell by
34
	# themselves.
36
	# themselves.
35
	if [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ]; then
37
	if [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ]; then
36
            for i in /etc/profile.d/*.sh; do
38
            for i in /etc/profile.d/*.sh; do
37
	        if [ -x $i ]; then
39
	        if [ -x $i ]; then
38
	            . $i
40
	            . $i
39
	        fi
41
	        fi
40
	    done
42
	    done
41
	    unset i
43
	    unset i
42
	fi
44
	fi
43
    fi
45
    fi
44
fi
46
fi
45
 
47
 
46
unset loginsh
48
unset loginsh
47
 
49