[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Script bash 2



Bonjour, moi aussi j'ai un petit soucis avec un script :


#! /bin/sh

i=0
cat "/etc/passwd" | while read ligne ; do
     i=$((i + 1))
done
echo $i

Voila, il est cencé compter les ligne du fichier /etc/passwd, mais quand je l'éxécute, il me retourne systématiquement 0.
Si vous voyez pourquoi ca marche po ca serait le top.

Merci et bonne journée

Ced



Reply to: