Subversion Repositories ALCASAR

Rev

Rev 630 | Details | Compare with Previous | Last modification | View Log

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