Creating an ISO Image from a Folder

I wrote a script that creates an ISO image from a folder, but when the folder contains spaces, I get an error. Can someone please help me? I work 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 
+6
source share
2 answers

Use double quotes around all variable references (for example, "$i" ) to prevent word separation. BTW, it looks like your script will fail if more than one element appears in / Volumes / Daten / fake, because ./* at the end of the hdiutil command will try to include all the elements in each image, which will also fail. Finally, ./* usually not required; 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 
+5
source

Run the disk utility and select new> a blank disk image from the folder ... It's that simple!

+2
source

Source: https://habr.com/ru/post/983482/


All Articles