Retourner au contenu associé (entrée de forum : rehercher puis modifier une ligne dans un fichier)
Posté par totof2000 le 23 novembre 2006 à 13:32. En réponse au message rehercher puis modifier une ligne dans un fichier. Évalué à 2.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: quelques pistes ...
Posté par totof2000 . En réponse au message rehercher puis modifier une ligne dans un fichier. Évalué à 2.
awk -v var="$(head -1 fichier)" ' (NR==1) {if (0ドル ~ var) { 0ドル="toto" } print 0ドル } ' httpd.conf > httpd.conf.tmp
Ca marchera peut-etre.
Sinon (pas teste)
awk ' BEGIN {getline var <fichier} {if (0ドル ~ var) { 0ドル="toto" } print 0ドル } ' httpd.conf > httpd.conf.tmp