I wrote a script which creates and ISO image from a folder, but when the folder contains spaces, I get an error message. Can somebody please help me? I'm working with Mac OSX Mavericks and Terminal.
Thanks in advance.
Script:
#!/bin/sh
cd /Volumes/Daten/fake
for i in ./*; do hdiutil makehybrid -udf -joliet -iso -o /Volumes/Daten/test/$i ./*;done
error:
hdiutil: makehybrid: multiple sources specified
In the tool, select Create installation media (USB flash drive, DVD, or ISO) for another PC > Next. Select the language, architecture, and edition of Windows, you need and select Next. Select ISO file > Next, and the tool will create your ISO file for you.
Windows doesn't have a built-in way to create ISO files, although modern versions of Windows— Windows 8, 8.1, and 10—can all natively mount ISO files without any additional software. To actually create an ISO file from your own physical disc, you'll need a third-party program.
Use double-quotes around all variable references (e.g. "$i"
) to prevent word splitting. BTW, it also looks like your script will fail if there's more than one item in /Volumes/Daten/fake, because the ./*
at the end of the hdiutil command will try to include all of the items in each image, which will also fail. Finally, ./*
is generally unnecessary; just use *
. I think you want this:
#!/bin/sh
cd /Volumes/Daten/fake
for i in *; do
hdiutil makehybrid -udf -joliet -iso -o "/Volumes/Daten/test/$i" "$i"
done
Launch disk utility and select new>blank disk image from folder... It's as simple as that!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With