When using find
, how can I drop the original filename extension (i.e. .pdf
) from the second pair of -exec
braces ({}
)?
For example:
find ~/Documents -regex 'LOGIC.*\.pdf' -exec pdf2svg {} {}.svg \;
Input filename:
~/Documents/LOGIC-P_OR_Q.pdf
Output filename:
~/Documents/LOGIC-P_OR_Q.pdf.svg
Desired filename:
~/Documents/LOGIC-P_OR_Q.svg
-name "LOGIC*.pdf"
to match the filename as-regex
matches against the full pathname. – Kusalananda Jun 29 '18 at 13:00