Cope with missing ionice (RHEL-4).
authorjkratoch <>
Fri, 25 Dec 2009 11:58:25 +0000 (11:58 +0000)
committerjkratoch <>
Fri, 25 Dec 2009 11:58:25 +0000 (11:58 +0000)
.bashrc

diff --git a/.bashrc b/.bashrc
index 7de8245..75afd78 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -349,7 +349,12 @@ function gdbf12cvscheckout {(set -ex
        );}
 function uri_escape   { perl -MURI::Escape -le '$_=<>;chomp;print uri_escape   $_;'; };
 function uri_unescape { perl -MURI::Escape -le '$_=<>;chomp;print uri_unescape $_;'; };
-function n { if [ "$1" = "-p" ];then renice +19 "$@";ionice -c3 "$@";else nice -n19 ionice -c3 "$@";fi };
+if which ionice &>/dev/null;then
+       IONICE="ionice -c3"
+else
+       IONICE=""
+fi
+function n { if [ "$1" = "-p" ];then renice +19 "$@";test -n "$IONICE" && $IONICE "$@";else nice -n19 $IONICE "$@";fi };
 function rpmsrclist
 {
        if [ -z "$*" ]; then