Howto beautify xml and json from a bash script

Sometime may happens you need to beautify xml or json from a bash script. So here there are two methods to easily obtaing a pretty print of your data: Command to beautify XML cat filename.xml | xmllint –format – Command to beautify JSON cat filename.json | python -m json.tool In case you miss above tools…

Leggi tutto

MySQL: colonna autoincrement nella select

Può capitare di voler numerare le righe dei risultati direttamente in mysql, magari per fare confronti o verificare comodamente la posizione e/o l’ordine dei risultati stessi. Ci vengono in aiuto le variabili: basta definirne una (le variabili in mysql sono precedute da @) e poi incrementarle all’interno del campo che si vuole selezionare. Nota bene:…

Leggi tutto