Awk : remplacer une ligne d'un fichier
Fermé
tchsimons
Messages postés
191
Date d'inscription
samedi 3 mai 2008
Statut
Membre
Dernière intervention
24 novembre 2012
-
18 janv. 2010 à 22:40
dubcek Messages postés 18718 Date d'inscription lundi 15 janvier 2007 Statut Contributeur Dernière intervention 22 mars 2024 - 19 janv. 2010 à 08:11
dubcek Messages postés 18718 Date d'inscription lundi 15 janvier 2007 Statut Contributeur Dernière intervention 22 mars 2024 - 19 janv. 2010 à 08:11
A voir également:
- Awk : remplacer une ligne d'un fichier
- Ps awk ✓ - Forum Debian
- Awk supprimer ligne contenant chaîne ✓ - Forum Shell
- Powershell awk - Forum Shell
- Awk windows - Forum Windows
- Awk date - Forum Shell
1 réponse
dubcek
Messages postés
18718
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
22 mars 2024
5 616
19 janv. 2010 à 08:11
19 janv. 2010 à 08:11
hello
$ cat a1 1 2 3 4 5 6 7 8 9 10 $ $ var=8 $ var2="toto travaille" $ $ awk -v var=$var -v var2="$var2" 'NR==var {$0=var2}; {print}' < a1 1 2 3 4 5 6 7 toto travaille 9 10 $