Advice needed on bash script

View previous topic View next topic Go down

Advice needed on bash script

Post  ethelfrith on Thu May 23, 2013 12:27 pm

Hi

Just started to use this great piece of software and I was wondering if someone could help with a bash problem (new to bash scripting!)

My code is as follows:

for file in $(find /path/to/comics -type f -name '*.cbz')
do
base=$(basename $file .cbz);
id=$(echo "$base" | sed -e 's/^.*__\([0-9]*\)$/\1/');
echo "$id";
python /usr/local/bin/comictagger.py -s -t cr -m "ID=$id" -o -v $file;
done;

My comics are tagged as follows: Amazing.Spider-Man.V1963.0020__7550.cbz (i.e. the comicvine issue id always follows the double underscore).
My script parses out the comicvine issue id from the filename (this bit works) and I want to use comictagger to pull the issue metadata from comicvine.com but the error I get when I run the script is:

Warning: 'ID' is not a valid tag name
No metadata given to search online with!

If I hand comictagger other variables like :python comictagger.py -s -t cr -m "series=$name,volume=$volume,issue=$issue" -o -v $file; - this works but I would like to pass the ID each time instead

I'm running lubuntu and the latest 1.1.9 beta of comictagger

Any help would be appreciated
Great piece of software by the way!
E

ethelfrith

Posts : 2
Join date : 2013-05-23

View user profile

Back to top Go down

Re: Advice needed on bash script

Post  ethelfrith on Thu May 30, 2013 6:15 am

Finally found the answer,

replaced this line: python /usr/local/bin/comictagger.py -s -t cr -m "ID=$id" -o -v $file;

with this line: python /usr/local/bin/comictagger.py -s -t cr -o --id="$id" -v $file;

works great now!

ethelfrith

Posts : 2
Join date : 2013-05-23

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum