Network UPS Tools User Manual
Network UPS Tools User Manual
Network UPS Tools User Manual
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Network</strong> <strong>UPS</strong> <strong>Tools</strong> <strong>User</strong> <strong>Manual</strong> 20 / 84<br />
SHUTDOWNCMD "/sbin/shutdown -h +0"<br />
Without the quotes, it would only see the first word on the line.<br />
OK, so let’s say you really need to embed that kind of quote within your configuration directive for some reason. You can do that<br />
too.<br />
NOTIFYCMD "/bin/notifyme -foo -bar \"hi there\" -baz"<br />
In other words, \ can be used to escape the ".<br />
Finally, for the situation where you need to put the \ character into your string, you just escape it.<br />
NOTIFYCMD "/bin/notifyme c:\\dos\\style\\path"<br />
The \ can actually be used to escape any character, but you only really need it for \, ", and # as they have special meanings to the<br />
parser.<br />
When using file names with space characters, you may end up having tricky things since you need to write them inside "" which<br />
must be escaped:<br />
NOTIFYCMD "\"c:\\path with space\\notifyme\" \"c:\\path with space\\name\""<br />
is the comment character. Anything after an unescaped is ignored.<br />
Something like this. . .<br />
identity = my#1ups<br />
i. will actually turn into "identity = my", since the stops the parsing. If you really need to have a in your configuration, then<br />
escape it.<br />
identity = my\#1ups<br />
Much better.<br />
The = character should be used with care too. There should be only one "simple" = character in a line: between the parameter<br />
name and its value. All other = characters should be either escaped or within "quotes".<br />
password = 123=123<br />
i. is incorrect. You should use:<br />
password = 123\=123<br />
ii. or :<br />
password = "123=123"<br />
6.1.2 Line spanning<br />
You can put a backslash at the end of the line to join it to the next one. This creates one virtual line that is composed of more<br />
than one physical line.<br />
Also, if you leave the "" quote container open before a newline, it will keep scanning until it reaches another one. If you see<br />
bizarre behavior in your configuration files, check for an unintentional instance of quotes spanning multiple lines.