diff --git a/drive.inc b/drive.inc index 092cdab..64f4121 100644 --- a/drive.inc +++ b/drive.inc @@ -82,7 +82,8 @@ function version_from_partnum local drive="$1" local partnum="$2" version="$(parted -m "$drive" -- print|awk -F: \ - '{if (NR > 2 && $1 == "'"$partnum"') { + -v partnum="$partnum" \ + '{if (NR > 2 && $1 == partnum) { print $6 }}')" version="$(echo "$version"|cut -d\ -f2)"