Lost Entropy

Aaron B. Russell’s personal blog

Archive for December, 2002

fnclean.pl

Jon,

Open a console window, type in pico ~/fnclean.pl, and paste this in:

#!/usr/bin/perl

while (<STDIN>) {
    chomp($_);
    $oldfilename = $_;
    s/_//;
    $newfilename = $_;
    print "$oldfilename -> $newfilename...";
    `mv $oldfilename $newfilename`;
    print " done!\n";
}

Then press Control-O, hit enter, then press Control-X to save and quit pico. Then type in chmod 755 ~/fnclean.pl. Then call the program like this: ls /path/to/files/*.jpg | ~/fnclean.pl

The output will look like this:
[nanaki:~] idigital% ls /Users/idigital/*.jpg | ~/fnclean.pl
/Users/idigital/asdfkljhasdfil_73.jpg -> /Users/idigital/asdfkljhasdfil73.jpg… done!
/Users/idigital/foo_3.jpg -> /Users/idigital/foo3.jpg… done!
/Users/idigital/foo_4.jpg -> /Users/idigital/foo4.jpg… done!
/Users/idigital/foo_423.jpg -> /Users/idigital/foo423.jpg… done!
/Users/idigital/foo_42323453.jpg -> /Users/idigital/foo42323453.jpg… done!
/Users/idigital/foo_4234523453.jpg -> /Users/idigital/foo4234523453.jpg… done!
/Users/idigital/foo_4234523459783.jpg -> /Users/idigital/foo4234523459783.jpg… done!
/Users/idigital/foo_42453.jpg -> /Users/idigital/foo42453.jpg… done!
/Users/idigital/foobar_42453.jpg -> /Users/idigital/foobar42453.jpg… done!
[nanaki:~] idigital%

Enjoy.

Aaron.

  • 7 Comments
  • Filed under: Posts
  • Randomness

    I was hungry, so I just got

  • A chicken and piccalilli sandwich
  • A bag of crisps
  • A mince pie
  • A cup of tea
  • A can of coke
  • 2 paracetamol tablets
  • 2 ibuprofen tablets

    Now to munch it, and then go to bed.

  • 0 Comments
  • Filed under: Posts
  • Party at Jamie’s

    Party yesterday at Jamie’s:

    Met up with Cat, Nicky and Jon in Bromley, before meeting up with 239087234908 people in Croydon. Got to Jamie’s, got very drunk, very quickly, on any alcoholic liquid which happened to come my way, Cat got off with some other guy, I jumped through a window, um… yeah, good party :)

  • 3 Comments
  • Filed under: Posts
  • 1606

    New userpic at the request of . :p

  • 0 Comments
  • Filed under: Posts
  • Woo, S2!

    Oh yeah, my journal’s now using S2, and has been for a few days now… :D

  • 9 Comments
  • Filed under: Posts
  • Woah…

    Haha, cool, I just came across a post in a journal saying this:

    “*grins* I just got IM’ed by himself. He just wanted to know how I found this site, but it was still kinda cool. Sorta like if Brad Fitzpatrick had IM’ed me the day I started my Livejournal.

    I feel very important now.

    I almost didn’t answer him, because it showed up as a message from someone named “Aaron,” and I thought it was my evil jerky ex-roommate Aaron, who stole from my house and dealt coke from our house, and lied about it.

    I think I might go make myself some Matzoh Brai now.

    Have I friended anyone here yet?
    Maybe I’ll go friend . Yeah, I think I’ll do that. I almost did on LJ a few months ago, and I can’t remember why I didn’t. So, I’ll do it here and be different.”

  • 3 Comments
  • Filed under: Posts
  • Christmas stuff

    http://selphie.noc.dcginternet.co.uk/gallery/christmas2002

    (I’m still adding photos to that…)

  • 5 Comments
  • Filed under: Posts
  • The Adventures of Paul Ooshen

    The Adventures of Paul Ooshen (Say it fast…)

    http://www.livejournal.com/talkpost.bml?journal=dilbertdaily&itemid=11383

  • 1 Comment
  • Filed under: Posts
  • Important Announcement

    There’s an important announcement thing over at Minilog.com. Go. Read it. Rawr.

  • 18 Comments
  • Filed under: Posts
  • Help!

    Error running startup hook:
    Undefined subroutine &CML::start_request called at (eval 141) line 31.

  • 0 Comments
  • Filed under: Posts