1 2 3 4 5 6 7 8 9
#!/bin/bash time=$(date +%Y-%m-%d_%H%M%S) scanimage -b -x 214.98 -y 294.973 for img in out*.pnm; do newfile="${time}_$((i++)).jpg" convert "$img" "$newfile" && rm "$img" done