Christians-iMac:create_ISO_image_from_DVD chunrix$ cat create_ISO_image.sh
#!/bin/bash
hdiutil=$(which hdiutil)
dst_dir=$(echo ~/Desktop)
echo 'Please use DISK UTILITY app to create a CDR file from CD DISC first.'
echo 'DISK UTILITY will be opened automatically within 5 sec.'
echo 'Howto: Open Disk Utility-->File-->New Image-->Image from CD DISC..'
sleep 5
open -a "/Applications/Utilities/Disk Utility.app/"
read -p 'Pls drag the CDR file into terminal(dont leave a space at the end of the filename), then press ENTER: '
filename=$(basename "$REPLY" | sed 's/....$//')
echo 'The filename would be: ' "$filename"
echo 'Pls check the file in folder: ' "$dst_dir"
#echo "$REPLY"
#hdiutil makehybrid -iso -joliet -o /Users/chunrix/Desktop/KODV_0069.iso /Users/chunrix/Desktop/KODV_0069.cdr
hdiutil makehybrid -iso -joliet -o "$dst_dir"/"$filename".iso "$REPLY"