View Single Post
Old 02-15-2013, 10:13 AM   #388
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by twobob View Post
erm. I guess. if you prefixed it with /bin/sh or something.

I suppose I should try.

should I even ask why?
The "action" : "whatever"
is opening a shell with the argument of "whatever".

So a button action of a quoted shell command, like:
{"name": "Ash Command", "priority" : 1, "action": "set > /var/tmp/set.txt"}

Does what one would expect.
The "action" field also accepts multiple shell commands with the ';' statement separator.
(PS: the above is not a good scripting example, it writes directly to flash, one line at a time.)

And a button that does not re-direct its output anywhere, like:
{"name": "Ash Command", "priority" : 1, "action": "set"}

Writes its output to stdout, on which nothing is listening (as expected).

@dsmid : which means that none of your script outputs will ever be seen by anything other than the bit-bucket.
Check out my DateTime button script for a good way to get messages back to the users, at the same time as avoiding a massive number of writes to flash memory.

Last edited by knc1; 02-15-2013 at 10:46 AM.
knc1 is offline   Reply With Quote