Remplacer Uniq -d avec awk

Résolu/Fermé
danyhaddad - 2 juin 2010 à 22:32
 danyhaddad - 3 juin 2010 à 15:40
Bonjour,

Je voudrais remplacer la fonction "uniq -d" par la fonction awk ?
quelqu'un peut m'aider.
merci d'avance

A voir également:

1 réponse

dubcek Messages postés 18718 Date d'inscription lundi 15 janvier 2007 Statut Contributeur Dernière intervention 22 mars 2024 5 615
3 juin 2010 à 08:11
hello
$ cat a1
1
2
2
3
4
5
5
6
7
7
7
8
9
10
10
$ 
$ uniq -d a1
2
5
7
10
$ awk '{if(ligne[$0] && !n[$0]++)print; ligne[$0]=$0}' a1
2
5
7
10
$
1
grand merci :)
j'apprecie votre reponse .
0