Subversion Repositories ALCASAR

Rev

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

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