Skip to content

Quoting and escaping rules

David Rebatto edited this page Jun 20, 2019 · 15 revisions

BLAH Protocol rules

In the BLAH protocol the characters with a special meaning are:

  1. <sp> (blank)
  2. \t (tab)
  3. \n (new line)
  4. \r (carriage return)
  5. \ (backslash)

These characters need to be escaped with a backslash when inserted as a literal.
Note that quotes have no special meaning and need not to be escaped.
The escaping rules are applied to both input (command lines) and output (result lines and return lines).

Classad rules

I'm not going into general classad quoting rules, as the classad library takes care of handling that. Using the library to insert and extract information to/from a classad should always produce proper values.
Still, within the job submission classad two attributes use a special quoting rule: Arguments and Environment. These attributes are composed of multiple elements (i.e. single argument or single variable assignment), separated by spaces. Single-quotes are used to quote spaces and single-quotes within individual elements. The single-quotes can be used to quote an entire element or just part of one. Within single-quotes, a single-quote that appears in the element must be repeated.

An example:

Arguments: a '''b''' 'c d' e' 'f ''''
arg 1: a
arg 2: 'b'
arg 3: c d
arg 4: e f
arg 5: '

Shell rules

TODO

Clone this wiki locally