Problème vicieux du "cat | while read"....
En fait tu bosses dans le subshell lancé par ta "lecture de pipe", ta variable est modifiée dans ce subshell mais pas dans ton shell courant.
C'est un peu comme si tu faisais un (TOTO=42; cmd1 && cmd2) > plop.txt, le subshell qui lance cmd1 && cmd2 voit dans son environnement TOTO=42, mais dans ton shell courant il n'y a jamais eu de TOTO...
Si tu veux compter le nombre de lignes, utilise plutôt wc (man wc)
Message édité par Xavier_OM le 14-02-2007 à 14:30:41
---------------
I was there Gandalf, I was there 3000 years ago... when the war between vi and emacs was raging.