Skip to content

Instantly share code, notes, and snippets.

@andrewle
Created January 13, 2010 23:52
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 andrewle/276698 to your computer and use it in GitHub Desktop.
Save andrewle/276698 to your computer and use it in GitHub Desktop.
# Rename a bunch of pngs to add leading 0's
#!/usr/bin/env ruby
`ls -1 *.png`.each_line do |l|
`mv #{l.strip} #{l.strip.sub(/_(\d5)(\.|_)/, '_0\1\2')}` if l.match(/_\d5(\.|_)/)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment