#!/bin/sh NOW=$( TZ=UTC date -Ins | tr T . | tr -d : | sed -E 's/(..),(...).*/\1.\2/' ) if [ $# = 0 ] then ACTUAL_BATCH= fi if $ACTUAL_BATCH then format=scan_${NOW}_%.3d.png else format=scan_${NOW}.png fi scanimage --mode=Color --progress --format=png --batch="$format"