Word Count for a specific set of files

Hugh E Cruickshank hugh at forsoft.com
Fri Jun 18 14:00:07 UTC 2004


From: Nabin Limbu Sent: Friday, June 18, 2004 07:01
> 
> #!/bin/bash
> j=1
> for i in `ls -1rS`
> do
> if [ $j -gt 10 ]; then exit; fi
> j=`expr $j + 1`
> echo `wc -w $i`
> done
> 

Or:

for F in `ls -1rS | head -10`; { wc -w $F; }

Regards, Hugh

-- 
Hugh E Cruickshank, Forward Software, www.forward-software.com 





More information about the redhat-list mailing list