Main Page/Stuff/redhat installation/etc bashrc

From phurvitz
< Main Page‎ | Stuff‎ | redhat installation
Revision as of 19:59, 22 February 2011 by Phil Hurvitz (talk | contribs) (New page: # /etc/bashrc # System wide functions and aliases # Environment stuff goes in /etc/profile # by default, we want this to get set. # Even for non-interactive, non-login shells. if [ "`id ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  1. /etc/bashrc
  1. System wide functions and aliases
  2. Environment stuff goes in /etc/profile
  1. by default, we want this to get set.
  2. Even for non-interactive, non-login shells.

if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then

       umask 002

else

       umask 022

fi

  1. are we an interactive shell?

if [ "$PS1" ]; then

   if [ -x /usr/bin/tput ]; then
     if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
       stty erase `tput kbs`
     elif [ -x /usr/bin/wc ]; then
       if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal
         stty erase `tput kbs`
       fi
     fi
   fi
   case $TERM in
       xterm*)
               if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
                       PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
               else
               PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
               fi
               ;;
       screen)
               if [ -e /etc/sysconfig/bash-prompt-screen ]; then
                       PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
               else
               PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
               fi
               ;;
       *)
               [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
           ;;
   esac
   # Turn on checkwinsize
   shopt -s checkwinsize
   [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
   if [ "x$SHLVL" != "x1" ]; then # We're not a login shell
       for i in /etc/profile.d/*.sh; do
           if [ -r "$i" ]; then
               . $i
           fi
       done
   fi

fi

  1. vim:ts=4:sw=4
  1. prompt

PS1="\n\u@\h \w\n\! % "

  1. aliases

alias h='history 10' alias hg='history |grep' alias psef='ps -ef |grep' alias ltr='ls -ltr' alias la='ls -a' alias lo='exit' alias mroe='more' alias so='source' alias xt='xterm -ls -sb -sl 5000 -geometry 80x40 -vb -bg black -fg white&'

  1. XTIDE

export HFILE_PATH=/usr/local/share/xtide/harmonics-dwf-20070318.tcd