[ale] Stumped-

Geoffrey lists at serioustechnology.com
Thu Mar 11 12:31:33 EST 2010


Dennis Ruzeski wrote:
> Same client-
> 
> I can get the file listings, I'm having a problem with the file size comparison.

for fn in $(find . -type f -print);do
	for fn1 in $(find . -type f -print);do
	f=$(basename $fn)
	f1=$(basename $fn1)
	if [ "$f" == "$f1" ]; then
		sf=$(ls -l $fn|awk '{print $5}')
		sf1=$(ls -l $fn1|awk '{print $5}')
		if [ $sf -ne $sf1 ]; then
			echo $fn and $fn1 are not the same size
		fi
	fi
	done
done

The problem with the above code is, it will do the comparison twice 
because of the multiple for loops.  Also, it will compare a file to 
itself, which is wasted time, but not worth the effort to not do that.

I've not tested this, so play with it.

> 
> 
> 
> On Thu, Mar 11, 2010 at 10:31 AM, Dennis Ruzeski <denniruz at gmail.com> wrote:
>> The direction  I've been going in is to do something like this-
>>
>> for dir in `ls /client`
>> do diff -s $dir/images $dir/movies |grep ^F |xargs ls -l
>> done
>>
>>
>>
>> On Thu, Mar 11, 2010 at 10:26 AM, Dennis Ruzeski <denniruz at gmail.com> wrote:
>>> Same name but different size.
>>>
>>>
>>>
>>> On Thu, Mar 11, 2010 at 10:14 AM, Dave Weiner <davew at coyotetechnical.com> wrote:
>>>> Dennis Ruzeski wrote:
>>>>> Exactly- I need to look in images and movies for the same file name
>>>>> with different sizes for each client.
>>>> So you need to loop through all the files in the images dir for client1
>>>> and check for files with the same name in the other 9,999 image directories?
>>>>
>>>>> --Dennis
>>>> Dave
>>>> _______________________________________________
>>>> Ale mailing list
>>>> Ale at ale.org
>>>> http://mail.ale.org/mailman/listinfo/ale
>>>> See JOBS, ANNOUNCE and SCHOOLS lists at
>>>> http://mail.ale.org/mailman/listinfo
>>>>
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
> 


-- 
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson


More information about the Ale mailing list