[ANSWERED] How can I make use of subdir as a variable?
#1
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)

Code:
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 :-
Code:
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?
#2
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.
#3
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 :-
Code:
get_iplayer --pid=p05tyfry --listformat fileprefix

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

As does
Code:
--listformat dir

So I'm stuck. Sorry.
#4
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.
#5
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 2,888 04-02-2014, 08:12 AM
Last Post: spncrgr