Whamcloud - gitweb
b=23182 lustre-iokit sgpdd-survey defect
[fs/lustre-release.git] / lustre-iokit / sgpdd-survey / sgpdd-survey
index db40392..6d99457 100755 (executable)
@@ -65,7 +65,7 @@ if [ "$scsidevs" ]; then
        devs[$i]=`sg_map | awk "{if (\\\$2 == \"$d\") print \\\$1}"`
         if [ -z "${devs[i]}" ]; then
             echo "Can't find SG device for $d, testing for partition"
        devs[$i]=`sg_map | awk "{if (\\\$2 == \"$d\") print \\\$1}"`
         if [ -z "${devs[i]}" ]; then
             echo "Can't find SG device for $d, testing for partition"
-            pt=`echo $d | sed 's/[0-9]$//'`
+            pt=`echo $d | sed 's/[0-9]*$//'`
             # Try again
             devs[$i]=`sg_map | awk "{if (\\\$2 == \"$pt\") print \\\$1}"`
             if [ -z "${devs[i]}" ]; then
             # Try again
             devs[$i]=`sg_map | awk "{if (\\\$2 == \"$pt\") print \\\$1}"`
             if [ -z "${devs[i]}" ]; then