Bonjour
j'aimerais savoir s'il est possible d'utiliser la commande grep dans une commande awk ?
En fait je souhaiterais savoir si la ligne que je lis existe déjà dans un autre fichier avant de poursuivre les instructions.
ca pourrait ressemble à quelque chose comme ça ..
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 awk ' BEGIN { FS=";" A_FILE="toto.txt" B_FILE="titi.txt" } { if (NF = 2) { grep $1 A_FILE if ($? == 1) { printf "Erreur \n" >> B_FILE } } }' < $nom_fichier
Partager