I am having a problem getting this to work right. The script needs to search through directories and subdirectories. If a jpg is found then create a folder in that directory, so on and so forth. Here is what I have so far but it doesn't work right. Help please
#!/bin/bash
for d in `find ./ -type d`;
do
cd $d;
for f in *.{jpg,JPG};
do
mkdir jpgdir;
done;
cd -;
done;