Input path Variable?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
kithros
Posts: 2
Joined: 11 Jul 2015, 14:42

Input path Variable?

Post by kithros »

Looking for a little guidance,

I am trying to pass the input variable to a bash script,

Code: Select all

filebot -script /root/housekeeping.groovy  -extract -non-strict -r --conflict=override -rename /mnt/pool/incoming/completed/anime --output /mnt/pool/
Im looking to pass the /mnt/pool/incoming/completed/anime to the bash script:

Code: Select all

def sout = new StringBuffer(), serr = new StringBuffer()
def proc = '/scripts/filebotclean.sh <PATHVARIABLEHERE>'.execute()
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(5000)
println "out> $sout err> $serr"
Any assistance in pointing me in the right direction would be great, I've looked thru some of the other rednoah scripts/ and forum and haven't found a solution that works for me.

Thanks
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Input path Variable?

Post by rednoah »

So this is really a shell script question? How to pass variables into a shell script? Well, I recommend having a look at the filebot startup script and see how it's done. Hint: "$@"
:idea: Please read the FAQ and How to Request Help.
kithros
Posts: 2
Joined: 11 Jul 2015, 14:42

Re: Input path Variable?

Post by kithros »

Im sorry, I must not have been specific enough. The bash script works. I just dont know enough bout groovy to figure out what variable or method to call to get the input path that is given to filebot from the command line.

In my example I want to pass the /mnt/pool/incoming/completed/anime to my bash script ( that is ready to handle the input)

I can hard code the path (and it works) but i was trying to make it more modular, and allow me to use the same groovy script in a couple of different setups.

In your code, i some times see it used as $dir or it.name. But i have been unable to get those to work, and i suspect its my lack of groovy that is getting in the way. I am proficient in PHP, Java not so much :(

I hope that explains my issue better, I assume its something really simple i am just not wrapping my head around.

Thanks
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Input path Variable?

Post by rednoah »

FileBot call:

Code: Select all

filebot -script test.groovy /path/to/file --def "name=value"
Groovy:

Code: Select all

println args
println name
:idea: Please read the FAQ and How to Request Help.
Post Reply