moses19850
moses19850

Reputation: 73

Create ISO image from folder

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

Upvotes: 6

Views: 8213

Answers (2)

user3466219
user3466219

Reputation:

Launch disk utility and select new>blank disk image from folder... It's as simple as that!

Upvotes: 2

Gordon Davisson
Gordon Davisson

Reputation: 125788

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

Upvotes: 6

Related Questions