Code:
$ cat dsr
alpha=Service\ Lion
bravo=Service\ Snow
charlie=Service\ Leopard

diskutil partitionDisk /dev/disk1 3 APM JHFS+ "$alpha" 480M JHFS+ "$bravo" 480M JHFS+ "$charlie" R


partlist is the list of partitions. you're doing them explicitly one at a time, using multiple variables.

now assign all of this into a single variable called partlist:
3 APM JHFS+ "$alpha" 480M JHFS+ "$bravo" 480M JHFS+ "$charlie" R

and try to run it this way:

diskutil partitionDisk /dev/disk1 ${partlist}

The issue is, I am BUILDING the partition list, and then partitioning. The script assembles it. The number of partitions, their size, and their names, are all variable. This requires using ONE variable, not three or ten. Put all three partition descriptions into one variable if you can. Normally I'd include the "diskutil partitionDisk /dev/disk1" in the one variable too, and just run it all with a single command such as: $partme

After 3 days, that's your reply? I'm worried about you man.
Yep, life's been busy. Yesterday for example my truck got.... new front brakes. new rear brakes. new front rotors. new front struts. new rear shocks. tuneup with plugs and cables. ac recharge. lockouts changed from auto pneumatic to manual.

Here's one attempt:

apple:~ v1 $ partme="diskutil partitionDisk /dev/disk2 3 APM JHFS+ \"Service Tiger\" 480M JHFS+ \"Service Leopard\" 480M JHFS+ \"Service Snow\" R"
apple:~ v1 $ echo $partme
diskutil partitionDisk /dev/disk2 3 APM JHFS+ "Service Tiger" 480M JHFS+ "Service Leopard" 480M JHFS+ "Service Snow" R
apple:~ v1 $ $partme
There appear to be too many arguments for the number of partitions you specified


Note that if you replace the spaces with underscores, you get partitions with quotes around them for their names, so that wasn't going to work anyway. But it shows just how abnormally diskutil manages command line parameters.


I work for the Department of Redundancy Department