#!/bin/bash count=0 LC_ALL=C rm -rf public mkdir -p public SECONDS=0 for file in screenshots/buck-rogers-ctd-*.png; do newName="buck-rogers-ctd-$(printf '%03d' "${count}").png" thumbName="${newName%.*}-thumb.jpeg" echo -n "${count}: ${file}... "; cp "${file}" "public/images/${newName}" magick "${file}" -resize x108 -quality 50 -strip "public/images/${thumbName}"; echo "done"; count=$((count + 1)) done echo "done in ${SECONDS}s"