[rrd-users] Make just stops when compiling on Solaris 10 x86
Alex van den Bogaerdt
alex at ergens.op.het.net
Thu Jan 25 04:13:30 CET 2007
On Wed, Jan 24, 2007 at 06:45:20PM +0000, Jonathan Armitage wrote:
> Alex van den Bogaerdt wrote:
> >
> > To test: type "hello<enter><ctrl-D>" at this point. You won't get a
> > usable cgi-demo.cgi but perhaps the process continues.
> >
> OK, following that suggestion, I altered the Makefile in examples to read:
>
> cgi-demo.cgi: cgi-demo.cgi.in $(top_builddir)/config.status
> <Added>cat cgi-demo.cgi.in |</Added> sed
> 's,@''exec_prefix@,$(exec_prefix),' $< > $@
> chmod a+x $@
>
> and the make now completes successfully.
Weird.
This:
sed 's,@''exec_prefix@,$(exec_prefix),' $< > $@
Means:
sed s, at exec_prefix@,$(exec_prefix), $sourcefile > $destination_file
So, "@exec_prefix@" gets changed into the contents of variable
$exec_prefix, with cgi-demo.cgi.in as input and cgi-demo.cgi as output.
What happens if you do the following:
Create a file "/tmp/hello"
Contents:
Hello there
And then run the following:
sed s,Hello,Hi, /tmp/hello > /tmp/hi
I would expect a file "/tmp/hi" with contents "Hi there".
If it doesn't work, try:
sed s/Hello/Hi/ /tmp/hello > /tmp/hi
still no go:
sed s/Hello/Hi/ < /tmp/hello > /tmp/hi
still no go:
cat /tmp/hello | sed s/Hello/Hi/ > /tmp/hi
and let the list know.
> But since my understanding of both make and sed is limited there is
> probably a more elegant way to do it. At least it's a useful use of cat :)
Useless use of cat: cat file | sed s/a/b/
Alternative: < file sed s/a/b/
(will work in 99% of all cases)
--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/
More information about the rrd-users
mailing list