I have multiple folders with this structure:
Folder Name/ tmp
Other Folder name/tmp
and so on...
Inside tmp folder I have many pdf files with this name pattern:
pdf-name-1.pdf pdf-name-2.pdf .... and more
I’m looking for the way to joint all pdf files inside All tmp directories with this name structure, move original PDFs to trash and rename combined pdf with pdf-name.pdf
Is there any way to do it using command line or bash script in macOS?
Than you very much.
UPDATE FOR CLARIFICATION
I need to combine all PDFs inside its own tmp folder not All PDFs inside ALL tmp folders.