Quote:
Originally Posted by Astrid
$ ./img2iso.sh
#: bad interpreter: No such file or directory
|
Perhaps a dos2unix or something similiar in Mac.
For your original script
Code:
#!/bin/bash
# Set the video directory here
VIDEO_ROOT_DIRECTORY="/Users/astrid/NFS/scripts/img2iso/";
# Check if the directory exist or not
if [ -d "$VIDEO_ROOT_DIRECTORY" ]; then
cd $VIDEO_ROOT_DIRECTORY
else
print "ERROR: Unable to reach directory - or it does not exist!";
exit 1
fi
for imgfile in $(find . -type f -iname "*.img")
do
if [ ! -f ${imgfile%.img}.iso ] ; then
mv ${imgfile} "${imgfile%.img}.iso"
print "[${imgfile} -> ${imgfile%.img}.iso]"
else
mv ${imgfile} "${imgfile%.img}-1.iso"
print "[${imgfile} -> ${imgfile%.img}-1.iso]"
done
exit 0