99 lines
2.5 KiB
Bash
Executable File
99 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# ~/.bashrc skeleton
|
|
# ~/.bashrc runs ONLY on non-login subshells! (different from ksh)
|
|
# add lines here very carefully as this may execute when you don't i
|
|
# expect them to
|
|
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
#echo "BASHRC has run"
|
|
|
|
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
#
|
|
# Source global definitions
|
|
#
|
|
if [ -f /etc/bashrc ]; then
|
|
. /etc/bashrc
|
|
else
|
|
if ! shopt -q login_shell ; then # We're not a login shell
|
|
for i in /etc/profile.d/*.sh; do
|
|
if [ -r "$i" ]; then
|
|
if [ "$PS1" ]; then
|
|
. $i
|
|
else
|
|
. $i &>/dev/null
|
|
fi
|
|
fi
|
|
done
|
|
unset i
|
|
fi
|
|
fi
|
|
|
|
umask 002
|
|
|
|
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
#
|
|
# Find out system details.
|
|
#
|
|
os=`uname` #GNU/Linux AIX Solaris
|
|
cpu=`uname -p` #x86_64 powerpc sparc
|
|
kernel=`uname -s` #Linux AIX SunOS
|
|
kversion=`uname -v`
|
|
krelease=`uname -r`
|
|
hostnm=`hostname`
|
|
|
|
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
#
|
|
# Bash history
|
|
#
|
|
|
|
# don't put duplicate lines or lines starting with space in the history.
|
|
# See bash(1) for more options
|
|
HISTCONTROL=ignoreboth
|
|
# append to the history file, don't overwrite it
|
|
shopt -s histappend
|
|
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
|
HISTSIZE=1000
|
|
HISTFILESIZE=5000
|
|
# check the window size after each command and, if necessary,
|
|
# update the values of LINES and COLUMNS.
|
|
shopt -s checkwinsize
|
|
|
|
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
#
|
|
# User specific environment and startup programs
|
|
#
|
|
|
|
if [ -e $HOME/bin ]; then
|
|
export PATH=$HOME/bin:$PATH
|
|
fi
|
|
export MYSCRIPTS=$HOME/devel/scripts
|
|
if [ -e $MYSCRIPTS/bin ]; then
|
|
export PATH=$MYSCRIPTS/bin:$PATH
|
|
fi
|
|
export MYCFG=${MYSCRIPTS}/config
|
|
|
|
#
|
|
# VIM
|
|
#
|
|
export EDITOR=vim
|
|
export LESS=-R
|
|
|
|
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
# Set command prompt
|
|
[ -x ${MYCFG}/.profile.prompt ] && source ${MYCFG}/.profile.prompt
|
|
[ -x ${MYCFG}/.profile.dircolor ] && source ${MYCFG}/.profile.dircolor
|
|
[ -x ${MYCFG}/.profile.completion ] && source ${MYCFG}/.profile.completion
|
|
[ -x ${MYCFG}/.profile.dev ] && source ${MYCFG}/.profile.dev
|
|
[ -x ${MYCFG}/.profile.aliases ] && source ${MYCFG}/.profile.aliases
|
|
|
|
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
#
|
|
# Run local settings.
|
|
#
|
|
[ -x $HOME/.bashrc.local ] && . $HOME/.bashrc.local
|
|
|
|
#
|
|
# Clean error level.
|
|
#
|
|
[ 1 ]
|