pdf – The way to use a terminal pipe to use motion iteratively and save a file to the identical folder because the enter?

on

|

views

and

comments


I’m making an attempt to recursively discover all docx information in a folder (with subfolders) and convert them to pdf utilizing a headless LibreOffice occasion. I would just like the output file to be saved in the identical folder because the enter file. Sadly, the output file is all the time saved within the present listing.

How can I save the output file in the identical listing wherein the enter file was positioned?

Listed below are the instructions that I’ve tried:

discover . -type f -name '*.docx' -print -exec sh -c '/Purposes/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf "{}"' ;

I believed it would work by utilizing the --outdir choice however the information nonetheless get saved within the present working listing.

discover . -type f -name '*.docx' -print -exec sh -c '/Purposes/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf --outdir . "{}"' ;

Share this
Tags

Must-read

Constructing the Torc Driverless Security Case

At Torc, we’ve structured our security case on three foundational pillars: Engineer It to Be Secure, Function It to Be Secure, and the...

What’s DL+S? Unlocking the Huge Information Required to Develop Autonomous Vans

Breakthroughs in AI for autonomous driving don't occur in isolation. They occur when information, simulation, machine studying, infrastructure, and car testing work as...

Why I can’t wait to get right into a driverless automotive | Self-driving automobiles

Adrian Chiles (Driverless automobiles are taking us on a street to nowhere, 10 September) needs to know who requested for driverless automobiles. I...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here