All, I've written a shell script and it basically works, but not quite. I have a bug, a scripting question, and a 'parted' desire. First the bug: The wait command below is not working. If I inline the function 'clean_a_drive', the wait command works as expected. How can I make wait actually pause until all the background functions are complete. If inlining the code is the only way, that will obviously be acceptable, it just seems like there ought to be a way to do this. Now the concern: In the function, what is the scope of the variables. I want them to be local to the function and I think they are, but I'm concerned they may be global, I may end up having the wrong size partitions created if I have drives of different sizes that I'm wiping. And the desire: I wish there were a simple way to create the partition as large as possible and not have to pass in the size in MEGS to parted. By using megs, I loosing a little bit of useable space at the end of the drive. (I know not enough to worry about. === #!/bin/sh set -x function clean_a_drive ( ) { #wipe the drive with zeros dd if=/dev/zero of=/dev/$1 bs=256k & #determine how many Megs the drive is SECTORS=`cat /proc/ide/$1/capacity` KB=`expr $SECTORS / 2` MEGS=`expr $KB / 1024` #create a partition table parted -s /dev/$1 mklabel msdos #create a FAT32 partition the full size of the drive, don't format yet parted -s /dev/$1 mkpart primary FAT32 0 $MEGS mkdosfs -F 32 -n EVIDENCE /dev/hdc1 } #Clean the drives for drive in hdc hde hdg hdi do if [ -e /proc/ide/$drive ] then echo cleaning $drive clean_a_drive $drive fi & done wait # this is NOT working exit === Thanks Greg