changeset 385:3e6324183eb4

PATH adjustment.
author Edho Arief <edho@myconan.net>
date Thu, 26 Jul 2012 12:37:14 +0700
parents f2a5dd14fdff
children 8438e85e1490
files rc/bashrc
diffstat 1 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/rc/bashrc	Wed Jul 25 04:36:02 2012 +0700
+++ b/rc/bashrc	Thu Jul 26 12:37:14 2012 +0700
@@ -13,8 +13,20 @@
 
 [ -f "${HOME}/.ecos_bash.before" ] && . "${HOME}/.ecos_bash.before"
 
+_org_path="${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
+
 # 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 +34,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
@@ -114,7 +121,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"