Skip to content

Instantly share code, notes, and snippets.

@benwhorwood
Created May 22, 2016 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benwhorwood/aa08962f5f70544cc1581baaad59ce86 to your computer and use it in GitHub Desktop.
Save benwhorwood/aa08962f5f70544cc1581baaad59ce86 to your computer and use it in GitHub Desktop.
#!/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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment