3 ms·
Adventures in Shell Scripting
- billswift 17y agoThis 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.
- akirk 17y agoCheck out http://www.commandlinefu.com/ http://www.commandlinefu.com/
- billswift 17y agoThanks, 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.
- mahmud 17y agohttp://www.shelldorado.com/ http://www.shelldorado.com/
- jsares 17y agohttp://stackoverflow.com http://stackoverflow.com and http://serverfault.com/ http://serverfault.com/ have good shell scripting discussions
- RiderOfGiraffes 17y agoOf course, for the given question you can simply do: rename oldname newname * or, for other unix-like systems/flavors rename "s/oldname/newname/" oldname.*
- billswift 17y agoThanks, 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.
- RiderOfGiraffes 17y agoI'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.
- erlanger 17y agoIf this is an adventure, driving to McDonalds is an epic journey.
- sjs 17y agoautoload zmv zmv 'oldname.*' 'newname.$1'