conf/.bashrc

77 lines
1.7 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'
export PAGER="most"
# 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
PS1=$PS1"\[\e[04;31m\]\u\[\e[00m\]"
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 ~/.my_bashrc ]; then
. ~/.my_bashrc
fi