[rrd-users] Re: Newline in a comment
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
If you would use "COMMENT:\n", Perl would expand the \n and pass:
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
You can solve that by using multiple comments:
"GPRINT:myvar:AVERAGE:%6.2lf %s \\l",
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
I'm having problems inserting a newline in a comment on graph
\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
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
More information about the rrd-users