#!/bin/sh
: ${w:=4}
: ${g:=g}
rename-x 's/(\d+)/sprintf("%0'$w'd", $1)/e'"$g" "$@"
