#!/bin/bash # ./screencapture_loop delay_in_seconds file_name_prefix x=1; while : do screencapture -C -m $2-`printf "%03d" $x`.png x=$(( $x + 1 )); sleep $1 done