@file syntax for reading cmdline args from text files

How-to guides, frequently asked questions, not-so-obvious features, etc
Post Reply
User avatar
The Source
Posts: 12993
Joined: 16 Nov 2011, 08:59
Location: Taipei

@file syntax for reading cmdline args from text files

Post by 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.

Argument Files:

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)
:!: DO NOT use Microsoft tools such as Notepad or Word to edit plain text files. Use proper tools such as Notepad++ or Sublime Text instead.

Binding Value:

You may also pass --def script binding values via UTF-8 encoded 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 [email protected]/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:

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests