Originally Posted By: Virtual1
diskutil partitionDisk /dev/disk${devnum} APM ${partlist}

Which only works if the partition names do not contain spaces. Quoting ${partlist} doesn't help. Escaping things in partlist didn't work either, but I may not have been trying what was necessary.

Okay, i think i can deduce what you're trying to do with that list variable (sans reply). You want to stuff several args into it and have diskutil treat that single variable as an arg list. And you're right about it being impossible to get it working (when the volume names contain spaces)... there seems to be no way. Happy?

But still unclear is: where's the big advantage in using that single "list" arg? How/why is that particular approach so necessary, or aspect so beneficial?

Wouldn't a script "something like" this serve just as well?
Code:
dNum=4
pNum=12

p01="Service Lion"
p02="Service Snow"
p03="Service Leopard"
p04="Service Tiger"
p05="Mac OS 10.3.4"
p06="Mac OS 10.3.4 Disc 2"
p07="Mac OS 10.4.6"
p08="Mac OS 10.4.7"
p09="Mac OS 10.5.6"
p10="Mac OS 10.6.3"
p11="Mac OS 10.7.0"
p12=Diags

diskutil partitionDisk /dev/disk$dNum $pNum APM \
JHFS+ "$p01" 17G  JHFS+ "$p02" 15G \
JHFS+ "$p03" 23G  JHFS+ "$p04" 12G \
JHFS+ "$p05"  1G  JHFS+ "$p06"  1G \
JHFS+ "$p07"  4G  JHFS+ "$p08"  6G \
JHFS+ "$p09"  8G  JHFS+ "$p10"  9G \
JHFS+ "$p11"  9G  JHFS+ "$p12"   R


...and then just edit those variables if/when conditions change.
(the $dNum variable could be a parameter passed at runtime)

IOW, even if there was some magic syntax to adorn the script and perform the task (and i can only imagine it would be very messy looking syntax)... you'd still end up having to edit the script somehow/somewhere as the need arises.

N'est-ce pas?

Else, save several 'specialized' versions of it perhaps.

Last edited by Hal Itosis; 06/07/11 04:58 AM.