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

Re: Counting number of lines in a text file



At 2/3/99 04:03 PM +0100, Remco van de Meent wrote:
>Jay Barbee wrote:
>> I was wondering what the quickest way to count the number of records
>> (lines) in a text file.  It would be neat to do many files at once and save
>> the output in a seperate file in the format 'filename:::#records'.
>
>for a in file1 file2 file3; do \
>  echo -n $a >> seperate_file; \
>  echo -n ":::" >> seperate_file; \
>  wc -l $a >> seperate_file; \
>done

How would I gather a list of all TXT files in the directory before this and
pass each file to this script.

Thanks for your help
--Jay


Reply to: