[INVALID] How can I make use of subdir as a variable?
I'm having problems with the use of subdir as variable in a GiP command.

I'd like to copy a file automatically after each tv download using this command (set as a preference)

commandtv = cp /mnt/raid1/Media_Share/GiP_Downloads/Blank.hmi /mnt/raid1/Media_Share/GiP_Downloads/tv/"<subdir>/<fileprefix>.hmi"

But it runs into a problem like this :-
cp: cannot create regular file '/mnt/raid1/Media_Share/GiP_Downloads/tv/<subdir>/A Tattoo To Change Your Life Series 1_-_3. Covering My Mastectomy Scars.hmi': No such file or directory

Where am I going wrong?
Read the documentation on substitution parameters before formulating command strings. There is no <subdir> parameter, so it is ignored when the command string is processed.
Been there, done that.

Either I'm failing to understand the syntax of the substitution commands, or it's not meant to work as I think it should.

Whatever I type as a parameter, I always get the result returned, viz :-
get_iplayer --pid=p05tyfry --listformat fileprefix

That produces this :-
A Tattoo To Change Your Life: Series 1 - Covering My Mastectomy Scars, BBC iPlayer, p05tyfry

As does
--listformat dir

So I'm stuck. Sorry.
EDIT: Two Three problems:
  • Substitution parameters won't be recognised without angle brackets
  • --listformat is limited to fields in cache, which doesn't include <dir> or <fileprefix>
  • --listformat is for search results - it will be ignored when downloading with --pid
Again, read the documentation on substitution parameters. It tells you how to check values for a programme before downloading. However, you don't need to know the values to formulate command strings - that's the whole point of using them.
Ok. I'll give it another go.

Thanks for the pointers.

Possibly Related Threads...
Thread Author Replies Views Last Post
  Correct use of "--subdir-format" spncrgr 8 3,010 04-02-2014, 08:12 AM
Last Post: spncrgr