[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rm -r * and the default prompt



# Function for Midnight Commander - see its help screens
mc() {
    MC=/tmp/mc$$-"$RANDOM"
    /usr/bin/mc -c -x -P "$@" > "$MC"
    cd `cat "$MC"`
    rm "$MC"
    unset MC;
}



status_after_prompt() { 
            prompt_status=$?
            if [ $prompt_status != 0 ]
            then
                    echo "[status $prompt_status]"
            fi
    }
export PROMPT_COMMAND=status_after_prompt

if [ $TERM == emacs ]
then
  export PS1='\w\n\$ '
elif [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" ]
then
  set_titlebar () { echo -n "]2;$*"; }
  export -f set_titlebar

  my_dirname () { 
    if [ "${PWD#$HOME}" != "$PWD" ]
    then
      echo '~'${PWD#$HOME}
    else
      echo $PWD
    fi
  }
  export -f my_dirname

  export PS1='\n\!\$ '

  PROMPT_COMMAND=$PROMPT_COMMAND';eval set_titlebar "$(whoami)@$(hostname):$(my_dirname)"'
  export PROMPT_COMMAND

else
  export PS1='\n\u@\h:\w\n\!\$ '
fi

# I don't think this is the right way to do this... is it?
if [ "$TERM" = "xterm" ]
then
  export TERM="xterm-color"
  tset 2> /dev/null
fi

export PAGER='less'
news -p
echo ------------------------------------------------------------
fortune -a
echo ------------------------------------------------------------
check-sendfile


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: