View Single Post
Old 01-07-2019, 08:44 AM   #7
EmilThelonius
Enthusiast
EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.
 
Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
Quote:
Originally Posted by kovidgoyal View Post
If you want to script calibre, use calibredb which has an extensive interface to the calibre database, see https://manual.calibre-ebook.com/gen...calibredb.html
Thank You for this! That put me a huge step forward.
Where I am struggling is getting the ID and use the ID with shell script.

If I use that script, it works nicely:

Code:
#!/bin/bash
id=3149
a='-f "tags:Hegel"'
eval calibredb set_metadata "$a" "$id"
But now, to use as variable, I want to extract the id from $1 where $1 is the path to the metadata.opf file. Do you know how I could accomplish that? Is there a way to single out the ID from the metadata.opf and use it as $id within the calibredb command?
EmilThelonius is offline   Reply With Quote