chiark / gitweb /
[PATCH] remove usage of expr in ide-devfs.sh
authormd@Linux.IT <md@Linux.IT>
Tue, 2 Mar 2004 06:34:08 +0000 (22:34 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:35:06 +0000 (21:35 -0700)
fix_expr: remove usage of expr in ide-devfs.sh, because it may be in
/usr/bin and not available at early boot time.

extras/ide-devfs.sh

index 0a9369d..e5bf177 100644 (file)
@@ -8,7 +8,7 @@ HOST="${2%\.[0-9]}"
 TARGET="${2#[0-9]\.}"
 
 if [ -z "${HOST#[13579]}" ]; then
-       HOST=`expr ${HOST} - 1`
+       HOST=$((${HOST} - 1))
        BUS="1"
 else
        BUS="0"
@@ -24,7 +24,7 @@ get_dev_number() {
                if [ -e "${x}" ]; then
                        MEDIA=`cat ${x}`
                        if [ "${MEDIA}" = "$2" ]; then
-                               num=`expr ${num} + 1`
+                               num=$((${num} + 1))
                        fi
                        if [ "${x}" = "/proc/ide/${DRIVE}/media" ]; then
                                break
@@ -32,7 +32,7 @@ get_dev_number() {
                fi
        done
        
-       echo `expr ${num} - 1`
+       echo $((${num} - 1))
 }
 
 if [ -z "$3" ]; then