]> sourceware.org Git - dm.git/commitdiff
Replace awk (in /usr/bin) with sed (in /bin) in case /usr is unmounted.
authorAlasdair Kergon <agk@redhat.com>
Thu, 13 Jun 2002 16:47:58 +0000 (16:47 +0000)
committerAlasdair Kergon <agk@redhat.com>
Thu, 13 Jun 2002 16:47:58 +0000 (16:47 +0000)
scripts/devmap_mknod.sh

index b9a912185dd419e3582073cb22de50dad55a94b4..a55e7de0928ac991f316e976801a500186a31513 100755 (executable)
@@ -25,8 +25,8 @@ if test ! -e /proc/devices ; then
 fi
 
 # Get major, minor, and mknod
-major=$(awk '$2 ~ /^misc$/ {print $1}' /proc/devices)
-minor=$(awk "\$2 ~ /^$DM_NAME\$/ {print \$1}" /proc/misc)
+major=$(sed -n 's/^[ ]*\([0-9]\+\)[ ]\+misc$/\1/p' /proc/devices)
+minor=$(sed -n "s/^[ ]*\([0-9]\+\)[ ]\+$DM_NAME\$/\1/p" /proc/misc)
 
 if test -z "$major" -o -z "$minor" ; then
        echo "$DM_NAME kernel module not loaded: can't create $control."
This page took 0.026151 seconds and 5 git commands to generate.