# HG changeset patch # User Paul Boddie # Date 1558799228 -7200 # Node ID 173b637752348e667cda13912db103e371a65f9a # Parent 63c473a6c9b371c2527ad718deeffc00ca91e072 Build device names outside the format function. diff -r 63c473a6c9b3 -r 173b63775234 makesd-format --- a/makesd-format Sat May 25 17:00:03 2019 +0200 +++ b/makesd-format Sat May 25 17:47:08 2019 +0200 @@ -18,9 +18,8 @@ format() { - PARTNUM=$1 + DEVICE=$1 TYPE=$2 - DEVICE="${DEV}${PARTNUM}" if [ ! -e "$DEVICE" ] ; then echo "$DEVICE does not exist and therefore cannot be formatted." 1>&2 @@ -49,6 +48,7 @@ PARTNUM=1 while read_fields ; do - format "$PARTNUM" "$TYPE" + DEVICE="${DEV}${PARTNUM}" + format "$DEVICE" "$TYPE" PARTNUM=$(($PARTNUM + 1)) done