[rrd-users] problem with 'cat file | rrdtool - ' syntax
Kiss Gabor (Bitman)
kissg at ssg.ki.iif.hu
Tue Jan 15 15:13:13 CET 2013
> I have a little problem to change rrdtool graphing mode from normal to pipe:
>
> For example my test file contains:
>
> rrdtool graph lpar.png --imgformat PNG \
> --title "test" \
> --width 800 --height=400 \
[...]
> and if I lauch this simple script, no problem, I get graph
>
> Now how to generate same graph, but with a pipe syntax, like 'cat file |
> rrdtool - ' or 'rrdtool - < file' ?
>
> I have tried to just remove 'rrdtool' from the file listed upper, and then
> perform a cat file | rrdtool - , and the result is:
>
> ERROR: Could not make sense out of '\'
This is not rrdtool problem but a shell issue. :-)
It is the shell who joins continuation lines preceded by backslash+newline.
bash(1):
A non-quoted backslash (\) is the escape character. It preserves the
literal value of the next character that follows, with the exception of
<newline>. If a \<newline> pair appears, and the backslash is not
itself quoted, the \<newline> is treated as a line continuation (that
is, it is removed from the input stream and effectively ignored).
Command rrdtool receives its arguments as if they were
written in a single line.
Cheers
Gabor
--
E-mail = m-mail * c-mail ^ 2
More information about the rrd-users
mailing list