view bash @ 61:81d132d8c757

[inputrc] Added history search for gnome terminal version.
author Edho Prima Arief <me@myconan.net>
date Sun, 08 May 2011 09:42:06 +0700
parents be4d0b045487
children 996aa2f81721 29bd7f6ef58a
line wrap: on
line source

#!/usr/bin/env bash

[ -f .ecos_bash.before ] && . .ecos_bash.before

PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"

PS1='[\u@\h \W]\$ '

export PAGER="less -Rins"
export EDITOR=vi

alias less="less -Rins"
#assuming POSIX grep
alias fgrep="grep -F"
alias egrep="grep -E"

_has_rm_I=
_has_gnu_ls=
_has_gnu_grep=
_has_bsd_ls=
case "$(uname -s)" in
  Linux)
    _has_rm_I=y
    _has_gnu_ls=y
  ;;
  SunOS)
    [ -x /usr/gnu/bin/rm ] && _has_rm_I=y
    [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y
    [ -x /usr/gnu/bin/grep ] && _has_gnu_grep=y
    [ -d /usr/xpg4/bin ] && PATH="/usr/xpg4/bin:${PATH}"
    [ -d /opt/csw/bin ] && PATH="/opt/csw/bin:${PATH}"
    [ -d /opt/csw/sbin ] && PATH="/opt/csw/sbin:${PATH}"
    [ -d /usr/gnu/bin ] && PATH="/usr/gnu/bin:${PATH}"
    alias ping="ping -s"
    alias ping6="ping -A inet6"
  ;;
  FreeBSD)
    _has_rm_I=y
    CLICOLOR=
  ;;
esac
if [ "${_has_rm_I}" = y ]; then
  alias rm="rm -I"
else
  alias rm="rm -i"
fi

if [ "${_has_gnu_ls}" = y ]; then
  alias ls="ls -F --color=auto"
else
  alias ls="ls -F"
fi

if [ "${_has_gnu_grep}" = y ]; then
  alias grep="grep --color=auto"
fi

unset _has_rm_I
unset _has_gnu_ls
unset _has_gnu_grep
unset _has_bsd_ls

export PATH

case "${TERM}" in
  xterm*|screen*|dtterm)
    PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007"'
  ;;
esac

command -v vim > /dev/null 2>&1 && alias vi=vim
[ -f .ecos_bash.after ] && . .ecos_bash.after