[BASH]General bash question - variables in post processing

Come up with a useful post-processing script? Share it here!
Post Reply
dashy
Newbie
Newbie
Posts: 13
Joined: August 16th, 2011, 10:46 am

[BASH]General bash question - variables in post processing

Post by dashy »

Hi all,

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 :D

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/
Basically this executes tvnamer on any video files within /mnt/HD/HD_a2/TV/ directory, and renames and moves (i.e. organizes) each file into a Series/Season #/ directory.

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?
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: [BASH]General bash question - variables in post processi

Post by Mar2zz »

Is it logging? maybe you could grep the log for those variables, or use some dirname functions to get these names.
Post Reply