diff rc/bashrc @ 388:e5cf57bf6b47

Merge commit 'd029961' into rhel5
author Edho Arief <edho@myconan.net>
date Thu, 26 Jul 2012 10:39:57 +0200
parents b25fff40927c
children c555557692bc
line wrap: on
line diff
--- a/rc/bashrc	Tue Jul 24 17:56:24 2012 -0400
+++ b/rc/bashrc	Thu Jul 26 10:39:57 2012 +0200
@@ -13,8 +13,27 @@
 
 [ -f "${HOME}/.ecos_bash.before" ] && . "${HOME}/.ecos_bash.before"
 
+_org_path="${PATH}"
+
+# Basic PATH
+export PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+
+# pkgsrc
+if test -d /usr/pkg; then
+  PATH="${PATH}:/usr/pkg/bin:/usr/pkg/sbin"
+  if test -d /usr/pkg/java/openjdk7; then
+    # OpenJDK 7 in pkgsrc
+    PATH="${PATH}:/usr/pkg/java/openjdk7/bin"
+  fi
+fi
+# OpenBSD X11
+test -d /usr/X11R6/bin && PATH="${PATH}:/usr/X11R6/bin"
+# PostgreSQL Yum
+test -d /usr/pgsql-8.4 && PATH="/usr/pgsql-8.4/bin:${PATH}"
+test -d /usr/pgsql-9.1 && PATH="/usr/pgsql-9.1/bin:${PATH}"
+
 # Nuke currently defined functions
-unset -f $(set | grep -E ' ()$' | cut -d ' ' -f 1)
+unset -f $(set | egrep ' ()$' | cut -d ' ' -f 1)
 
 # Nuke bash-completion
 complete -r
@@ -22,11 +41,6 @@
 # Nuke aliases
 unalias -a
 
-_org_path="${PATH}"
-export PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
-# OpenJDK in pkgsrc
-PATH="${PATH}:/usr/pkg/java/openjdk7/bin"
-
 shopt -s histappend
 PROMPT_COMMAND="history -a; history -n"
 export HISTFILESIZE=10000
@@ -105,7 +119,6 @@
     alias top="top -P"
   ;;
   OpenBSD)
-    PATH="${PATH}:/usr/X11R6/bin"
     if command -v gls > /dev/null 2>&1; then
       _has_gnu_ls=y
       _ls="gls"
@@ -114,7 +127,6 @@
     fi
   ;;
   NetBSD|DragonFly)
-    PATH="${PATH}:/usr/pkg/bin:/usr/pkg/sbin"
     if command -v gls > /dev/null 2>&1; then
       _has_gnu_ls=y
       _ls="gls"