#!/bin/bash first=$1 last=$2 if [ $# -gt 2 ]; then $0 first_photo last_photo elif [ $# -lt 2 ]; then last=`gphoto -n 2>/dev/null` if [ 0$last -eq 0 ]; then echo "Can't find last picture" exit fi echo "Last photo is $last" fi if [ $# -eq 0 ]; then first=1 fi i=$first while [ $i -le $last ] do echo $i j=$i if [ $j -lt 10 ]; then j="00$j" elif [ $j -lt 100 ]; then j="0$j" fi gphoto -s $i pict-$j.jpg i=`expr $i + 1` done