Subject: | |
From: | |
Reply To: | |
Date: | Sat, 10 May 1997 12:24:36 PDT |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
> wc -l /DEV/SOURCE/* | tail -1
> wc: cannot execute: Arg list too long
>
> The following variation might utilize the available
> command line buffer more effectively but will, of course,
> also fail at a certain amount of files per directory...
>
> shell/iX> cd /DEV/SOURCE ; wc -l * | tail -1
>
> Regards, Lars.
>
The command line isn't infinite, so loops are used to scan over the file set.
#!/bin/sh
NumFiles=0
NumLines=0
for File in *
do
NumFiles=`expr $NumFiles + 1`
Lines=`wc -l $File | awk '{ print $1 }'`
NumLines=`expr $NumLines + $Lines`
done
echo "Files: $NumFiles, Lines: $NumLines"
--
--------------------------------------------------------------------
Ross Scroggs email: [log in to unmask]
Telamon, Inc. CIS: 76011,2234
492 Ninth Street, Suite 310 voice: 510-987-7700
Oakland, CA 94607-4098 fax: 510-987-7009
--------------------------------------------------------------------
|
|
|