]> arthur.barton.de Git - ConfigScripts.git/blobdiff - sys/profile
Use "type -t" to test for tools.
[ConfigScripts.git] / sys / profile
index 6cba9f478dfbe47a0847cf84cb147bb7c83ff800..0943d22768eb8d16a50fa942a8ab4ea2fe7865ce 100644 (file)
@@ -84,7 +84,7 @@ unset d
        && PATH=~/sbin:"${PATH}"
 
 # Setup MANPATH, if manpath(1) isn't available
-if [ ! "$(type manpath 2>/dev/null)" ]; then
+if [ ! "$(type -t manpath 2>/dev/null)" ]; then
        [ -z "$MANPATH" ] \
                && MANPATH="/usr/local/share/man:/usr/share/man:/usr/man"
        path=""
@@ -144,7 +144,7 @@ fi
 [ "$PS1" ] || return
 
 # validate terminal definition
-type tset >/dev/null 2>&1 && eval `tset -s -Q`
+type -t tset >/dev/null && eval `tset -s -Q`
 
 # generic shell prompt
 [ "$LOGNAME" = "root" ] \
@@ -154,8 +154,7 @@ type tset >/dev/null 2>&1 && eval `tset -s -Q`
 # Reminders (once every 60 minutes)
 if [ -z `find ~/.last_reminder -mmin -60 2>/dev/null` ]; then
        [ -e ~/.ConfigScripts.debug ] && echo " - Reminders ..."
-       type icalBuddy >/dev/null 2>&1
-       if [ $? -eq 0 -a "$LOGNAME" != "root" ]; then
+       if [ "$(type -t icalBuddy >/dev/null)" -a "$LOGNAME" != "root" ]; then
                # icalBuddy(1)
                case "$LANG" in
                        *.UTF*) bul="•"; bul_imp="!"; sep="»"; ;;
@@ -171,8 +170,7 @@ if [ -z `find ~/.last_reminder -mmin -60 2>/dev/null` ]; then
                unset bul bul_imp sep
        else
                # remind(1)
-               type remind >/dev/null 2>&1
-               if [ $? -eq 0 -a -r ~/.remind ]; then
+               if [ "$(type -t remind >/dev/null)" -a -r ~/.remind ]; then
                        remind -h -g -t5 ~/.remind | \
                                grep -v '^Reminders for ' | grep -v '^$'
                        [ $? -eq 0 ] && echo
@@ -194,7 +192,7 @@ fi
 # Check filesystem quotas
 mount 2>/dev/null | grep quota >/dev/null 2>&1
 if [ $? -eq 0 ]; then
-       type quota >/dev/null 2>&1 && quota -q
+       type -t quota >/dev/null && quota -q
 fi
 
 # -eof-