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

Myles Braithwaite me at mylesbraithwaite.com
Wed Oct 29 17:37:45 UTC 2014


Jamon Camisso wrote:
> What if $MESSAGE == 'foo); DELETE FROM log;'

Fixed:

#!/bin/bash
CLEAN_MESSAGE="${MESSAGE//\;/}"
sqlite3 log.db "INSERT INTO log (message) VALUES ('$CLEAN_MESSAGE');"


More information about the talk mailing list