@file syntax for reading cmdline args from text files

How-to guides, frequently asked questions, not-so-obvious features, etc
User avatar
The Source
Posts: 10654
Location: Taipei

@file syntax for reading cmdline args from text files

Postby rednoah » 07 Dec 2015, 07:17

Passing complex arguments that contain lots of special characters like $!%'" to a command-line tool can be tricky. Correctly escaping such arguments for cmd or bash can get very painful very quickly.

FileBot allows you specify argument files via @/path/to/file syntax, so you can pass in your complex command-line arguments via separate text files line by line without having to worry about quoting or escaping anything.

e.g. @file usage

Code: Select all

filebot -script fn:amc /input --output /output --def @/path/to/args.txt

e.g. /path/to/args.txt

Code: Select all


  • Argument files must not contain byte order marks (i.e. do not use Microsoft tools for editing text files)
  • Argument files are read with the default encoding (i.e. CP1252 on Windows, UTF-8 on Linux and Mac)

You may also pass --def script binding values via text files. That's handy when passing in complex multi-line formats.

e.g. --def [email protected] usage

Code: Select all

filebot -script fn:amc /input --output /output --def movieFormat=@/path/to/MovieFormat.groovy

e.g. /path/to/MovieFormat.groovy

Code: Select all

[ allOf {ny}
        { allOf {vf}
, allOf {ny}
]*.findResults {
    if (it) it.toString()
}*.join(' ')
My (very excellent) support depends on Windows Store and Mac App Store sales and PayPal donations. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.


Please read the FAQ and How to Request Help. Donate if you'd like some extra developer love. :ugeek:

Return to “Tips, Tricks and Tutorials”

Who is online

Users browsing this forum: No registered users and 1 guest