Skip to content

Instantly share code, notes, and snippets.

@dnlcrl
Created January 3, 2016 18:05
Show Gist options
  • Save dnlcrl/7110dab3f819299e6b9e to your computer and use it in GitHub Desktop.
Save dnlcrl/7110dab3f819299e6b9e to your computer and use it in GitHub Desktop.
#! /bin/sh
# rename all PNGs in . from 0001.png to 0004.png
a=1;
for i in *.png; do
new=$(printf "%03d.png" "$a");
mv -- "$i" "$new";
let a=a+1;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment