jeudi 5 mars 2015

Counting files commands in a loop


How can I use ls *.txt | wc as a separate variable so I can use it in a loop afterwards? That is



count.files=$(ls *.txt | wc)
...

if count.files -ne 2000; then
echo "message"
fi


I have tried it but it seems it doesn't work.



Aucun commentaire:

Enregistrer un commentaire