Skip to content

Instantly share code, notes, and snippets.

@Daij-Djan
Last active December 21, 2020 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daij-Djan/35aaab9b644e3cbf68e4ed241467bc0f to your computer and use it in GitHub Desktop.
Save Daij-Djan/35aaab9b644e3cbf68e4ed241467bc0f to your computer and use it in GitHub Desktop.
p="/Users/dpich/Desktop/t/bilder/impressionen/"
echo $p
t="/Users/dpich/Dropbox (Personal)/Maria's Art/__Copies For Website/Impressionen/"
echo $t
cd "$t"
for f in `ls $p`; do
file=$p/$f
img=`pcregrep -o1 -e "<img src=\"(.*_med).*\\.jpeg\"" "$file"`
img_path=$p/$img"_hr.jpeg"
img_name=`basename "$img_path"`
echo "process "$file":"
if test -f "$img_path"; then
echo "copy "$img_path" to "$img_name
cp $img_path $img_name
else
echo "no image"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment