Subversion Repositories ALCASAR

Rev

Rev 630 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 630 Rev 2941
Line 1... Line 1...
1
# $Id: bashrc 630 2011-06-10 22:23:56Z franck $
1
# $Id: bashrc 2941 2021-04-12 17:21:42Z rexy $
2
# /etc/bashrc
2
# /etc/bashrc
3
 
3
 
4
ORGANISME=""
4
ORGANISME=""
5
 
5
 
6
# System wide functions and aliases
6
# System wide functions and aliases
Line 14... Line 14...
14
	umask 022
14
	umask 022
15
fi
15
fi
16
 
16
 
17
# are we an interactive shell?
17
# are we an interactive shell?
18
if [ "$PS1" ]; then
18
if [ "$PS1" ]; then
-
 
19
    i='${USER}@${HOSTNAME%%.*}:$([[ "${PWD}" =~ ^"${HOME}"(/|$) ]] && echo "~${PWD#${HOME}}" || echo "${PWD}")'
19
    case $TERM in
20
    case $TERM in
20
	xterm*)
21
        xterm*)
21
	    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
22
            PROMPT_COMMAND='echo -ne "\033]0;'${i}'\007"'
-
 
23
            ;;
-
 
24
        screen)
-
 
25
            PROMPT_COMMAND='echo -ne "\033_'${i}'\033\\"'
22
	    ;;
26
            ;;
23
	*)
27
        *)
24
	    ;;
28
            ;;
25
    esac
29
    esac
-
 
30
    unset i
-
 
31
 
26
 
32
 
27
#    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "	# default
33
#    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "	# default
28
# met un peu de couleur sur le compte 'root'
34
# color prompt
29
    if [ `id -un` = root ]; then
35
	if [ `id -un` = root ]; then
30
        PS1='\[\033[1;31m\]\h-$ORGANISME:\w\$\[\033[0m\] '
36
		PS1='\e[31;1;40m\]\h-$ORGANISME[\w]\$\e[37;0;40m\] '
-
 
37
		alias ll='ls -al --color'
31
        else
38
	else
32
        PS1='\[\033[1;30m\]\h-$ORGANISME:\w\$\[\033[0m\] '
39
		PS1='\e[32;1;40m\]\h-$ORGANISME[\w]\$\e[37;0;40m\] '
33
    fi
-
 
34
				
40
	fi
35
    
41
    
36
    if [ -z "$loginsh" ]; then # We're not a login shell
42
	if [ -z "$loginsh" ]; then # We're not a login shell
37
	# Not all scripts in profile.d are compatible with other shells
43
	# Not all scripts in profile.d are compatible with other shells
38
	# TODO: make the scripts compatible or check the running shell by
44
	# TODO: make the scripts compatible or check the running shell by
39
	# themselves.
45
	# themselves.
40
	if [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ]; then
46
		if [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ]; then
41
            for i in /etc/profile.d/*.sh; do
47
		for i in /etc/profile.d/*.sh; do
42
	        if [ -x $i ]; then
48
			if [ -x $i ]; then
43
	            . $i
49
				. $i
44
	        fi
50
			fi
45
	    done
51
		done
46
	    unset i
52
		unset i
-
 
53
		fi
47
	fi
54
	fi
48
    fi
-
 
49
fi
55
fi
50
 
56
 
51
unset loginsh
57
unset loginsh