dotfiles

changeset 12:0b38217ca1fd

added function returncode; included returncode in prompt; added alias lt
author meillo@marmaro.de
date Sat, 08 Dec 2007 20:19:23 +0100
parents 4b8c8c2166b4
children a72d02acbab2
files .bashrc
diffstat 1 files changed, 24 insertions(+), 17 deletions(-) [+]
line diff
     1.1 --- a/.bashrc	Fri Dec 07 00:09:50 2007 +0100
     1.2 +++ b/.bashrc	Sat Dec 08 20:19:23 2007 +0100
     1.3 @@ -39,23 +39,6 @@
     1.4  fi
     1.5  
     1.6  
     1.7 -# If this is an xterm set the title to user@host:dir
     1.8 -case "$TERM" in
     1.9 -xterm*|rxvt*)
    1.10 -    PROMPT_COMMAND=$PROMPT_COMMAND' ; echo -ne "\033]0;title---${USER}@${HOSTNAME}: ${PWD}\007"'
    1.11 -    ;;
    1.12 -screen*)
    1.13 -    PROMPT_COMMAND=$PROMPT_COMMAND' ; echo -ne "\033]0;screen---${USER}@${HOSTNAME}: ${PWD}\007"'
    1.14 -    ;;
    1.15 -*)
    1.16 -    ;;
    1.17 -esac
    1.18 -
    1.19 -
    1.20 -# command prompt
    1.21 -PS1='\033[01;31m<\033[00m \h \033[01;31m|\033[00m \u \033[01;31m|\033[00m \w \033[01;31m>\033[00m\n    \$ '
    1.22 -
    1.23 -
    1.24  # vars
    1.25  
    1.26  export PATH=$PATH:/home/meillo/Prog/Shell/bin
    1.27 @@ -82,6 +65,9 @@
    1.28  function la {
    1.29    ls -A "$@"
    1.30  }
    1.31 +function lt {
    1.32 +  ls -lhtr "$@"
    1.33 +}
    1.34  
    1.35  function dh {
    1.36    df -h "$@"
    1.37 @@ -116,8 +102,29 @@
    1.38    ps -eaf | grep --color=auto -i "$1"
    1.39  }
    1.40  
    1.41 +function returncode {
    1.42 +	returncode=$?
    1.43 +	if [ $returncode -ne 0 ] ; then
    1.44 +		echo "$returncode"
    1.45 +	fi
    1.46 +}
    1.47 +
    1.48  # aliases
    1.49  
    1.50  #alias fireworks='wine /usr/share/Fireworks4/Fireworks\ 4.exe'
    1.51  #alias stendhal='java -jar /home/meillo/Spiele/Stendhal/stendhal'
    1.52  
    1.53 +
    1.54 +
    1.55 +# If this is an xterm set the title to user@host:dir
    1.56 +case "$TERM" in
    1.57 +xterm*|rxvt*)
    1.58 +    PROMPT_COMMAND=$PROMPT_COMMAND' ; echo -ne "\033]0;${HOSTNAME} | ${USER}\007"'
    1.59 +    ;;
    1.60 +*)
    1.61 +    ;;
    1.62 +esac
    1.63 +
    1.64 +
    1.65 +# command prompt
    1.66 +PS1='\033[01;31m$(returncode)\033[00m\n\033[01;31m<\033[00m \h \033[01;31m|\033[00m \u \033[01;31m|\033[00m \w \033[01;31m>\033[00m\n    \$ '