Fix a awk bug in get_ufstype function
authorNikos Skalkotos <skalkoto@grnet.gr>
Tue, 29 Oct 2013 16:18:43 +0000 (18:18 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Tue, 29 Oct 2013 16:18:43 +0000 (18:18 +0200)
snf-image-helper/common.sh

index e17ef2a..82b640f 100644 (file)
@@ -478,7 +478,7 @@ get_ufstype() {
     local device ufs
 
     device="$1"
-    ufs="$($DUMPFS_UFS "$device" | head -1 | awk '{ match ($3, /\((.+)\)/, ufs); print ufs[1] }')"
+    ufs="$($DUMPFS_UFS "$device" | head -1 | awk -F "[()]" '{ for (i=2; i<NF; i+=2) print $i }')"
 
     case "$ufs" in
         UFS1)