#!/bin/bash i=0 for img in `ls scans/*.jpg`; do convert $img -density 72 split/input$i.jpg i=$((i+1)); done