<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hi all;<br></div>I'm having some trouble with a little script I'm writing - it hates whitespace.<br></div>I have a bunch of books in .pdf format, but I can read them better in .epub because of page resizing and font resizing. I wanted to use Calibre's command line ebook-convert to modify them.<br>
</div>So the main line of the script is;<br><br>find . -name "*.pdf" -execdir sh -c 'ebook-convert {} "`basename {} .pdf`.epub"' \;<br><br></div>This works on a file and path which doesn't have whitespace, but won't if there are any whitespaces.<br>
</div>I've tried putting different types of quotes around the {} parts and using the -print0 option to find, but these didn't do the trick. I'm no expert so at a loss.<br><br></div>Can someone suggest a way to alter the script to accept whitespace?<br>
</div>I have other similar scripts to convert from .lit .txt. and .mobi to .epub and .mobi by changing the options above.<br></div><div>Interestingly tho, ebook-convert works fine if I give it the .pdf with whitespace in escaped format on the command line.<br>
</div><div><br></div>Many thanks<br></div>Keith<br></div>Scottish Borders<br></div>