[rrd-users] Re: Newline in a comment

Serge Maandag serge.maandag at staff.zeelandnet.nl
Fri Apr 11 10:55:17 MEST 2003


There's a significant difference between using single quotes or double
quotes in the unix world.
Text within double quotes gets interpreted (by the shell or by Perl..),
text within single quotes not.

rrdtool does not want a newline character, it just wants the string
"\n". It will interpret that by itself.
So you could use "COMMENT:\\n" or 'COMMENT:\n' in a Perl script.
In the first form Perl will eat the first backslash to keep the second
backslash alive. 
If you would use "COMMENT:\n", Perl would expand the \n and pass:

"COMMENT:
"

to rrdtool, I hope you can follow this.

In the 'COMMENT:\n' form, Perl is not interested in what's between the
quotes, so it will not expand the \n.

I believe to recall you cannot use two formatting characters in a single
rrdtool statement.
You can solve that by using multiple comments:

"GPRINT:myvar:AVERAGE:%6.2lf %s \\l",
"COMMENT:\\n"

Serge.

-----Original Message-----
From: John-Paul Delaney [mailto:John-Paul.Delaney at wfp.org] 
Sent: Friday, April 11, 2003 10:17 AM
To: rrd-users at list.ee.ethz.ch
Subject: [rrd-users] Newline in a comment


Hello List... 
I'm having problems inserting a newline in a comment on graph
generation. 
\n or \\n  doesn't appear to have any effect.  How is it possible to 
insert a new line, and have all the text align to the left i.e. not 
justified?

thanks
/j-p.

--

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list