#!/bin/sh convert_to_webp () { for file in ~/stf/ss/bnw/*.png do OUTPUT=${file%.png} echo "$OUTPUT" convert -quality 80 "$file" "$OUTPUT.webp" done rm -f ~/stf/ss/bnw/*.png } convert_to_webp