[GTALUG] capturing the output of any program and inserting in db

Jamon Camisso jamon.camisso at utoronto.ca
Wed Oct 29 17:18:55 UTC 2014


On 2014-10-29 12:13 PM, Myles Braithwaite wrote:
> Dave Cramer wrote:
>> Is there anything out there that is written simply ? By this I mean I
>> don't want to have to install a framework or a jvm or any large
>> dependencies. Ideally this would be written in bash or the like.
> 
> You could use the sqlite. Running something like:
> 
> #!/bin/sh
> sqlite3 log.db 'INSERT INFO log (message) VALUES ($MESSAGE);'
> 
> in a table setup like this:
> 
> CREATE TABLE log (
> 	id INTEGER PRIMARY KEY,
> 	timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
> 	message TEXT
> );

What if $MESSAGE == 'foo); DELETE FROM log;'

Just saying.. :p


More information about the talk mailing list