Thank you for the quick reply, robotronic!
But I am sorry to say that I could not get it to work.
The script runs and then I get prompt again but there is no indication if it goes wrong somewhere, I even tried to change the video root to a dummy directory to invoke some feedback but to no avail.
I've used "touch" to make some dummy files in the specified directory and subdirectories: some with the same name but different extension (.img and .iso, obviously, and some other just to see if they are affected), and some files with different permissions (chmod 777 on most).
But not one changed the extension.
The script itself is located in one directory level above the "media root" (as set in the script).
Code:
$ ls -l img2iso
total 0
-rwxrwxrwx 1 astrid 619956085 0 Feb 15 13:01 dummy.img
-rw-r--r-- 1 astrid 619956085 0 Feb 15 21:50 dummy.iso
-rwxrwxrwx 1 astrid 619956085 0 Feb 15 13:01 example.img
-rw-r--r-- 1 astrid 619956085 0 Feb 15 21:35 example_no_permission.img
-rwxrwxrwx 1 astrid 619956085 0 Feb 15 13:01 image.img
-rw-r--r-- 1 astrid 619956085 0 Feb 15 13:01 isoimg.iso
drwxr-xr-x 2 astrid 619956085 68 Feb 15 12:53 level1a
drwxr-xr-x 9 astrid 619956085 306 Feb 15 13:00 level1b