#!/bin/bash
cd ./google
l=$(ls)
i=0
for s in $l
do
if [[ $(file -b $s) =~ PNG ]]
then
#i=$(($i+1))
#str=$(echo $s | sed 's/\(.*\)\(\.jpg\)/\1.png/g')
#t=$(echo $str | sed 's/\(.*\)\(\.png\)/\1.jpg/g')
t=$(echo $s | sed 's/\(.*\)\(\.png\)/\1.jpg/g')
echo $t $s
#mv $s $str
cat ../graphs.tex | sed "s/$t/$s/g" > ../graphs2.tex
mv ../graphs2.tex ../graphs.tex
fi
done
echo $i
cd ..