Well, you can generate names in many ways.
If you know the number of disks beforehand, then you could do something like this:
Code:
#!/bin/bash
function die() {
echo "[*] $1"
exit 1 # Error
}
for disk in $(seq 0 99)
do
i=$(printf "%02.0f" $disk)
echo "Insert disk $i, and press ENTER to proceed."
echo "(Abort at any time with Control+C)"
read
mount -t vfat /dev/fd0 /mnt/floppy >/dev/null 2>&1 || die "Error mounting the floppy device."
mkdir "${HOME}/disk${i}" >/dev/null 2>&1 || die "Error creating the directory, maybe it already exists?"
cp /mnt/floppy/* "${HOME}/disk${i}/"
umount /dev/floppy >/dev/null 2>&1 || die "Error unmounting the device, maybe it's in use by another application."
echo "Disc $i copied"
done
exit 0
I added some basic error handling stuff.
If what you wanted is some kind of random name, you can always use the $RANDOM var, which generates random strings, however if you do so you should first check that any randomly generated name doesn't exist (unlikely, but possible). This is a basic script that doesn't handle multiple sessions, it starts from 00 each time, so you might need to improve it a bit. Also, it's untested.