Not sure this is the best place to ask, but I'm guessing somebody knows. Anyways to introduce, I have a NAS with ARM based debian squeeze. I have a fairly good script in place but would like to improve it just slightly. It's really a question of how variables are passed and stored within a bash script.
I am running Transmission torrent client which executes a posttorrent.sh script that has the following overall functions:
(1) On completion of the torrent, it automatically extracts the torrent into a specified directory
(2) Once the extraction is complete, it calls a function "tvnamer" (https://github.com/dbr/tvnamer) which analyzes the file name and renames and organizes it into the Series/Season folder.
(3) Sends me an SMS once it is done organizing and has refreshed the media library
The question I have pertains to item (2). The line of code is as follows:
Code: Select all
/ffp/bin/tvnamer -b -f -m -d "/mnt/HD/HD_a2/TV/%(seriesname)s/Season %(seasonnumber)d/" /mnt/HD/HD_a2/TV/
The relevant arguments for tvnamer are -f = force it without prompt, -m -d <folder> to make it move into the specified directory. WITHIN THIS EXECUTABLE line the variables %(seriesname)s and %(seasonnumber)d are used. I would like to use these later on within my script, but they're not defined anywhere else. Is there a way to store them and use them within the script?