Subversion Repositories ALCASAR

Rev

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

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