Variables not passed on to CMD - filebot-watcher

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
socram
Posts: 6
Joined: 24 Jan 2021, 20:59

Variables not passed on to CMD - filebot-watcher

Post by socram »

Dear all,

I read the FAQ already, however, this is a very simple question and therefore can be explained quickly:

I use the following environment variables for sorting series and movies (since pasting the whole entry would lead to serious escaping what I wanted to prevent):
https://pastebin.com/fw4eBjTv

and this is my cmd:

Code: Select all

"/volume1/Multimedia/Downloads/extracted -get-subtitles --lang de --log-file '/data/log' --action move --def 'seriesFormat=$SERIEN' 'movieFormat=$FILME' 'unsortedFormat=$UNSORTIERT' -non-strict --def unsorted\\=y artwork\\=n --def clean\\=n",
It will most likely only be a very obvious thing I'm not seeing here, this is what the log says:

Code: Select all

Run script [fn:amc] at [Sun Jan 24 22:08:37 GMT 2021]
Parameter: excludeList = .excludes
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = n
Parameter: seriesFormat = $SERIEN
Parameter: movieFormat = $FILME
Parameter: unsortedFormat = $UNSORTIERT
Parameter: clean = n
Help would be very much appreciated.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Variables not passed on to CMD - filebot-watcher

Post by rednoah »

'...' does not work the way you think, whereas "..." does work the way you think.

e.g.

Code: Select all

echo 'bash does not expand $ variables here'

Code: Select all

echo "bash does indeed expand $ variables here"

:idea: Please read Cmdline and Argument Passing for details.


:idea: Use the @file syntax for reading command-line arguments from external text files.
:idea: Please read the FAQ and How to Request Help.
socram
Posts: 6
Joined: 24 Jan 2021, 20:59

Re: Variables not passed on to CMD - filebot-watcher

Post by socram »

For some reasons, the variables do not work in the @file implementation. However, copying the line in instead of the variable did the job. Thanks a lot for your support and your really fast reply!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Variables not passed on to CMD - filebot-watcher

Post by rednoah »

socram wrote: 25 Jan 2021, 21:54 For some reasons, the variables do not work in the @file implementation.
Yes, that is how it is supposed to be. The shell is responsible for resolving environment variables, whereas applications are generally not expected to do so. ;)
:idea: Please read the FAQ and How to Request Help.
socram
Posts: 6
Joined: 24 Jan 2021, 20:59

Re: Variables not passed on to CMD - filebot-watcher

Post by socram »

Ok, that makes sense then, thanks.

However, with the parameter /volume1/Multimedia/Downloads/extracted (which is my default extraction path) filebot watcher unfortunately does not perform the job. This is what the log says:

Waiting 90 seconds for changes to settle down...
Modified: /volume1/Multimedia/Downloads/extracted/[NAME_OF_MOVIE]

Any idea here?

edit: Solved this. It was because of the too short settle down time.
Post Reply