[ale] Stumped-

Lightner, Jeff jlightner at water.com
Thu Mar 11 11:26:39 EST 2010


What I came up with (assumes you only have client directories where you
start - put the script one directory above and start it with
../scriptname):

#!/bin/bash
for client in $(ls)
do for file in $(ls  ${client}/images)
   do IMGFILE=$(ls -l ${client}/images/$file |awk '{print $5}')
      MOVFILE=$(ls -l ${client}/movies/$file |awk '{print $5}')
      if ! [[ $IMGFILE -eq $MOVFILE ]]
      then echo ${client}/images/$file is different size than
${client}/movies/$file
      fi
    done
done

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Dave
Weiner
Sent: Thursday, March 11, 2010 10:56 AM
To: Atlanta Linux Enthusiasts - Yes! We run Linux!
Subject: Re: [ale] Stumped-

Dennis Ruzeski 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

I would take a different, not quiet as brute force approach as this,
totally untested and off the top of my head.  Watch for line wraps.

for dir in /client/*
do
 cd $dir/images
 for file in *
 do
  if [ -f ../movies/$file ]
  then
   if [ `stat --format="%s" $file` -ne `stat --format="%s"
../movies/$file` ]
   then
    #do something here
   fi
  fi
 done
 cd ../movies
 for file in *
 do
  if [ -f ../images/$file ]
  then
   if [ `stat --format="%s" $file` -ne `stat --format="%s"
../images/$file` ]
   then
    #do something here
   fi
  fi
 done
done
_______________________________________________
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
 
Proud partner. Susan G. Komen for the Cure.
 
Please consider our environment before printing this e-mail or attachments.
----------------------------------
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
----------------------------------



More information about the Ale mailing list