by Nathan
You know those little tasks that really need to be done, yet send you scurrying for any excuse to procrastinate? I came up across one of those the other day - I had some files (module1.zip, module2.zip, library1.zip, etc.) and needed to unzip them all into subdirectories with the same name as the zip file. For example, module1.zip should have its contents unzipped to a directory called module1. Not a big deal to just do a few unzip commands, but there were over 120 of these files. Rather than do something crazy (like transfer the files to a windows box, use winzips unzip using filenames as folders then transfer them back) I wrote the following perl script:
#!/usr/bin/perl
system('unzip $_ -d '.(/(.+).zip/)[0]) foreach @ARGV"
Saturday, February 04, 2006
Subscribe to:
Post Comments (Atom)
Popular Posts
- Java Examples - JExamples.com
- iReport - OpenSource Java Reporting Tool
- as400 iSeries NetServer Disabled user profiles
- Create a Custom Live Linux CD - Leveraging BusyBox and OpenSSH
- Search for text in vi or vim
- Encode HTML Entities - Showing code in blogs
- IBM eServer iSeries - iSeries NetServer: Command Line Setup
- Reno County is preparing to move from an AS400 computer system to a personal-computer-based system
- Super $500 Myth Project
- HOW TO make a Powerbook in to a Wi-Fi access point!
No comments:
Post a Comment