[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
RE: counting number of lines...
- From: "Ajay Bansal" <Ajay_Bansal infosys com>
- To: <redhat-list redhat com>
- Subject: RE: counting number of lines...
- Date: Sun Apr 13 07:47:00 2003
1. total no of lines in all the files in a directory - "cat *|wc -l"
caution - will also include the binary files
2. folowing script
---
count=0
for tmpFile in *
do
file $tmpFile |grep text
if [ $? -eq 0 ]
then
line=`cat $tmpFile wc -l`
count=`expr $count + $line`
fi
done
echo $count
--------
-----Original Message-----
From: João Borsoi Soares [mailto:joao intrasystems com br]
Sent: Sunday, April 13, 2003 4:34 PM
To: redhat-list redhat com
Does anyone knows how can I count the total number of lines of many files in a directory?
Thanks,
Joao.
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request redhat com?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]