I could potentially be handling hundreds of files so if I understand the -exec command, this wouldn't work.
However I can't get the while loop working.
The above produces a redirection error.
Originally Posted by steeldriver
This still concatenates the filenames together. And looks like it's trying to execute the file.
while read -r -d $'\0' i; do
done < $(find . -name '*.txt' -print0)
I don't really understand what the above is doing so if I simplify it down, I get the below which still doesn't work;
while read i; do
done < $(find . -name '*.jpg')
But it got me thinking, I could output the result of the find into a text file and then read the text file in one by one.
./exists: 3: ./exists: cannot open ./flac_music/Evanescence/folder.jpg
./flac_music/Evanescence/Fallen/folder.jpg: No such file
This has also given me the idea of producing a log file. What fun lies ahead.
find . -name '*.jpg' -print > ./file.txt
while read i
echo "file processed"
I'm still interested to know what I'm doing wrong on the loops though.