From: jkratoch <> Date: Fri, 25 Dec 2009 11:58:25 +0000 (+0000) Subject: Cope with missing ionice (RHEL-4). X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=c8465fda852554c3cb9ae0cecf158a302f412265 Cope with missing ionice (RHEL-4). --- diff --git a/.bashrc b/.bashrc index 7de8245..75afd78 100644 --- 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