URL: https://linuxfr.org/forums/programmation-shell/posts/lire-et-interpreter-un-fichier-ligne-par-ligne Title: lire et interpreter un fichier ligne par ligne Authors: jukilo Date: 2006年10月31日T15:32:32+01:00 Tags: Score: 0 Hello j'ai un fichier du genre date_arg1_arg2_arg3_arg4 date_arg1_arg2_arg3_arg4 date_arg1_arg2_arg3_arg4 date_arg1_arg2_arg3_arg4 et je souhaite le parcourir et l'interprêter de manière à faire de chaque ligne une requete mysql genre: select arg1, arg2 from arg3 where arg4="bob" and date="2006-10-31"; Je suis sur une piste avec --------------------------------- requete=`awk 'BEGIN { £spaces£ £/spaces£FS="_" £spaces£ £/spaces£RS="\n" } 5ドル = "Compression"{ £spaces£ £/spaces£print "mysql -u user -B -s -D MaBase -e \"select 2,ドル 3ドル from 4ドル;\"\n" }' MonFichier.log` $requete -------------------------------- mais ça tente juste de m'exécuter une requete du type : select arg1, arg2 from arg3 where arg4="bob" and date="2006-10-31";select arg1, arg2 from arg3 where arg4="bob" and date="2006-10-31";select arg1, arg2 from arg3 where arg4="bob" and date="2006-10-31";select arg1, arg2 from arg3 where arg4="bob" and date="2006-10-31"; Je touche au but mais je m'en sors pas... Quelqu'un a une idée?