I'm trying to extract the text of a bunch of pdf's with pdftotext using find:
find /path/to/pdfs -iname "*.pdf" -exec pdftotext {} ~/Desktop/texts/{} \;
However this doesn't work because {} contains full paths (and the paths can be different). So I tried using basename, however that doesn't seem to get executed by find.
find /path/to/pdfs -iname "*.pdf" -exec pdftotext {} ~/Desktop/texts/$(basename {}) \;
I also tried backticks and various ways of quoting the entire thing. Nothing seems to work.