It's the formatting of that blog post, it's got non-ASCII quotes. Just edit them to fix.
*/1 * * * * TEMP=$(digitemp_DS9097 -a | grep -i sensor | awk '{print $7}'); sed -i -r "14s,>[^<]*</,>${TEMP}</," /www/index.html
I'm not sure if the rest of the line is right though, my sed doesn't have that -r flag, and the script tries to change line 14 (hence 14s...) which is very picky on whether you copied the html from the blog exactly. I used this instead:
*/1 * * * * TEMP=$(digitemp_DS9097 -a |grep -i sensor | awk '{print $7}');sed -i.bak "s,\\(66cc00.*\">\\)[^<]*</,\\1$TEMP</," /www/index.html
which matches on the colour number on the line instead. The extra \\(...\\)
are capturing that so that I can use it again in the replacement as \\1
.
I've just read the manual for digitemp_DS9097
(http://www.linuxcertif.com/man/1/digitemp_DS9097/) - you'd be better running it as digitemp_DS9097 -q -t 0 -O"%.2C"
, which gives you the output directly as a single Centigrade number with no need for grep/awk. eg:
*/1 * * * * TEMP=$(digitemp_DS9097 -q -t 0 -O"%.2C");sed -i.bak "s,\\(66cc00.*\">\\)[^<]*</,\\1$TEMP</," /www/index.html