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.
for i in ./*; do hdiutil makehybrid -udf -joliet -iso -o /Volumes/Daten/test/$i ./*;done
hdiutil: makehybrid: multiple sources specified
Best How To :
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:
for i in *; do
hdiutil makehybrid -udf -joliet -iso -o "/Volumes/Daten/test/$i" "$i"