[TOOL] Escape Tool for escaping cmdline arguments

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
User avatar
rednoah
The Source
Posts: 16969
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[TOOL] Escape Tool for escaping cmdline arguments

Post by rednoah » 26 Oct 2013, 10:06

Description:
This little tool will help you escape cmdline arguments. Per default it'll spawn a GUI but if you run it on a headless machine it'll just run a simple CLI.

Start Escape Tool:

Code: Select all

filebot -script fn:escape
View Script:
http://filebot.net/scripts/escape.groovy
:idea: Please read the FAQ and How to Request Help.

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

Re: [TOOL] Escape Tool for escaping cmdline arguments

Post by rednoah » 13 May 2014, 10:14

Alternative: @syntax
You can specify arguments line by line a text file:

Code: Select all

filebot @/path/to/args.txt

Alternative: xargs
If you're on Linux you can be smart and use xargs. Just specify the arguments line by line in a text file and then just use xargs to make the call:

Code: Select all

cat amc.arguments | tr '\n' '\0' | xargs -0 filebot
Image


Alternative: Groovy
As an alternative to escaping arguments you can use languages like Groovy that support triple quotes for String definitions and allow you to make the call with a String Array of arguments, and make (almost) any form of escaping unnecessary:

Code: Select all

['''filebot''', '''-help'''].execute()
http://groovy.codehaus.org/Executing+Ex ... rom+Groovy
:idea: Please read the FAQ and How to Request Help.

Post Reply