Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Whorwood benwhorwood

View GitHub Profile
View capture.sh
#!/bin/bash
ctr=1
while true; do
paddednum=$(printf "%05d" $ctr)
echo ffmpeg... $paddednum
sleep 1
View zeropad.sh
#!/bin/bash
# for i in *.jpg; do mv $i $(../zeropad.sh $i); done
num=`expr match "$1" '[^0-9]*\([0-9]\+\).*'`
paddednum=`printf "%05d" $num`
echo ${1/$num/$paddednum}