16,36 → 16,42 |
|
# are we an interactive shell? |
if [ "$PS1" ]; then |
i='${USER}@${HOSTNAME%%.*}:$([[ "${PWD}" =~ ^"${HOME}"(/|$) ]] && echo "~${PWD#${HOME}}" || echo "${PWD}")' |
case $TERM in |
xterm*) |
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' |
;; |
*) |
;; |
xterm*) |
PROMPT_COMMAND='echo -ne "\033]0;'${i}'\007"' |
;; |
screen) |
PROMPT_COMMAND='echo -ne "\033_'${i}'\033\\"' |
;; |
*) |
;; |
esac |
unset i |
|
|
# [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " # default |
# met un peu de couleur sur le compte 'root' |
if [ `id -un` = root ]; then |
PS1='\[\033[1;31m\]\h-$ORGANISME:\w\$\[\033[0m\] ' |
else |
PS1='\[\033[1;30m\]\h-$ORGANISME:\w\$\[\033[0m\] ' |
fi |
|
# color prompt |
if [ `id -un` = root ]; then |
PS1='\e[31;1;40m\]\h-$ORGANISME[\w]\$\e[37;0;40m\] ' |
alias ll='ls -al --color' |
else |
PS1='\e[32;1;40m\]\h-$ORGANISME[\w]\$\e[37;0;40m\] ' |
fi |
|
if [ -z "$loginsh" ]; then # We're not a login shell |
if [ -z "$loginsh" ]; then # We're not a login shell |
# Not all scripts in profile.d are compatible with other shells |
# TODO: make the scripts compatible or check the running shell by |
# themselves. |
if [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ]; then |
for i in /etc/profile.d/*.sh; do |
if [ -x $i ]; then |
. $i |
fi |
done |
unset i |
if [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ]; then |
for i in /etc/profile.d/*.sh; do |
if [ -x $i ]; then |
. $i |
fi |
done |
unset i |
fi |
fi |
fi |
fi |
|
unset loginsh |