1 #!/bin/bash
 2 
 3 # Copyright (C) 2005.  Kurt Schwehr
 4 # Released under the GPL
 5 
 6 # Simple script to delete frames in a sequence that are the same
 7 
 8 # Max is one beyond the last frame number
 9 declare -ir max=3005
10 declare -i  cur=0
11 #declare -i  cur=2100
12 declare -i  prev=999999
13 
14 while [ $cur != $max ]; do
15   echo $cur
16   curName=`printf "%05d.png" $cur`
17   echo $curName
18   prevName=`printf "%05d.png" $prev`
19   echo $prevName
20 
21   cmp $curName $prevName > /dev/null
22   result=$?
23   if [ "0" == "$result" ]; then
24       echo "Same"
25       rm -f $curName
26   else
27       prev=$cur      
28   fi
29   cur=$[cur+1]
30 done


syntax highlighted by Code2HTML, v. 0.9.1