I have a script running on a server every 3 seconds exporting query results to an html file using the mysql --html
command line option
while [ 1 ]; do
mysql myfoobarDB --host=xxx.xxx.xxx.xxx --user=XXX --password=XXXXXX --skip-column-names --html --exec="
WHERE x = x
" > foo_data.temp
a crontab kicks this off and the html from this file is used to display various realtime statistics on our intranet.
, is there a way to json encode instead of using the --html command line option? If not please post example code in perl or a bash script that will json encode the query results to a file.