#!/bin/sh cd ${0%/*} # go to project root if [ $# -eq 0 ]; then echo "Please provide the path" exit 1 fi set -xe for i in $1/file*.ppm; do pnmtopng "$i" >> "${i/ppm/png}" done