skip to main | skip to sidebar

the evil roundabout

things that I need to remember, would like to build, enterprise-level stuff (or so I'm told), simplistic coding things...

Saturday, February 21, 2009

perl one-liner

perl -e 'while(<*.png>){$n=sprintf("%02d",++$i,$_);rename($_,$n."frumpus\.png")}'

append an ascending number to all the files in a directory: ie "27frumpus.png"
Posted by Ash at 2:26 AM
Labels: Perl

0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Links

  • catfingers.net
  • catfinger's blog
  • ss64.com

Blog Archive

  • ►  2011 (7)
    • ►  August (2)
      • samba: running swat from xinetd
      • atypical web applications
    • ►  February (4)
      • Simple Rails app
      • gnu screen keyboard commands
      • OSX SnowLeopard: switch audio
      • Centos 4: install Ruby, gem & mechanize
    • ►  January (1)
      • Apple annoyances : you downloaded this file from t...
  • ►  2010 (2)
    • ►  November (1)
      • projects...
    • ►  January (1)
      • audio filters & such
  • ▼  2009 (5)
    • ►  November (4)
      • heart of darkness
      • JavaScript print (to console): Rhino
      • JavaScript development environment
      • http proxy environment variable
    • ▼  February (1)
      • perl one-liner
  • ►  2008 (10)
    • ►  November (4)
      • whatever
      • yeah yeah
      • Perl modules different flavours
      • list installed perl modules
    • ►  May (5)
      • DBD::Oracle gotcha
      • Oracle client-only on unix systems
      • Perl - read a bunch of files
      • maxim #1
      • comment #1
    • ►  January (1)
      • cleaning up the filesystem
  • ►  2007 (6)
    • ►  December (3)
      • and...
      • datestamps
      • age-old vi/vim question
    • ►  October (3)
      • mount
      • sortable directories
      • bookmarklets

Contributors

  • Ash
  • Ashley