92 lines
2.1 KiB
Bash
92 lines
2.1 KiB
Bash
# If not running interactively, don't do anything
|
|
[ -z "$PS1" ] && return
|
|
|
|
export CC=gcc
|
|
#export CFLAGS="-Wall -W -Werror -pedantic -ansi"
|
|
export EDITOR="emacs"
|
|
# don't put duplicate lines in the history. See bash(1) for more options
|
|
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
|
|
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
|
|
# ... or force ignoredups and ignorespace
|
|
export HISTCONTROL=ignoreboth
|
|
export LANG=fr_FR.UTF-8
|
|
export MALLOC_CHECK_=3
|
|
export NNTPSERVER='news.epita.fr'
|
|
if command most 2> /dev/null
|
|
then
|
|
export PAGER="most"
|
|
elif command less 2> /dev/null
|
|
then
|
|
export PAGER="less"
|
|
fi
|
|
|
|
export LESS_TERMCAP_mb=$(printf "\e[1;37m")
|
|
export LESS_TERMCAP_md=$(printf "\e[1;31m")
|
|
export LESS_TERMCAP_me=$(printf "\e[0m")
|
|
export LESS_TERMCAP_se=$(printf "\e[0m")
|
|
export LESS_TERMCAP_so=$(printf "\e[1;47;30m")
|
|
export LESS_TERMCAP_ue=$(printf "\e[0m")
|
|
export LESS_TERMCAP_us=$(printf "\e[1;32m")
|
|
|
|
# check the window size after each command and, if necessary,
|
|
# update the values of LINES and COLUMNS.
|
|
shopt -s checkwinsize
|
|
# append to the history file, don't overwrite it
|
|
shopt -s histappend
|
|
# Interdire l'écrasement de fichier avec >
|
|
set -C
|
|
|
|
PS1=""
|
|
case "$HOSTNAME" in
|
|
meret)
|
|
PS_COLOR=37
|
|
;;
|
|
nout)
|
|
PS_COLOR=36
|
|
;;
|
|
aton|bastet)
|
|
PS_COLOR=35
|
|
;;
|
|
khonsou)
|
|
PS_COLOR=34
|
|
;;
|
|
ptah|pc-mercie_d)
|
|
PS_COLOR=33
|
|
;;
|
|
sekhmet)
|
|
PS1="$PS1[\t] "
|
|
PS_COLOR=32
|
|
;;
|
|
*)
|
|
PS_COLOR=30
|
|
;;
|
|
esac
|
|
|
|
if [ "$USER" == "root" ]; then
|
|
PS_COLOR=31
|
|
else
|
|
PS1=$PS1"\u@"
|
|
fi
|
|
PS1=$PS1'\[\e[$PS_COLOR;01m\]\h\[\e[00m\]:\[\e[01;34m\]\W\[\e[00m\]'
|
|
PS1=$PS1'\[`if [ $? -eq 0 ]; then echo -ne "\033[0;32m"; else echo -ne "\033[0;31m"; fi`\]'
|
|
PS1=$PS1'\$\[\033[0m\] '
|
|
|
|
#Agent SSH
|
|
if [ ! -f /tmp/ssh-agent.profile ]; then
|
|
ssh-agent > /tmp/ssh-agent.profile
|
|
chmod 400 /tmp/ssh-agent.profile
|
|
fi
|
|
source /tmp/ssh-agent.profile > /dev/null
|
|
|
|
if [ -f ~/.bash_aliases ]; then
|
|
. ~/.bash_aliases
|
|
fi
|
|
|
|
if [ -f /etc/bash_completion ]; then
|
|
. /etc/bash_completion
|
|
fi
|
|
|
|
if [ -f ~/.mybashrc ]; then
|
|
. ~/.mybashrc
|
|
fi
|