News for hackers. Stuff that matters.
Re:Adventures in Shell Scripting by RiderOfGiraffes on Sunday August 23, 2009 @03:34PM (#780872)
Of course, for the given question you can simply do:

    rename oldname newname *
or, for other unix-like systems/flavors

    rename "s/oldname/newname/" oldname.*
Re:Adventures in Shell Scripting by billswift on Sunday August 23, 2009 @08:41PM (#781278)
Thanks, I've been using Linux for 13 years now and didn't even know the rename command existed; I was taught to use mv to rename files.
Re:Adventures in Shell Scripting by RiderOfGiraffes on Monday August 24, 2009 @03:46AM (#781714)
I've been using Unix/Linux for nearly 20 years, and I stumbled across the "rename" command about 5 years ago when I was regularly using 5 different operating systems. I typed "rename" and wondered why it didn't do what I expected. I had intended "mv".

Don't confuse them. I used the difference to learn more precisely what happens in a filing system when you do a "mv" as compared with a "rename". It was interesting.

I've since forgotten most of the details, but it occasionally proves useful.

Re:Adventures in Shell Scripting by billswift on Sunday August 23, 2009 @03:07PM (#780835)
This is a minor script, even I was doing this sort of stuff ten years ago, but this is the sort of stuff I would like to see more of. So my question, and primary reason for posting this, is: what web sites and aggregators do you know where this kind of stuff, interesting scripts and even functions, is posted? Most of the more formal sites like CPAN for perl are a pain for just browsing to learn new tricks and ideas.
Re:Adventures in Shell Scripting by akirk on Sunday August 23, 2009 @06:00PM (#781087)
Re:Adventures in Shell Scripting by billswift on Sunday August 23, 2009 @08:45PM (#781283)
Thanks, I had actually seen this site before, but it was one of the many I lost track of when my hard-disk controller died a couple years ago. It went goofy before it died and scrambled a lot of stuff on my hard drive so I couldn't recover it when I got a new computer.

EDIT: I'm not a total idiot, I was backing up most of my files, but I often forgot to back up my favorites list.

Re:Adventures in Shell Scripting by mahmud on Sunday August 23, 2009 @10:07PM (#781364)
Re:Adventures in Shell Scripting by jsares on Tuesday August 25, 2009 @12:28PM (#785143)
http://stackoverflow.com and http://serverfault.com/ have good shell scripting discussions
Re:Adventures in Shell Scripting by sjs on Sunday August 23, 2009 @04:28PM (#780965)

    autoload zmv
    zmv 'oldname.*' 'newname.$1'
Re:Adventures in Shell Scripting by erlanger on Sunday August 23, 2009 @04:06PM (#780925)
If this is an adventure, driving to McDonalds is an epic journey.