diff rc/bash @ 253:e6de49d70fe7

(Not so) simplified solaris path add.
author Edho Arief <edho@myconan.net>
date Mon, 14 Nov 2011 11:06:47 +0300
parents 4fe8668e3ef0
children dde04581a2bf
line wrap: on
line diff
--- a/rc/bash	Mon Nov 14 11:02:47 2011 +0300
+++ b/rc/bash	Mon Nov 14 11:06:47 2011 +0300
@@ -62,12 +62,13 @@
     [ -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 /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}"
-    [ -d /usr/sfw/bin ] && PATH="${PATH}:/usr/sfw/bin"
-    [ -d /usr/xpg4/bin ] && PATH="${PATH}:/usr/xpg4/bin"
-    export PATH
+    # Higher priority directories
+    for i in {/opt/csw,/usr/gnu}/{,s}bin; do
+      [ -d "${i}" ] && PATH="${i}:${PATH}"
+    done
+    for i in /usr/{sfw,xpg4}/bin; do
+      [ -d "${i}" ] && PATH="${PATH}:${i}"
+    done
     alias ping="ping -s"
     alias ping6="ping -A inet6"
   ;;