-
Notifications
You must be signed in to change notification settings - Fork 32
Quoting and escaping rules
In the BLAH protocol the characters with a special meaning are:
-
<sp>
(blank) -
\t
(tab) -
\n
(new line) -
\r
(carriage return) -
\
(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).
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: '
TODO