1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| #!/bin/bash
hote_db="localhost"
nom_bd="domotique"
login_db="xxxx"
pass_bd="xxxxxx"
format_texte="utf8"
#select_noms_colonnes="id, cmu, prog, exec1_on, exec2_on, exec3_on, macro_on, exec1_off, exec2_off, exec3_off, macro_off, exec1_dim, exec2_dim, exec3_dim, macro_dim, exec1_bri, exec2_bri, exec3_bri, macro_bri"
select_noms_colonnes="exec1_on"
nom_table="bash"
colonne_recherche="cmu"
col="cmu"
recherche="A4"
ma_requete(){
typeset col=$1
mysql -h"$hote_db" -D"$nom_bd" -u"$login_db" -p"$pass_bd" -B -N -e "SELECT $col FROM $nom_table"
}
execution1=$(ma_requete $select_noms_colonnes)
execution2="$Mysql2"
executable="$Mysql3"
macro="$Mysql4" |
Partager