[vz-dev] Entering new values from the console with the wget command

Thorben Thuermer r00t at constancy.org
Tue Oct 11 16:57:03 CEST 2011

On Tue, 11 Oct 2011 16:01:12 +0200 Willy Verbiest <willy.verbiest at gmail.com> wrote:
> root at alix2:~# wget -O-
> \"http://www.alix.vl/volkszaehler.org/htdocs/middleware/data/72574ec0-f405-11e0-b430-b73bcecafc42.json?operation=add&value=1&ts=\""
> int(t*1000.0) " # >& /dev/null"
> [1] 21094
> [2] 21095
> root at alix2:~# "http://www.alix.vl/volkszaehler.org/htdocs/middleware/data/72574ec0-f405-11e0-b430-b73bcecafc42.json?operation=add:
> Schema ontbreekt.
> This gives me the error "Schema ontbreekt" = "Schema missing"

this is a basic wget/shell usage error.
you need to quote the URL, because it contains shell metacharacters.
the "&" ends a command and executes it in the background.
you added quotes to the command actually, but quoted them using backslashes...
so what is executed in your example is:
# wget -O- \"http://www.alix.vl/.../72574ec0-f405-11e0-b430-b73bcecafc42.json?operation=add &
# value=1 &
# ts=\""int(t*1000.0) " # >& /dev/null...

which causes all the junk output.
the error message is from wget, not from volkszaehler, and
results from specifying to use the "http protocol...
(WITH the quote included)
(the >& is also broken, it should likely be &> )

a correct command could (for example) be:
# wget -O- "http://www.alix.vl/volkszaehler.org/htdocs/middleware/data/72574ec0-f405-11e0-b430-b73bcecafc42.json?operation=add&value=1&ts=$((t*1000))" # &>/dev/null

( $(()) allows for (integer) arithmetic evaluation in shell,
 the bare int() is a syntax error at best)

- T.

(also, next time you report a problem: '# unset LANG' will remove your locale
 setting and give you english error messages)

More information about the volkszaehler-dev mailing list